Help with Always on top positioning 
Author Message
 Help with Always on top positioning

Hello,

Need a little help here, How do I code so that a form I have is
"always on top" no matter what other applications are running on the
user machine. It's just a little reminder program and I want the small
form to remain visible in front of other application screens when it
is running. Thanks in advance

John



Sun, 24 Sep 2000 03:00:00 GMT  
 Help with Always on top positioning

I hope i understand well.

The simplest way to do that is to use the API Set WondowPos.

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

then in your form_load you insert :

dim result as long

Result = SetWindowPos(Restit.hwnd, -1, 0, 0, 0, 0, Flags)

the value -1 is the value of the HWND_TOPMOST the others values are :

Public Const HWND_TOP = 0
Public Const HWND_BOTTOM = 1
Public Const HWND_NOTOPMOST = -2

i hope it helps you


Quote:
>Hello,

>Need a little help here, How do I code so that a form I have is
>"always on top" no matter what other applications are running on the
>user machine. It's just a little reminder program and I want the small
>form to remain visible in front of other application screens when it
>is running. Thanks in advance

>John



Mon, 25 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Always on top (ALWAYS)

2. Make a form always on top - always

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

4. Help with Always on Top VB6 please?

5. Always on top help...

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

7. help: always on top

8. Help!! ...Always on top

9. ALWAYS ON TOP, need help!

10. Help please: With always on top forms.

11. HELP: Setting "ALWAYS ON TOP" Property

12. Help: Always on top

 

 
Powered by phpBB® Forum Software