CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Always On Top

  1. #1
    Join Date
    Oct 1999
    Posts
    2

    Always On Top

    Does anyone know how to make a VB form - Always On Top ? (with VB coding, please ...)



  2. #2
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    Re: Always On Top

    This should be placed in the module:

    code:
    --------------------------------------------------------------------------------

    Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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
    Const conHwndTopmost = -1
    Const conHwndNoTopmost = -2
    Const conSwpNoActivate = &H10
    Const conSwpShowWindow = &H40

    --------------------------------------------------------------------------------

    Use this in the event you want to set it topmost:


    code:
    --------------------------------------------------------------------------------

    SetWindowPos hWnd, conHwndTopmost, 0, 0, 0, 0, conSwpNoActivate Or conSwpShowWindow
    SetWindowPos hWnd, conHwndNoTopmost, 0, 0, 0, 0, conSwpNoActivate Or conSwpShowWindow


    [email protected]
    http://smalig.tripod.com

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

Featured