PDA

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


Doomstar
Jan 2nd, 2000, 05:13 PM
Does anyone know a GOOD always on top code?



------------------
Doomstar
http://come.to/Doomstar

Björn
Jan 2nd, 2000, 06:49 PM
Hi !

What does GOOD mean ?

I know something like:

SetWindowPos(Me.hWnd, HWND_TOPMOST, 0,0, 100, 100, SWP_SHOWWINDOW)

Add the declaration of the API function and it should work.

Björn


------------------
EMAIL: shareware@lycosmail.com

PAGE: <A HREF="http://members.xoom.com/sharetools
" TARGET=_blank>http://members.xoom.com/sharetools
</A>

Frankiz
Jan 2nd, 2000, 06:49 PM
Try this, it's from the project I am currently working at:



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

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 SetAlwaysOnTop()
Dim Temp as variant

Temp = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)

End Sub

Private Sub NoAlwaysOnTop()
Dim Temp as variant

Temp = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)

end sub



Regards,

Frank

Doomstar
Jan 6th, 2000, 03:01 AM
Thanks Frankiz, it worked!


ps. Good luck with your project




------------------
Doomstar
http://come.to/Doomstar