Results 1 to 7 of 7

Thread: Ignore "Show Desktop"

  1. #1

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Ignore "Show Desktop"

    Hey everybody,

    I'm making an application that sort-of works like a desktop widget.

    My widget should stay visible when a user triggers "Show Desktop" (it's what happens when WinKey+D is pressed).

    How do I do this?

    Thanks for your help,
    Alexander.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  2. #2
    Member
    Join Date
    May 2006
    Posts
    60

    Re: Ignore "Show Desktop"

    using a timer?? that is what i do most of time.

    If Me.WindowState = FormWindowState.Minimized Then


    or you can remove the controlbox an set the topmost property to true
    Last edited by Neophyte|NL; Jun 8th, 2009 at 05:04 AM.

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Ignore "Show Desktop"

    There's no need to use a timer, you can put your trap in the form's sizechanged event :

    Code:
        Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
    
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Normal
            End If
    
        End Sub
    Its not an ideal solution though as you will get a flicker as the form is minimized and then restored.

  4. #4
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Ignore "Show Desktop"

    Although with a little experimenting it turns out that neither of them seem to work properly in the case of Win+D - it seems that this does something more than minimising the form - it appears to make it invisible as well.

  5. #5

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Re: Ignore "Show Desktop"

    That's exactly my problem... It seems like no events are triggered for my program when the "Show Desktop"-command is executed.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  6. #6
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Ignore "Show Desktop"

    Having had a quick google around, there's some code using APIs to prevent this happening in this article on MSDN. I haven't tried it myself but it may work.

  7. #7
    Member
    Join Date
    May 2006
    Posts
    60

    Re: Ignore "Show Desktop"

    thats weird.

    when i try the option to set topmost and no border it works fine here....

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