I need to figure out how to programmatically find and select a context menu item from a separate application\'s system tray icon. The only way I could imagine accomplishing
Depending on how the application has been written, selecting the item from the context menu will cause a WM_COMMAND
message to be posted to a window belonging to the application. You can use a tool like Spy++ to check for this. If this is the case then all you would have to do (in theory) is simulate that message.
If the application does not use WM_COMMAND
to receive selections from the context menu, your job is much harder. There is no documented method of discovering the position and identify of system tray items, and so your method of hard-coding the x/y values is probably the best option you have.