Always on desktop

Im making a sticky note program and I am having a problem because whenever I press the "Show Desktop" button in the quick launch toolbar that minimizes all programs, my sticky notes get minimized too. Can I keep them on the desktop and prevent them from being minimized?
Adam
«1

Comments

  • : Im making a sticky note program and I am having a problem because whenever I press the "Show Desktop" button in the quick launch toolbar that minimizes all programs, my sticky notes get minimized too. Can I keep them on the desktop and prevent them from being minimized?
    : Adam
    :

    Show desktop doesn't neccesarily minimze forms. If your form isn't minimizable (doesn't have a taskbar button), it'll usually simply be hidden.

    I've made one program that was immune to "Show Desktop" and that was completely on accident. I no longer have the source for it (I don't care, it was [email protected] anyway) so I can't be sure how I designed the form. I [italic]think[/italic] it was simply a borderless form with the Always On Top attribute (SetWindowPos code). I know I didn't have anything fancy in there...

    I suggest trying different kinds of borders including normal borders but with controlbox, minmax, etc. turned off (so no caption bar is there) as well as the same combinations "always on top". Personally, I bet anything with a border gets hidden but you'll just have to try.

    Hope this helps any,
    KDL
  • : : Im making a sticky note program and I am having a problem because whenever I press the "Show Desktop" button in the quick launch toolbar that minimizes all programs, my sticky notes get minimized too. Can I keep them on the desktop and prevent them from being minimized?
    : : Adam
    : :
    :
    : Show desktop doesn't neccesarily minimze forms. If your form isn't minimizable (doesn't have a taskbar button), it'll usually simply be hidden.
    :
    : I've made one program that was immune to "Show Desktop" and that was completely on accident. I no longer have the source for it (I don't care, it was [email protected] anyway) so I can't be sure how I designed the form. I [italic]think[/italic] it was simply a borderless form with the Always On Top attribute (SetWindowPos code). I know I didn't have anything fancy in there...
    :
    : I suggest trying different kinds of borders including normal borders but with controlbox, minmax, etc. turned off (so no caption bar is there) as well as the same combinations "always on top". Personally, I bet anything with a border gets hidden but you'll just have to try.
    :
    : Hope this helps any,
    : KDL
    :

    [grey]What explorer actually does when it preforms a desktop toggle, is to move the desktop window on top of all the others, hiding them behind itself, the simple solution to this would be to use someting like always on top, or to make your notes children of the desktop window, effectivly placing them always under all the other windows but above the desktopwindow.
    You could alternatly monitor the z-order position of your form in relation to the desktopwindow and move it back on top when the desktop window moves on top of the others, I haven't figured how to do this just yet.

    DjSpirit, being informative, but alas no solution, at least no good one[/grey]
  • : [grey]What explorer actually does when it preforms a desktop toggle, is to move the desktop window on top of all the others, hiding them behind itself,[/grey]
    :

    You sure? Because when I do that, some of the windows get minimized. Perhaps it minimizes where a minimize is possible and moves on top of the others?
  • : : [grey]What explorer actually does when it preforms a desktop toggle, is to move the desktop window on top of all the others, hiding them behind itself,[/grey]
    : :
    :
    : You sure? Because when I do that, some of the windows get minimized. Perhaps it minimizes where a minimize is possible and moves on top of the others?
    :
    [grey]I was just quoting the msdn, think they should know a thing or two about it.

    DjSpirit, maybe it was wrong of me to assume that M$ know what they are doing.[/grey]
  • : [grey]I was just quoting the msdn, think they should know a thing or two about it.
    :
    : DjSpirit, maybe it was wrong of me to assume that M$ know what they are doing.[/grey]
    :

    Wouldn't be the first time I've found MS to be wrong about their own stuff... Still it could be tricky to figure out for sure since I wouldn't know how to go about it.
  • : : [grey]I was just quoting the msdn, think they should know a thing or two about it.
    : :
    : : DjSpirit, maybe it was wrong of me to assume that M$ know what they are doing.[/grey]
    : :
    :
    : Wouldn't be the first time I've found MS to be wrong about their own stuff... Still it could be tricky to figure out for sure since I wouldn't know how to go about it.
    :
    [grey]There should be a way to get the z-order position of a form, shouldn't there? There's probably some api thingy somewhere to accomplish this. I just haven't found it yet, not that I'm overly zealous in my looking.

    DjSpirit, I might be overly zealous, I'm just not looking[/grey]
  • : : Im making a sticky note program and I am having a problem because whenever I press the "Show Desktop" button in the quick launch toolbar that minimizes all programs, my sticky notes get minimized too. Can I keep them on the desktop and prevent them from being minimized?
    : : Adam
    : :
    :
    : Show desktop doesn't neccesarily minimze forms. If your form isn't minimizable (doesn't have a taskbar button), it'll usually simply be hidden.
    :
    : I've made one program that was immune to "Show Desktop" and that was completely on accident. I no longer have the source for it (I don't care, it was [email protected] anyway) so I can't be sure how I designed the form. I [italic]think[/italic] it was simply a borderless form with the Always On Top attribute (SetWindowPos code). I know I didn't have anything fancy in there...
    :
    : I suggest trying different kinds of borders including normal borders but with controlbox, minmax, etc. turned off (so no caption bar is there) as well as the same combinations "always on top". Personally, I bet anything with a border gets hidden but you'll just have to try.
    :
    : Hope this helps any,
    : KDL
    :

    You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...


    [hr]

    [b][blue]//MicroDot[/blue][/b]


  • : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    :
    :
    : [hr]
    :
    : [b][blue]//MicroDot[/blue][/b]
    :
    :

    Well, if it's a StickyNotes program, you should set the border to none, minimizing the problem (don't mind the pun) and create a sticky note - looking form. then do the HWND_TOPMOST thing.


    _____ __________ _____
    _____-[red]SUPERJOE30[/red]-_____


  • : [grey]There should be a way to get the z-order position of a form, shouldn't there? There's probably some api thingy somewhere to accomplish this. I just haven't found it yet, not that I'm overly zealous in my looking.
    :
    : DjSpirit, I might be overly zealous, I'm just not looking[/grey]
    :

    I actually hadn't considered looking at the ZOrder even though that's what we're talking about. Seems to me that [b]GetTopWindow ByVal 0&[/b] will retrieve the topmost window (parameter is for iterating children, null should be unowned windows). Then [b]GetWindow GW_HWNDNEXT[/b] should return the next window in the zorder. Next call would be the next one... Kinda too bad I really don't feel like trying it (it'd be different if I knew it'd work).
  • : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    :

    Make your own min button?
  • : : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    : :
    :
    : Make your own min button?
    :
    Yea my form looks like a sticky note and there is no border, but I havent had much sucess with HWND_TOPMOST. It seems to minimize it anyway.
  • : Yea my form looks like a sticky note and there is no border, but I havent had much sucess with HWND_TOPMOST. It seems to minimize it anyway.
    :

    Post your HWND_TOPMOST line, you may have structured it incorrectly.
  • : : : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    : : :
    : :
    : : Make your own min button?
    : :
    : Yea my form looks like a sticky note and there is no border, but I havent had much sucess with HWND_TOPMOST. It seems to minimize it anyway.
    :
    Heres what I have in a module. I got it out of an old vb 4 book
    [code]
    Option Explicit
    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
    Dim workalready As Long

    Sub DontMinimize()
    workalready = SetWindowPos(Form1.hwnd, HWND_TOPMOST, Form1.Left, Form1.Top, 0, 0, 0)
    End Sub
    [/code]
    I got a little annoyed at its not-workingness so I renammed it "workalready"
    Adam
  • [b][red]This message was edited by MicroDot at 2004-7-13 10:16:51[/red][/b][hr]
    : : : : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    : : : :
    : : :
    : : : Make your own min button?
    : : :
    : : Yea my form looks like a sticky note and there is no border, but I havent had much sucess with HWND_TOPMOST. It seems to minimize it anyway.
    : :
    : Heres what I have in a module. I got it out of an old vb 4 book
    : [code]
    : Option Explicit
    : 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
    : Dim workalready As Long
    :
    : Sub DontMinimize()
    : workalready = SetWindowPos(Form1.hwnd, HWND_TOPMOST, Form1.Left, Form1.Top, 0, 0, 0)
    : End Sub
    : [/code]
    : I got a little annoyed at its not-workingness so I renammed it "workalready"
    : Adam
    :
    Ok, Im using:

    [code]

    Const HWND_TOPMOST = -1
    Const SWP_NOSIZE = &H1
    Const SWP_NOMOVE = &H2
    Const SWP_NOACTIVATE = &H10
    Const SWP_SHOWWINDOW = &H40
    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)

    Private Sub MeTop()
    SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.Left, Me.Top, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE)
    End Sub

    [/code]

    [hr]

    [b][blue]//MicroDot[/blue][/b]



  • [b][red]This message was edited by TechZimmy at 2004-7-13 10:42:25[/red][/b][hr]
    : [b][red]This message was edited by MicroDot at 2004-7-13 10:16:51[/red][/b][hr]
    : : : : : You only need to set MinButton to false and use SetWindowPos with HWND_TOPMOST and it works fine, but if you want the min button visible I have no idea how to do it in a uncrappy way, maybe you can use SetWindowsHookEx...? The easiest way is to use a timer and check the windowstate and set it to vbNormal if its true, not a very nice way...
    : : : : :
    : : : :
    : : : : Make your own min button?
    : : : :
    : : : Yea my form looks like a sticky note and there is no border, but I havent had much sucess with HWND_TOPMOST. It seems to minimize it anyway.
    : : :
    : : Heres what I have in a module. I got it out of an old vb 4 book
    : : [code]
    : : Option Explicit
    : : 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
    : : Dim workalready As Long
    : :
    : : Sub DontMinimize()
    : : workalready = SetWindowPos(Form1.hwnd, HWND_TOPMOST, Form1.Left, Form1.Top, 0, 0, 0)
    : : End Sub
    : : [/code]
    : : I got a little annoyed at its not-workingness so I renammed it "workalready"
    : : Adam
    : :
    : Ok, Im using:
    :
    : [code]
    :
    : Const HWND_TOPMOST = -1
    : Const SWP_NOSIZE = &H1
    : Const SWP_NOMOVE = &H2
    : Const SWP_NOACTIVATE = &H10
    : Const SWP_SHOWWINDOW = &H40
    : 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)
    :
    : Private Sub MeTop()
    : SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.Left, Me.Top, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE)
    : End Sub
    :
    : [/code]
    :
    : [hr]
    :
    : [b][blue]//MicroDot[/blue][/b]
    :
    :
    :
    :

    When I put this into a form and run it the form kinda dissapears.
    Adam


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories