|
-
Jun 8th, 2009, 03:18 AM
#1
Thread Starter
Fanatic Member
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!
-
Jun 8th, 2009, 05:00 AM
#2
Member
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.
-
Jun 8th, 2009, 05:05 AM
#3
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.
-
Jun 8th, 2009, 05:13 AM
#4
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.
-
Jun 8th, 2009, 05:47 AM
#5
Thread Starter
Fanatic Member
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!
-
Jun 8th, 2009, 05:53 AM
#6
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.
-
Jun 9th, 2009, 04:46 AM
#7
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|