Results 1 to 9 of 9

Thread: I can do Always On-Top, but Always *Underneath*?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Posts
    20

    I can do Always On-Top, but Always *Underneath*?

    I'm working on a shell replacement for windows (for fun) and I'd like to have my 'desktop' stay on the bottom. Are there API calls that can manage this feat?

    Thanks in advance.

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    something like:

    VB Code:
    1. Private Const HWND_BOTTOM = 1
    2. 'Move window Form1 to the upper-left corner of the screen and make
    3. ' at appear above all other windows permanently.  Note how the function is told not
    4. ' to resize the window, so we don't have to worry about the lower-right coordinate.
    5. Dim flags As Long  ' the flags specifying how to move the window
    6. Dim retval As Long  ' return value
    7.  
    8. ' Do not resize the window, redraw the window in its new location
    9. flags = SWP_NOSIZE Or SWP_DRAWFRAME
    10. retval = SetWindowPos(Form1.hWnd, HWND_BOTTOM, 0, 0, 1, 1, flags)  ' move the window

    let me know

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Posts
    20

    Thanks...

    I'll give it a shot and see what happens.

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    good luck

  5. #5
    DaoK
    Guest
    You can try that :

    VB Code:
    1. Const HWND_TOPMOST = -1
    2. Const HWND_NOTOPMOST = -2
    3. Const SWP_NOSIZE = &H1
    4. Const SWP_NOMOVE = &H2
    5. Const SWP_NOACTIVATE = &H10
    6. Const SWP_SHOWWINDOW = &H40
    7. Private Declare Sub 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)
    8.  
    9. Private Sub Form_Activate()
    10.     'KPD-Team 1998
    11.     'URL: [url]http://www.allapi.net/[/url]
    12.     'E-Mail: [email][email protected][/email]
    13.     'Set the window position to topmost
    14.     SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
    15. End Sub

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    no

    no you can't

    that would set the window to the top of the zorder, right at the top

    use my code

  7. #7
    DaoK
    Guest
    Humm anyways I didnt make that code, it's AllApi.net!

  8. #8
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Yes, but you didn't tailor it to his needs either!

    If you are going to post a variation on what is already there, make it specific and helpful, as my example puts it on the bottom - because i fixed it

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Chaoticmass: Did you try Da_Silvy's suggestion. I'd be interested in what happened.

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