PDA

Click to See Complete Forum and Search --> : always on top


aturner
Nov 7th, 2000, 05:34 AM
you probably get this all the time but ...

How do you make your own start bar.

Its alway on top, no matter what you load, how do you do it?

gfrench
Nov 7th, 2000, 06:13 AM
Use the setwindowpos API call,

Module Code:
Public Declare Function SetWindowPos Lib "user32.dll" (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

Form Code:
ret = setwindowpos(me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE OR SWP_NOSIZE)


Hope this helps

Nov 7th, 2000, 01:32 PM
gfrench, don't forget to include everything. (Constants)

Private 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

Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

Private Sub Form_Load()
SetWindowPos Me.hWnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS
End Sub

Nov 7th, 2000, 02:22 PM
You don't need constants if they're short enough.

Private 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

Private Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
End Sub