Popup menu with notify icon... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Popup menu with notify icon...

I'm trying to add a popop menu to my notify icon. Everything else is working fine, but as I'm trying to show the menu when right mouse button is rleased over my icon, it just doesn't appear. My code is as follows: case WM_USER + 1:
switch( lParam ) {
case WM_RBUTTONUP:
POINT pt;
pt.x = LOWORD( lParam );
pt.y = LOWORD( lParam );
ClientToScreen( hwndDlg, &pt );
TrackPopupMenu( qsMenu, TPM_CENTERALIGN | TPM_RIGHTBUTTON,
pt.x, pt.y, 0, hwndDlg, NULL );
break;
}
break;
Can someone tell me where I did wrong. My application is dialog based, meaning it has only a dialog as a main window...
[italic][blue]
wAre
Beginner Programmmer
[/blue][/italic]

Comments

  • Johnny13Johnny13 Posts: 128Member
    um,I dont think both pt.x and pt.y are LOWORD(LP) and can be used as R-button at the same time.
  • wArewAre Posts: 46Member
    Yeah, well, mainly my question was that how could I connect a popup menu to my notify icon?

    : um,I dont think both pt.x and pt.y are LOWORD(LP) and can be used as R-button at the same time.
    :

    [italic][blue]
    wAre
    Beginner Programmmer
    [/blue][/italic]


  • weiccoweicco Posts: 950Member
    Hi,

    Check out this little project I'm working on http://weicco.net/proj/WMailAgent/

    See files NotifyIcon.cpp/.h, NotifyMenu.cpp/.h and WMailAgent.cpp.

    Project is currently halted but those notifymenu stuff should work fine. Feel free to copy/modify code as much as you like.
Sign In or Register to comment.