mfarid1
asked on
Keeping a window always at the bottom
I have an MDI application and a background form called frmBackground which I would like to be on the background at all times. My problem is: whenever I do Ctrl-Tab to move through the open windows of the app, only the window with focus is visible(which means is ahead of the background form). Every other form goes behind the background form and becomes invisible. How do I keep the background form at the bottom of the ZOrder at all times when I do Ctrl-Tab through the other forms?
Musleh
Musleh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hmm actually.. just this..
frmBackground.ZOrder 1
frmBackground.ZOrder 1
TAM,
What's the idea of locking the question? You should know better!
What's the idea of locking the question? You should know better!
ASKER
Thanks. The solution klugy but worked.
Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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
Public Const HWND_BOTTOM = 1
Public Const HWND_DESKTOP = 0
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOREDRAW = &H8
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H4
lReturn = SetWindowPos(form1.hWnd, HWND_DESKTOP, 0,0,0,0,SWP_NOMOVE+SWP_NOS