G
Guest
hi, im using this code to display a notifyicon object with information
provided at runtime
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32
Case 1000
Dim tray As New NotifyIcon
tray.Icon = Icon.FromHandle(m.HWnd)
tray.Visible = True
AddHandler tray.DoubleClick, AddressOf
NotifyIcon1_DoubleClick
SendMessage(m.HWnd.ToInt32, 0, Nothing, Nothing)
End Select
End If
End Sub
what i am attempting to do is recreate a project i saw on CodeProject where
you add a menu "Tray Me" to the System menu and when a user clicks on it, the
window is hidden and an icon is displayed, yet this doesnt work....any help
would be great, thanks
provided at runtime
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32
Case 1000
Dim tray As New NotifyIcon
tray.Icon = Icon.FromHandle(m.HWnd)
tray.Visible = True
AddHandler tray.DoubleClick, AddressOf
NotifyIcon1_DoubleClick
SendMessage(m.HWnd.ToInt32, 0, Nothing, Nothing)
End Select
End If
End Sub
what i am attempting to do is recreate a project i saw on CodeProject where
you add a menu "Tray Me" to the System menu and when a user clicks on it, the
window is hidden and an icon is displayed, yet this doesnt work....any help
would be great, thanks