crip_walk_g
asked on
HOW TO KEEP A WINDOW ALWAYS ON TOP
hey every1...
i need to keep a window always on top. it does not need to have the focus (recive keyboard and mouse input), but must be ontop.
if anyone knows how to do this (using win32 c++ code) then pls let me know.
thanks in advance,
suma
i need to keep a window always on top. it does not need to have the focus (recive keyboard and mouse input), but must be ontop.
if anyone knows how to do this (using win32 c++ code) then pls let me know.
thanks in advance,
suma
ASKER
i could not find any suitable code in that article.
the introduction was certainly about that topic, but when it got down to the actual source code it seemed to be about everything except keeping a window always on top...
the introduction was certainly about that topic, but when it got down to the actual source code it seemed to be about everything except keeping a window always on top...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use bring windowtoTop Win32 API
The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.
'This program needs two forms, two buttons and a module
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
''''''''''''''
'in form1
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
'Set Form2 on top
BringWindowToTop Form2.hwnd
End Sub
Private Sub Form_Load()
Form2.Visible = True
End Sub
''''''''''''''
'in form2
Private Sub Command1_Click()
'Set Form1 on top
BringWindowToTop Form1.hwnd
End Sub
The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.
'This program needs two forms, two buttons and a module
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
''''''''''''''
'in form1
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
'Set Form2 on top
BringWindowToTop Form2.hwnd
End Sub
Private Sub Form_Load()
Form2.Visible = True
End Sub
''''''''''''''
'in form2
Private Sub Command1_Click()
'Set Form1 on top
BringWindowToTop Form1.hwnd
End Sub
ASKER
cheifsahab:
this function brings a window to the top, but does not keep it there.
AlexFM:
sweet... extremely simple, while completly effective
thanks y'all
this function brings a window to the top, but does not keep it there.
AlexFM:
sweet... extremely simple, while completly effective
thanks y'all
http://www.codeproject.com/dialog/AOTop.asp?df=100&forumid=28177&exp=0&select=674409