HELP: How to create a VB application that is always-on-top of other windows? 
Author Message
 HELP: How to create a VB application that is always-on-top of other windows?

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



Wed, 25 Apr 2001 03:00:00 GMT  
 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



Wed, 25 Apr 2001 03:00:00 GMT  
 HELP: How to create a VB application that is always-on-top of other windows?
Looky here:

http://www.mvps.org/vbnet/faq/form/topmost.htm

LFS

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



Wed, 25 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Make a window always on top (of every window..always)

2. Application window always on top?

3. Window always on top, in vb

4. Howto: make always on top windows in VB 5

5. Help, I want my form ALWAYS staying on top of ANY other window

6. window always on top HELP Please

7. Help: How to create a VB application that is always-on-top of all other windows?

8. Keep Window on top of ALL OTHERS in OS.

9. Help.. VB 4.0 Form question-always on top

10. Always on top application

11. Application always on top

12. VB 5 (and perhaps others) always want 1 tab in a tabstrip

 

 
Powered by phpBB® Forum Software