CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Location
    Tallahassee, FL
    Posts
    121

    Form Always ON TOP

    What is the easiest way to achieve this?

    I don't want a Modal form but I do want the form to be on top no matter what form has the focus.

    I have an internet document that needs to open a form and make sure it always stays on top.

    any info would help

    thankx,
    Mongoose


  2. #2
    Join Date
    Feb 2000
    Location
    America
    Posts
    130

    Re: Form Always ON TOP

    Functions and Consts:
    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

    Public Const Swap_NoMove = &H2
    Public Const Swap_NoSize = &H1
    Public Const Swap_Create = &H3
    Public Const HWND_TOP = 0
    Public Const HWND_TOPMOST = -1
    Public Const HWND_NOTOPMOST = -2
    Public Const hWndFlag = Swap_NoMove Or Swap_NoSize

    Sub/Function to use:
    SetWindowPos TheForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, hWndFlag

    Enjoy!
    -Atlantis


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