Quote:
>hey,
>there are serveral forms in my project. I want to have one to be a
>control form that is always on top. I tried it with the winapi
>Declare Function SetWindowPos Lib "user32" (By.....
>The result is : the form is loaded but hidden
>who can help
>Gert Barwinski (gba)
I initially show the form -
SplashForm.Show
And then in the load event of the form, I then make it on top -
SetWindowPos SplashForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE +
SWP_NOSIZE
The constants if you require -
Private Const HWND_BOTTOM = 1
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOP = 0
Private Const HWND_TOPMOST = -1
Private Const SWP_DRAWFRAME = &H20
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_NOCOPYBITS = &H100
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOREPOSITION = &H200
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_SHOWWINDOW = &H40
Seems to work.
Regards
Grant