G
Guest
hi, im attempting to get an applications Icon by using the method
Icon.FromHandle() and passing in a windows handle, yet nothing works ive
tried two different things and neither work. Ive been googleing this to no
avail....code:
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(Me.components)
tray.Icon = Icon.FromHandle(m.HWnd)
''tried using Me.Handle to see if that would work but no
'tray.Icon = Icon.FromHandle(Me.Handle)
tray.Visible = True
AddHandler tray.DoubleClick, AddressOf
NotifyIcon1_DoubleClick
SendMessage(m.HWnd.ToInt32, 0, Nothing, Nothing)
End Select
End If
End Sub
i set a breakpoint and step through, the method returns something, but
apparently not an Icon like the MSDN documentation says...any idea how i can
get this working? thanks
Icon.FromHandle() and passing in a windows handle, yet nothing works ive
tried two different things and neither work. Ive been googleing this to no
avail....code:
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(Me.components)
tray.Icon = Icon.FromHandle(m.HWnd)
''tried using Me.Handle to see if that would work but no
'tray.Icon = Icon.FromHandle(Me.Handle)
tray.Visible = True
AddHandler tray.DoubleClick, AddressOf
NotifyIcon1_DoubleClick
SendMessage(m.HWnd.ToInt32, 0, Nothing, Nothing)
End Select
End If
End Sub
i set a breakpoint and step through, the method returns something, but
apparently not an Icon like the MSDN documentation says...any idea how i can
get this working? thanks