473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Notify Icon not being displayed

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

--
-iwdu15
Jul 24 '06 #1
3 1203
You might want to try declaring tray as NotifyIcon in the form
declarations, rather than as a local variable.

T

iwdu15 wrote:
>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
Jul 25 '06 #2
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
Jul 25 '06 #3
place a notify icon on your form and set visible as you want.

"iwdu15" <jmmgoalsteratyahoodotcomha scritto nel messaggio
news:C4**********************************@microsof t.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

Jul 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jm | last post by:
Hi, I have a C# program that changes the notifyIcon during the program. What I have noticed is that sometimes when the program is over the old icon will still be in the system tray. But when i...
4
by: Beenish Sahar Khan | last post by:
I want to start my application so that its notify icon is added to the system tray, i don't want to show any starting form. I want user to interact through the notify icon...just like MSN. Is there...
18
by: Derek Martin | last post by:
Hi there, this is probably really dumb, but I am using a dialog as my main form and my startup form is my splash screen - which implements some progress bars to load up some relevant data. When...
1
by: Rob | last post by:
I have an interesting problem with my Notify Icon. I cannot get it to display when I start a web service. I have no problems when I test the software on a Windows program. But the Icon will not...
6
by: Neo | last post by:
i'd like to create an application which would run in the background, & there'd be an icon in the system tray (can use the notify icon). But HOW can i make the form invisible. What i'd like to do...
0
by: Mike Eaton | last post by:
Hi there, I have an app whose structure is as follows: a module calls a custom application context containing a notify icon and associated context menu, which in turn acts upon an instance of...
3
by: Cylix | last post by:
I am going to make an application in monitor and do something on time. A part of it is an Notify icon(System Tray Icon), Which project type can I be used for Just showing the notify icon without...
1
by: namrataa | last post by:
i have a notify icon for our media player developed in wpf. included files are notify.cs,notify.resx,notify.designer.cs. i have also added a class file called app.cs . now the problem is how...
0
by: namrataa | last post by:
i have the following code for my notify.cs file using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.