Valhalla Legends Forums Archive | General Programming | ALWAYS ON TOP

AuthorMessageTime
WiLD
How do i make a window ALWAYS ON TOP of everything?
July 27, 2003, 10:20 AM
iago
Which language? If it's vb, gimme a 1/2 hour to eat breakfast, and I will tell you then :)
July 27, 2003, 11:58 AM
iago
[code]
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)

Private Sub Form_Activate()
'Thanks to KPDTeam@Allapi.net for the always-on-top code!
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
[/code]
July 27, 2003, 12:03 PM
Yoni
That was 5 minutes
July 27, 2003, 6:28 PM
iago
I was hoping nobody would notice! I did it while my breakfast was being microwaved :-)
July 28, 2003, 7:11 AM

Search