Results 1 to 5 of 5

Thread: TopMost Form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    that API has to be the most frequently asked about/mentioned in the whole of Win32API

    ------------------
    cintel rules
    www.cintelsoftware.co.uk

  2. #2
    New Member
    Join Date
    Jan 2000
    Location
    Plano, TX, USA
    Posts
    11

    Post

    That works great for making the form Top most of all the Windows for the entire system. I can develop a work around to get it to work for my purposes(When the main form is maximized I will make the sub form top most, and vica versa) But is there a way to make a form top most in a single application, but not for the system. (i.e. when I am in my app that form is on top of it, but when i am in other apps, it is behind those forms?)

  3. #3
    New Member
    Join Date
    Jan 2000
    Location
    Plano, TX, USA
    Posts
    11

    Post

    I need to make on of the forms in my project stay ontop of the other forms in my project at all times. Does anyone know any quick ways to do this with code, or a free OCX that will do it?

    ------------------
    Chris Hockenberry
    Application Engineer
    Willow Bend Communications

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Try this:
    Code:
    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 Const HWND_TOPMOST = -1
    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOSIZE = &H1
    
    Private Sub Command1_Click()
        Call SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  5. #5
    New Member
    Join Date
    Feb 2000
    Posts
    1

    Post

    Yep, I have the same question...

    I would like to keep a single application (only one form) always focused.

    Suggestions?

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