Results 1 to 4 of 4

Thread: Background Form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Unhappy

    here an API call for this or something close to this:


    Anyone has an idea about how to force a Form
    to remain behind all other Forms (i.e. a
    background Form).

    I tried vbModal and Zorder, but didn't work.

    Thank you


    0101011001000010
    01101111011011100110110001101001011011100110010101110010

  2. #2
    Guest
    Use the SetWindowPos api function.

    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
    
    Global Const SWP_NOMOVE = 2 
    Global Const SWP_NOSIZE = 1 
    Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE 
    Global Const HWND_TOPMOST = -1 
    Global Const HWND_NOTOPMOST = -2
    
    
    Usage
    
    Private Sub Form_Load()
    ontop& = SetWindowPos (Me.hWnd, HWND_NOTOPMOST, _
    0, 0, 0, 0, FLAGS)
    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Wink

    Thanks you Matthew!

    What is the difference between GLOBAL and PUBLIC?
    0101011001000010
    01101111011011100110110001101001011011100110010101110010

  4. #4
    Guest
    Global is older and has been superseded by Public, which is newer and is a bit more flexible.

    the only reason Global is still around is for backwards compatibility.

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