CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    UK
    Posts
    3

    How can I make my dialog box be "always on top"?



    I've got a small app (vb 5.0) and I would like it to be the top window - "always on top"


    Any ideas


    Cheers Andy Pike

  2. #2
    Join Date
    Dec 1998
    Posts
    2

    Re: How can I make my dialog box be "always on top"?



    The following sample shows top-most-window


    Hope this helps.


    ============================================================================

    Private Const HWND_TOPMOST = -1

    Private Const SWP_NOMOVE = &H2

    Private Const SWP_NOSIZE = &H1


    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 Form_Load()

    SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

    End Sub

    =============================================================================

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