Results 1 to 3 of 3

Thread: Single Form Project Modal to other Apps.

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    2
    My project has only one form. How can I make this form either:

    1. Modal to all other applications - similar to a
    MsbBox

    2. Always visible - similar to a help dialog or an NT task
    Manager

    VBModal

    Any help would be appreciated.

    John


  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    28

    Modal Form

    Try this:
    Code:
    Public 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
    
    Global Const HWND_TOPMOST = -1
    Global Const HWND_NOTOPMOST = -2
    Global Const SWP_NOMOVE = 2
    Global Const SWP_NOSIZE = 1
    Global Const wFLAGS = SWP_NOMOVE Or SWP_NOSIZE
    
    'To make your form TOPMOST:
    SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, wFLAGS
    'To undo it: 
    SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, wFLAGS

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    2
    Thanks!
    It works great!

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