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


Cakkie
February 3rd, 2000, 08:09 AM
How can i make my form stay on top, even when another window is active?

Tom Cannaerts
slisse@planetinternet.be

Aaron Young
February 3rd, 2000, 08:20 AM
Try this:
private Declare Function SetWindowPos Lib "user32" (byval hwnd as Long, byval hWndInsertAfter as Long, byval x as Long, y, byval cx as Long, byval cy as Long, byval wFlags as Long) as Long
private Const HWND_TOPMOST = -1
private Const SWP_NOMOVE = &H2
private Const SWP_NOSIZE = &H1

private Sub Command1_Click()
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub



Aaron Young
Analyst Programmer
ajyoung@pressenter.com
aarony@redwingsoftware.com