How to distinguish right click from left click forNIN_BALLOONUSERC

Hi,

In OnTrayIconNotify, my program process NIN_BALLOONUSERCLICK. According to 
msdn, NIN_BALLOONUSERCLICK was sent when the balloon is dismissed because of 
a mouse click. Is it possible to distinguish right mouse click from left 
mouse click
for this message? I want my program to open a new window when user left 
click on the balloontip but pop up the context menu when user right click on 
the trayicon.

Any help would be greatly appreciated.

Richard

-- 
Nothing impossible, Nothing easy
0
NianHawk (59)
3/15/2007 2:02:00 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
914 Views

Similar Articles

[PageSpeed] 22

If you handle it fast enough you could just look at the state of the mouse 
button when you get the message.  You could keep track of the state by 
managing the LBUTTON and RBUTTON up and down messages.

This information may help you:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/cursors/cursorreference/cursorfunctions/getcursorpos.asp

Tom

"NianHawk" <NianHawk@hotmail.com.invalid> wrote in message 
news:F38ED609-1BFB-4B34-8447-20209F7F0AF8@microsoft.com...
> Hi,
>
> In OnTrayIconNotify, my program process NIN_BALLOONUSERCLICK. According to
> msdn, NIN_BALLOONUSERCLICK was sent when the balloon is dismissed because 
> of
> a mouse click. Is it possible to distinguish right mouse click from left
> mouse click
> for this message? I want my program to open a new window when user left
> click on the balloontip but pop up the context menu when user right click 
> on
> the trayicon.
>
> Any help would be greatly appreciated.
>
> Richard
>
> -- 
> Nothing impossible, Nothing easy 

0
tom.nospam (3240)
3/15/2007 4:00:14 PM
Thanks for your idea, I try this method, unfortunately, NIN_BALLOONUSERCLICK 
was received 
before WM_LBUTTONDOWN or WM_LBUTTONDOWN.  Is there any API to get the state 
of the mouse?

Richard nian.

> If you handle it fast enough you could just look at the state of the mouse 
> button when you get the message.  You could keep track of the state by 
> managing the LBUTTON and RBUTTON up and down messages.
> 
> This information may help you:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/cursors/cursorreference/cursorfunctions/getcursorpos.asp
> 
> Tom
> 
> "NianHawk" <NianHawk@hotmail.com.invalid> wrote in message 
> news:F38ED609-1BFB-4B34-8447-20209F7F0AF8@microsoft.com...
> > Hi,
> >
> > In OnTrayIconNotify, my program process NIN_BALLOONUSERCLICK. According to
> > msdn, NIN_BALLOONUSERCLICK was sent when the balloon is dismissed because 
> > of
> > a mouse click. Is it possible to distinguish right mouse click from left
> > mouse click
> > for this message? I want my program to open a new window when user left
> > click on the balloontip but pop up the context menu when user right click 
> > on
> > the trayicon.
> >
> > Any help would be greatly appreciated.
> >
> > Richard
> >
> > -- 
> > Nothing impossible, Nothing easy 
> 
0
NianHawk (59)
3/15/2007 4:51:15 PM
I looked around a bit when attempting to answer the question the first time. 
You might want to look at mouse_event(), but I'm not sure how that would 
work.  You could also try an IOCTL call to look at the device directly, but 
I haven't tried that.  I would probably try writing my own balloon class and 
simply catching the mouse clicks in there and passing them back as part of 
the API.

Tom

"NianHawk" <NianHawk@hotmail.com.invalid> wrote in message 
news:61712FF8-6627-48F3-B036-71ABB7BB03F6@microsoft.com...
> Thanks for your idea, I try this method, unfortunately, 
> NIN_BALLOONUSERCLICK
> was received
> before WM_LBUTTONDOWN or WM_LBUTTONDOWN.  Is there any API to get the 
> state
> of the mouse?
>
> Richard nian.
>
>> If you handle it fast enough you could just look at the state of the 
>> mouse
>> button when you get the message.  You could keep track of the state by
>> managing the LBUTTON and RBUTTON up and down messages.
>>
>> This information may help you:
>>
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/cursors/cursorreference/cursorfunctions/getcursorpos.asp
>>
>> Tom
>>
>> "NianHawk" <NianHawk@hotmail.com.invalid> wrote in message
>> news:F38ED609-1BFB-4B34-8447-20209F7F0AF8@microsoft.com...
>> > Hi,
>> >
>> > In OnTrayIconNotify, my program process NIN_BALLOONUSERCLICK. According 
>> > to
>> > msdn, NIN_BALLOONUSERCLICK was sent when the balloon is dismissed 
>> > because
>> > of
>> > a mouse click. Is it possible to distinguish right mouse click from 
>> > left
>> > mouse click
>> > for this message? I want my program to open a new window when user left
>> > click on the balloontip but pop up the context menu when user right 
>> > click
>> > on
>> > the trayicon.
>> >
>> > Any help would be greatly appreciated.
>> >
>> > Richard
>> >
>> > -- 
>> > Nothing impossible, Nothing easy
>> 

