How to properly display a pop-up menu from a system tray icon
Responds to mouse click without needing a callback procedure, plus allows keyboard
focus from a pop-up menu. Properly erases the menu when the user clicks somewhere
other than the pop-up menu.
Uses the following API functions:
- CallNextHookEx
- CopyMemory (RtlMoveMemory)
- GetWindowThreadProcessID
- Shell_NotifyIcon
- SetForegroundWindow
- SetWindowsHookEx
- UnHookWindowsHookEx
Back to Code Samples
Copyright © 2000 by Matt E. Hart, All Rights Reserved Worldwide.
Nothing on this web site may be reproduced, in any form, without express written consent.