Results 1 to 3 of 3

Thread: Always on top

  1. #1

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628

    Question Always on top

    i have a question that i would like to be answered asap!
    how do you make the form always be on top like winamp and winzip or something? I really want to use it on my app. thanks in advance!

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    From the great guys at www.allapi.net:

    VB Code:
    1. Const HWND_TOPMOST = -1
    2. Const HWND_NOTOPMOST = -2
    3. Const SWP_NOSIZE = &H1
    4. Const SWP_NOMOVE = &H2
    5. Const SWP_NOACTIVATE = &H10
    6. Const SWP_SHOWWINDOW = &H40
    7. Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As _
    8. Long, ByVal hWndInsertAfter As Long, ByVal X As _
    9. Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, _
    10. ByVal wFlags As Long)
    11.  
    12. Private Sub Form_Activate()
    13.     'KPD-Team 1998
    14.     'URL: [url]http://www.allapi.net/[/url]
    15.     'E-Mail: [email][email protected][/email]
    16.     'Set the window position to topmost
    17.     SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
    18. SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _
    19. Or SWP_NOSIZE
    20. End Sub
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    hey hobo! thanks for the code. i hope your shareware thing works out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width