0
tom.nospam (3240)
3/15/2007 4:55:18 PM
Nian,

Maybe this article would help you some.  If nothing else, you could leave a 
message on this article for Chris and he knows a lot about how this all 
works:

http://www.codeproject.com/shell/systemtray.asp?df=100&forumid=88&exp=0&select=1649613

Tom

"NianHawk" <NianHawk@hotmail.com.invalid> wrote in message 
news:61712FF8-6627-48F3-B036-71ABB7BB03F6@microsoft.com...
> Thanks for your idea, I try this method, unfortunately, 
> NIN_BALLOONUSERCLICK
> was received
> before WM_LBUTTONDOWN or WM_LBUTTONDOWN.  Is there any API to get the 
> state
> of the mouse?
>
> Richard nian.

0
tom.nospam (3240)
3/15/2007 4:58:13 PM
Reply:

Similar Artilces:

Money Plus
I just installed Money Plus (was running 2006) on my XP Pro.SP2 machine. Installation, conversion of money file and an update all went fine. Issue is that it takes about 9 minutes to open the money file. I removed spend by category and spending tracker from the home page and that made a giant improvment down to about 60 seconds to open. Is this a muke the bills situation? A level 2 repair found nothing wrong. Performance with 2006 with spending tracker etc was fine. Would appreciate a point in the right direction. I went back to 2006 so all is fine now, but need Plus for the 2 year q...

How do I unrestrict access to files Information Rights Mgmnt?
Yesterday I was working on an excel spreadsheet and could not do "print preview" without being questioned about Information rights Management in MS Office 2003. I could not get past this so I went ahead and set up a couple email addresses of people who could access this file. Now the software will not properly authorize my opening this file as it cannot verify my email address. I do not know how to unrestrict the file so that I can continue working on it. ...

Distinguish emails....
If I had to guess I would say client level, but I'm gonna ask anyway.... Is there a way at the server level to set a rule or filter to highlight any internal mail so that we may distinguish it from external mail? (For every User) I would guess No for the server, but possible at the client level. If so is there a registry change that we could push out. CR... May be it would help, i'd use Rules on Client outlook to drop all the mails from e.g. abc.com to ABC folder on client Regards, ...

Address list rights and Management
I have Exchange 2003 Sp1 running on Windows 2003 Standard Sp1 in a Windows 2003 AD -Native Mode, domain. I have been creating additional address lists and allowing restricted access to them for specific offices or users. I recently created 2 that contain users from the 2 different sides of our business. the lists were created identically -with the exeception of some rights application to them -tryting to restrict access to view their contents by specific people. at this point I, and exchange administrator, can only see only 1 (Address1) of them in System Manager, and therefore can ...

Distinguishing between contacts
How can I distingusih between contacts? IOW, I want to create some contacts that are employees, some are vendors and some or clients. Is there anyway to identify contacts by by these groupings? Hi David, You can add a field in the deployment manager and to crm which specifies the type of contact. Then modify the existing views to show only contacts of type client and add some more to show vendors or employees. Good luck, Ronald Lemmen Accenture ----- David F wrote: ----- How can I distingusih between contacts? IOW, I want to create some contacts that are emp...

right application?
This is a small business, and i'd like to be a reseller for marketing lists, but also offer "database management" and custom reports from the database. All info is currently in Excel. It works, but it's clumsy. Also, I can't create custom reports in Excel. 1) Is Access the best software to use? I'm relatively computer-illiterate. 2) Should I attempt to learn Access on my own, or is it better to get training? If so, what type? Any info would help! I'd reccomend SQL Server, Access is a little bit obsolete "brenda" <brenda@discussions.mic...

Digital rights media help! Windows Media Player Security won't upd
I am trying to use Overdrive Media console to listen to audiobooks, however you need to download windows media player security update. but everytime I try it says "windows media player has not been installed correctly" I've tried it with windows media player 10 and 11. both times it gives me the same message. I tried uninstalling it, but it only rollsback to windows media player 10. I've uninstalled and reinstalled multiple times, but get the same result. please help!!!!!!! ...

