ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> DevelopMentor-dotNET
DevelopMentor-dotNET
Re: [DOTNET] Question: How to show a menu on a NotifyIcon when th e user clicks (left, once)?
by Thomas Tomiczek other posts by this author
Nov 23 2001 3:27PM messages near this date
Re: [DOTNET] Copying files from http:// to Local Drive | Re: [DOTNET] Question: How to show a menu on a NotifyIcon when th e user clicks (left, once)?
Hello Chris - 

SAD, your experiences are on the same level as mine.

I figured out part of the problem is that NotifyIcon is NOT a control,
but a component. I also always get the 0.0mouse coordinates (VERY
frustrating).

I am thinking on other, more limited lines now - finding out and
intercepting the Windows message for the left click, and turn it into a
right click, so that the context menu is actually created - that might e
something that MIGHT work, if I ever find a way to easily intercept the
messages. That's limited to my whish of having the context menu shown,
though.

I will keep the list posted - I am not the "big bad guy" only bullying
people :-) Thanks for your email.

Thomas Tomiczek
THONA Consulting Ltd.
Microsoft MVP (.NET / C#)

-----Original Message-----
From: Gagne, Chris [mailto:cgagne@[...].CA] 
Sent: Freitag, 23. November 2001 16:06
To: DOTNET@[...].COM
Subject: Re: [DOTNET] Question: How to show a menu on a NotifyIcon when
th e user clicks (left, once)?

Thomas:

Your not the only one that's gone through this.  I've managed to get the
menu to pop on a left click of the tray icon however it's ALWAYS
displayed
in the 0,0 co-ords of my screen.  I've even tried to use a fixed point
structure for my popup call to no avail.  I was thinking along similar
lines
where I thought I'd need to grab the co-ords of my mouse and construct a
point struct to pass into the call...however as I said this wouldn't
have
been my solution since passing in dummy values in the point struct never
helped either.  I apologize for not being able to help but I wanted to
ask
if you do infact find a solution would you be so kind as to post it to
the
list or e-mail me directly, as I will do the same.  Might I add though
I've
dug deep to find a solution to this and as far as I can tell there just
isn't one at this time.

Best of luck.

Chris Gagne MCP
Programmer Analyst
Information Technology Group
Richard Ivey School of Business
University of Western Ontario
cgagne@[...].ca

-----Original Message-----
From: Thomas Tomiczek [mailto:t.tomiczek@[...].COM]
Sent: Friday, November 23, 2001 6:04 AM
To: DOTNET@[...].COM
Subject: Re: [DOTNET] Question: How to show a menu on a NotifyIcon when
th e user clicks (left, once)?


Sad - actually I was not really expecting to see a solution.

I see the following problems:
(a) I need mouse coordinages. The only ones I can get are relative to -
the window hosting the NotifyIcon, and this is sadly "irrelevant" as it
is using the wrong coordination system.
(b) I need a container to show the Menu (or whatever else) for, and this
is again a problem. The NotifyIcon does not seem to be able to provide
one, and any that I could get from the window are again - well -
"wrong".

I will try to communicate this into Microsoft. It seems to be a design
issue, basically that the NotifyIcon is not "feature complete" in terms
of providing all functionality that a window does.

Technically, I can definitely see the reason, but it would have been
nice to be able to at least trigger the ContextMenu.

Sadly, besides MouseDown, MouseMove, Mouse Up and Click/DoubleCliek,
there is no event to handle :-)

I put this onto the "lets ask" list for MS :-) I think a couple of
people might have a problem with this, when they duplicate "semi
standard behaviour".

Thomas Tomiczek
THONA Consulting Ltd.
Microsoft MVP (.NET / C#)

-----Original Message-----
From: Heath Ryan [mailto:ryan.heath@[...].NL]
Sent: Freitag, 23. November 2001 11:50
To: DOTNET@[...].COM
Subject: Re: [DOTNET] Question: How to show a menu on a NotifyIcon when
th e user clicks (left, once)?

Hi Thomas,

Now you're very clear to me! :)

Reading your prev post, i see the subtle hint of the left click...

Sorry cant help either, have no vs.net at hand now...

Perhaps you could use MouseUp instead, just a guess...

Regards
// Ryan


-------------------------------------
The information included in this message is personal and/or confidential
and
intended exclusively for the addressees as stated. This message and/or
the
accompanying documents may contain confidential information and should
be
handled accordingly. If you are not the intended reader of this message,
we
urgently request that you notify Centric immediately and that you delete
this e-mail and any copies of it from your system and destroy any
printouts
immediately.
It is forbidden to distribute, reproduce, use or disclose the
information in
this e-mail to third parties without obtaining prior permission from
Centric. We expressly point out that there are risks associated with the
use
of e-mail. Centric and the companies within the group shall not accept
any
liability whatsoever for damage resulting from the use of e-mail.
Legally
binding obligations can only arise for Centric by means of a written
instrument, signed by an authorized representative of Centric.
-------------------------------------

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved