by John Munro >> Thu, 26 Mar 2009 22:01:46 GMT
I have a systray icon, and when you right-click it I want a popup menu to appear - as usual for systray icons.
Here is a simplified version of the code I'm using:
trayIconClicked(clickType: Integer) updating;
vars
ptPos : Point;
begin
if clickType = TrayIcon_RightClick then
call getCursorPos(ptPos);
popupMenu(mnuSystray, ptPos.x, ptPos.y);
endif;
end;
The getCursorPos external function is GetCursorPos in user32.
The problem is that the popup menu isn't acting like other popup menus from systray icons - it is very low on the screen and depending where you click the bottom most menu item can be off the bottom of the screen.
I couldn't find an indication in the help file what the x and y parameters popupMenu are relative to - I'm assuming they're just relative to the screen, but maybe that's not right.
Has anyone done this sort of thing before?
thanks,
John