
HELP: How to create a VB application that is always-on-top of other windows?
Quote:
>Hello,
>This VB application main window has higher priority than others. Even you
>focus on other opened windows, this VB application is still on the top and
>keep running. I have seen some windows applications like this, I would like
>to know if this can be done in VB, and how?
>a T d H v A a N n K c S e
>(Thanks in advance)
>Jingbo Zheng
Do this.......
Call it like this:
Dim lRetVal As Long
lRetVal = SetWindowPos(myForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE)
****that is all on one line not 2*****
Then in a module type this
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
****that is all on one line not 2**********
The in the same module add....
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Hope this helps
JMich