Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problem with Shell_NotifyIcon... Posted by wAre on 26 Nov 2003 at 11:41 AM
I'm working this app, that should have it's icon on status area, but I can's figure out, how to map different mouse events happening over my icon. Can anyone tell me how to do that?

wAre
Beginner Programmmer


Report
Re: Problem with Shell_NotifyIcon... Posted by weicco on 27 Nov 2003 at 1:31 AM
: I'm working this app, that should have it's icon on status area, but I can's figure out, how to map different mouse events happening over my icon. Can anyone tell me how to do that?
:
: wAre
: Beginner Programmmer
:

:
:

Set NOTIFYICONDATA::uCallbackMessage to some value, WM_USER + 1 could be nice. Also set NIF_MESSAGE flag to NOTIFYICON::uFlags and handle to your window to NOTIFYICON::hWnd. Then call Shell_NotifyIcon.

In WndProc do something like this:
LRESULT WINAPI WindowProc(HWND hWnd, UINT nMessage, WPARAM wParam, LPARAM lParam)
  {
  ... handle other messages
  if (nMessage == WM_USER + 1) // The value store to NOTIFYICON struct
    {
    switch (lParam)
      {
    case WM_LBUTTONUP:
      MessageBox(hWnd, TEXT("Someone pushed the notifyicon!"), NULL, 0);
      break;

    ... handle other lParam - values
      }
    }
  }






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.