When I click on To: None of my email contacts show up? (Emailing)
When I click on To: None of my email contacts show up? Also when I want to add a contact to a distribution list none of my contacts show up? But if I go to contacts in Outlook all of my contacts are there? "Reo Joe" <Reo Joe@discussions.microsoft.com> wrote in message news:1FD8F9E5-428B-4DC7-A839-B3B47185FEEC@microsoft.com... > When I click on To: None of my email contacts show up? Also when I want to > add a contact to a distribution list none of my contacts show up? But if I > go > to contacts in Outlook all of my contacts are there? So what hap...

POS Buttons -- Click to Show Work Orders
How can I program the custom POS Buttons to execute Program Tasks... For example, how could I have the button show the Work Orders screen of RMS application? Another need might be to open up Lay-Aways. Etc., etc.. Thanks, D in manager go to database*Registers*Custom POS buttons create NEW Number next available style = Internal Command Caption = Create Work Order Command = createworkorder image can be anything you want for layaway would be command =createlayaway "DonS" <DonS@discussions.microsoft.com> wrote in message news:48532B28-424D-4DC8-B76F-43CEFC1220E4@micros...

Audit rights
We have some people coming in to run an audit on our systems. How can I provide them access to our systems but limit their access to view only? ...

rights for dropdown control ....
Hi, I have created an dropdown control in contacts form. and i have 2 items in the dropdown list. now when user1 logs in i want to show only the 1st item in the dropdown control or i should able to disable the control. but when user2 logs in i should show all the items in the dropdown control. Now how to hide dropdown items according to users ? Regards, Your not going to be able to do this Richard without a major rewrite of the code. "Richard I.P" <iamiamiam_77@yahoo.com> wrote in message news:68b0f2fd.0402110148.7039756b@posting.google.com... > Hi, > > I have cre...

Right-Click in Excel 2002
My right mouse button is set to "select" a cell. How can I change it to bring up the menu that allows me to "delete" "insert" rows/columns? I was accustomed to this feature in my previous version of Excel. Just in Excel, or in all applications? Look at Start, Settings, Control Panel, double-click Mouse, and change settings there as appropriate (like possibly you have button configuration set to "left-handed." Change to "right-handed.") MRO "gambersh" <hivre@excite.com> wrote in message news:04d301c381fa$c4b72590$a301280...

How can I delete an infinite number of garbage cells to the right
I highlighted many entire rows with color. Now my excel wants to print 115 pages. I can define a narrow print area, but I really want to delete the garbage color cells to the right. When I drag to the right, there seems to be an infinite number of cells. hi don't drag. place your curser in the first row and column that you want to delete left. hold the shift key down with left hand and with right hand, hit end then the down arrrow. hit the end key again then the left arrow. excel will select all cells from row 1 to bottom and from curser position in row 1 to far left. ...

Consult Outlook Support Professionals, take the rights of yourself
Step 1: Follow the link below: https://support.microsoft.com/oas/default.aspx?med=online&prid=7473&trl=so&enty=pid&gprid=274493&ln=en-us&c1=505&as=1 Step 2: Fill in the Product ID: 55875-841-7541056-04808 Step 3: Put in your Outlook questions and wait for 24 hours business time, and you will receive the answer from an Outlook Support Professional. You can follow-up with him/her until the problem has been resolved. NOTE: Remember to put in your telephone number so as to be surveyed by Microsoft so you can have a chance to tell Microsoft directly about how do y...

domain user with only Exchange/pop3
Hi, I'm moving from external mail provider to my own Exchange 5.5 / w2k srv. Some of my users has to use pop3 (not necessarily but anyway - offline access). Therefore I've got a question; what are steps to make domain user ONLY mail user, not allowing him to login, access files etc. Will it be enough to remove him from domain users group? thx, lunak ...

Roaming Profiles need User Admin Rights on local system
The old SBS2003 server was dying. I built a new server with a new domain, and joined the old PCs to it. They had a mixture of roaming and local profiles. Copied old local profiles to new local profiles, and turned on roaming profiles for each user. Had to give them Admin rights to make it work. I have since given full permission to the users Hive (NTUSER.DAT) at the local machine. I have also removed their roaming profile, and still they don't get their saved profile unless they have local admin rights. Is there something I am missing to make it right? Should I call it a lost cau...

