// 3. Use the API Feature: Shell_NotifyIconGetRect // This requires Windows Vista or later NOTIFYICONIDENTIFIER nii = {}; nii.cbSize = sizeof(NOTIFYICONIDENTIFIER); nii.hWnd = hWnd; nii.uID = 1; // nii.guidItem is used if NIF_GUID was set during creation
The following example demonstrates how to use the Shell_NotifyIconGetRect function to retrieve the bounding rectangle of a notification icon: shell_notifyicongetrect
If you have ever built a Windows application that uses a system tray icon (Notify Icon), you are familiar with Shell_NotifyIcon . It is the workhorse for adding, modifying, or deleting icons in the notification area (systray). nii.cbSize = sizeof(NOTIFYICONIDENTIFIER)