I've got this little 'Sticky Notes' type of application and the form I have is a borderless, taskbarless form and for Windows 2000 compatability I'm using VS 2008 and targeting the 2.0 framework. One of the hurdles I have is that in XP, Vista & 7 when you click the Show Desktop button all of my note's windows get minimized and without a taskbar icon, it's not easy to get them back (at least not for a normal user) & I'm looking for a way to either right after the windows minimize I just have them all show again or if I can skip the minimizing message in the wndproc altogether that'd be great.
I've put together a test app that'll show the messages in a listbox for the form, but I'm not sure how to go about skipping sending the message to the form's base class. Here's a snippet, listMessages is the listbox on the form:
I've put together a test app that'll show the messages in a listbox for the form, but I'm not sure how to go about skipping sending the message to the form's base class. Here's a snippet, listMessages is the listbox on the form:
VB.NET:
Private Const WmSize As Integer = 5
Private Const SizeRestored As Integer = 0
Private Const SizeMinimized As Integer = 1
Private Const SizeMaximized As Integer = 2
Private Const SizeShow As Integer = 3
Private Const SizeHide As Integer = 4
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Try
If m.Msg = WmSize Then
Dim wparam As Integer = m.WParam.ToInt32()
Select Case wparam
Case SizeMinimized, SizeHide, SizeMaximized, SizeShow, SizeRestored
listMessages.Items.Add(String.Format("{0:X} {1:X} {2:X} {3:X} {4:X}", m.Msg, m.WParam.ToInt32(), m.LParam.ToInt32(), m.HWnd.ToInt32(), m.Result.ToInt32()))
End Select
End If
Catch generatedExceptionName As Exception
listMessages.Items.Add("Err: " & generatedExceptionName.Message)
End Try
End Sub