|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Notify Icon not being displayedprovided 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 -- -iwdu15 You might want to try declaring tray as NotifyIcon in the form
declarations, rather than as a local variable. T iwdu15 wrote: Show quoteHide quote >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 > > > i have tried declaring it locally and globally and neither work. I am
attempting to create a program that will be able to put any application in the system tray....so i need to make a NotifyIcon at run time......any suggestions would be great, thanks -- -iwdu15 place a notify icon on your form and set visible as you want.
Show quoteHide quote "iwdu15" <jmmgoalsteratyahoodotcom> ha scritto nel messaggio news:C4E7725C-2745-48E3-9220-6D123F62EF0A@microsoft.com... >i have tried declaring it locally and globally and neither work. I am > attempting to create a program that will be able to put any application in > the system tray....so i need to make a NotifyIcon at run time......any > suggestions would be great, thanks > -- > -iwdu15 |
|||||||||||||||||||||||