Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Designating an application as second top-most 1

Status
Not open for further replies.

ChrisNome

IS-IT--Management
Mar 22, 2011
47
US
API's quite frankly are confusing to me and are pretty much like magic in how they work to me. Anyhow, I've managed to use one to designate an access form as the top-most window; this one is strait from microsoft:
Code:
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
                                 ByVal hWndInsertAfter As Long, _
                                 ByVal X As Long, _
                                 ByVal y As Long, _
                                 ByVal cx As Long, _
                                 ByVal cy As Long, _
                                 ByVal wFlags As Long) As Long

Global Const HWND_TOPMOST = -1
Global Const SWP_NOSIZE = &H1
Global Const SWP_NOMOVE = &H2


Function TopMost(F As Form)
   Call SetWindowPos(F.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
                     SWP_NOMOVE Or SWP_NOSIZE)
End Function

[end code]

then you just pass whichever form you want to designate on the event you want.

The question is, if this is topmost, and there is another program I want it to always be on top of, how do i make that program second-topmost so when I move or access that form, it always stays on top of the second app.

Much thanks
CN
 
thanks KiaruB, I've looked at it a couple times and it looks really helpful.

It talks about hot to switch on/off making access itself top-most. I'm sure someone better at API's might be able to deduce how to make another application second top-most from that but I don't get API's that well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top