CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2005
    Posts
    140

    Cool Form Behind Another...

    how can i set a form position behind another.

    i only have handles.

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Form Behind Another...

    The SetWindowPos API function is propably what you're looking for.

    Check ww.allapi.net for declaration and usage.

  3. #3
    Join Date
    Mar 2006
    Posts
    135

    Re: Form Behind Another...

    allapi.net is no longer available

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Form Behind Another...

    Um, how about MSDN?? ??
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Aug 2005
    Posts
    140

    Re: Form Behind Another...

    i know but i sets to top or bottom.
    what i want to do is to set a form behind a specified form.

    but i have only handles.

    Code:
    Private sub SetBehind(Handle1 as long,Handle2 as long)
    'set Handle2 behind Handle1
    end sub

  6. #6
    Join Date
    Aug 2006
    Posts
    145

    Re: Form Behind Another...

    SetWindowPos allows you to set relative z-order position also:
    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 SWP_NOMOVE = &H2
    Private Const SWP_NOACTIVATE = &H10
    Private Const SWP_NOSIZE = &H1
    Private Const SWP_FLAGS = SWP_NOMOVE Or SWP_NOACTIVATE Or SWP_NOSIZE
    
    Private Sub Command1_Click()
        SetWindowPos Handle1, Handle2, 0&, 0&, 0&, 0&, SWP_FLAGS
    End Sub

  7. #7
    Join Date
    Aug 2005
    Posts
    140

    Re: Form Behind Another...

    ty, this was something i never known
    ty very much...

  8. #8
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Form Behind Another...

    Anybody any idea what happened to Allapi.net?

    MSDN certainly has all info, but Allapi was such a fantastic, good organized site to look up syntax, study samples and learn about all calls. I just don't know how to go on without them.

  9. #9
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Form Behind Another...

    Good question, only found out quite recently myself.

    You can however go to apifinder

    Mentalis still do have an API guide which you can download here

    That's very good as well
    Last edited by HanneSThEGreaT; February 20th, 2007 at 08:14 AM.

  10. #10
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Form Behind Another...

    Thank you, Hannes, I check apifinder.

    But hey, the other link is exactly what I used all the time under the name of Allapi.net. It still says so in the tag of my explorer. So nothing is really gone, only the base URL seems to have changed.

    I always use their API-List to look at parameters and study sample code and then I use the API-viewer to find out what the constant values are.
    I really would have missed that one. Thanks again.

  11. #11
    Join Date
    Aug 2006
    Posts
    145

    Re: Form Behind Another...

    AllAPI.net is now http://allapi.mentalis.org/

    see this thread @ VBF for more info

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