Results 1 to 4 of 4

Thread: Always on top

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Posts
    24

    Post

    Does anyone know a GOOD always on top code?



    ------------------
    Doomstar
    http://come.to/Doomstar

  2. #2

    Post

    Hi !

    What does GOOD mean ?

    I know something like:

    SetWindowPos(Me.hWnd, HWND_TOPMOST, 0,0, 100, 100, SWP_SHOWWINDOW)

    Add the declaration of the API function and it should work.

    Björn


    ------------------
    EMAIL: [email protected]

    PAGE: <A HREF="http://members.xoom.com/sharetools
    " TARGET=_blank>http://members.xoom.com/sharetools
    </A>

  3. #3
    Junior Member
    Join Date
    Dec 1999
    Location
    Germany
    Posts
    17

    Post

    Try this, it's from the project I am currently working at:

    Code:
    Const SWP_NOMOVE = 2
    Const SWP_NOSIZE = 1
    Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
    Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    
    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
    
    Private Sub SetAlwaysOnTop()
    Dim Temp as variant
    
    Temp = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    
    End Sub
    
    Private Sub NoAlwaysOnTop()
    Dim Temp as variant
    
    Temp = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
    
    end sub
    Regards,

    Frank

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Posts
    24

    Post

    Thanks Frankiz, it worked!


    ps. Good luck with your project




    ------------------
    Doomstar
    http://come.to/Doomstar

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