Gray Left Pane in Add-Remove Program window
hi In Windows 2000 - Add Remove Program window has a left gray pane having different buttons. What is this control? Is it a tab control with some properties adjusted? How to implement it in a program? Regards Manu It's called a shortcut bar. http://www.codeguru.com/controls/outbar.shtml Ali R. "ManuN" <manun@cybage.com> wrote in message news:eNNoJJXyDHA.2000@TK2MSFTNGP11.phx.gbl... > hi > In Windows 2000 - Add Remove Program window has a left gray pane having > different buttons. > What is this control? Is it a tab control with some properties adjusted? &...

Distinguishing blank cells
There are 3 kinds of blanks. I don't known what you call them. Let's say 1) a string blank : derived from = ' 2) an embedded blank : derived from = "" either by assignment or by conditional formula. When this was copied, and paste-special-value-only, it turned pseudo empty 3) an empty blank : a true virgin blank Is there a way to distinguish the embedded blanks from the empty blanks in a worksheet? Any idea? Hi David, =Isblank(A1) returns true if A1 an empty cell and false in the other cases you indicate. --- Regards, Norman ...

Distinguish help calls
On a dialog, how can I distinguish between the user pressing F1 and clicking on the context help question mark and then somewhere on my dialog. I would like F1 to bring up the main help system at the appropriate page and the question mark to bring up context help (floating yellow text). At present, pressing F1 lands in my OnHelpInfo method and I open the help system at the appropriate page. Pressing the question mark brings up the context help correctly, then lands in my OnHelpInfo method and I don't want to open the help system, but can't tell which event caused the trigger of ...

Cannot perform a right click on the cells
Hi , I cannot perform a right click on the cells (functions like copy paste,format...etc) in excel (xp version). However, all these can be found when i right click on my words or powerpt. Dun think it is my mouse that is faulty. Pls assist. Regards Something must be wrong in your options. Did this just start happening or is it something new. Click on Tools, then click on Options and then select the edit tab. Make sure that the only thing NOT selected is the fixed decimal then you should be all set. >-----Original Message----- >Hi , > I cannot perform a right click ...

"Right-Click" actions
I thought I'd remembered reading somewhere that "Right-Click" actions could be assigned to controls. Yet, I don't see a "Right-Click" option given in the "Events" tab of a combo's property sheet. It seems that the "Right-Click" action can only be specified at the form's level, is that the limitation? Bill I stab in the dark, but couldn't you use the On Key Press Event to verify if the right-click was used and if so execute some code? -- Hope this helps, Daniel P "Bill" wrote: > I thought I'd remembered ...

Hide Button after clicking on the button to open a form
Hi, Please let me know how i can hide a button after clicking on the same button. I am able to click on a button and hide another button but does Access allow you to hide the same button you just clicked on? I used the following code to hide another button but why can't I hide the same button: Me.Command30.Visible = False Thank you so much. You can't hide or disable an control that has the focus. Set the focus to some other control and then you can hide the button. I do not know your applicaiton or what you are attempting to do, but I would suggest that you m...

Right icw getfromclipboard
Hi all, Need a quick fix on this one; Private Sub CommandButton2_Click() Dim MyData As DataObject Set MyData = New DataObject MyData.GetFromClipboard TextBox1.Text = MyData.GetText End Sub I only need the last 19 characters from the right displayed in textbox1. How do I incorporate the right function in this procedure? Regards basta Try TextBox1.Text = Right(MyData.GetText, 19) -- Jacob "Basta1980" wrote: > Hi all, > > Need a quick fix on this one; > > Private Sub CommandButton2_Click() > > Dim MyData As DataObje...

Bizarre
My company recently upgraded to 2003. Since the upgrade, I have been unable to open an excel file in any way except through the open file dialog in Excel itself. If I click on an icon (either on my desktop or an attachment in an email), I get a pause, a jpeg of an adobe icon gets copied into my clipboard and then a few seconds later, I get a message that the file can not be found. Everything else seems to work fine, all my models and files work fine, all my links work fine and I have virus scanned / spyware scanned left right and center. MY IT guys have given up and are now avoiding me. A...

Changing the calculation order
Can the order that Excel recalculates be changed to start fro the lower right? Excel automatically adjusts its final calculation order depending on the dependency chain in such a way as to get the correct result regardless of formula sequence. Why would you want to change this? Charles ______________________ Decision Models FastExcel 2.1 now available www.DecisionModels.com "A Process Modeler" <A Process Modeler@discussions.microsoft.com> wrote in message news:4D17FF7C-D763-4FAB-980C-463DB8A75FCA@microsoft.com... > Can the order that Excel recalculates be changed to ...