Home > Software engineering >  Double screen coordinates problem, more big.
Double screen coordinates problem, more big.

Time:11-19

1. The computer is double screen,
2. The program has a main window, there is a tray icon, right click on tray icon, will pop-up menu (window) is an independent,
3. Use DUILIB library written in UI,

Problem:
1. When the scaling of the main screen is more than 100%, and the main application window on the main screen, right-click the tray pop-up menu, if set to the position of the right mouse button, will see (location with the mouse position Settings menu, the menu position beyond the main screen will be many),
2. When the scaling of the main screen when 100%, the main program window on the main screen, right-click tray popup menu position, completely normal, normal menu can display,
3. When the main window in the main screen, the pop-up is normal,

Spent a lot of energy and found the main screen is not scaling, the coordinate calculation methods of the main screen zoom, but when the main screen and the main screen has a scale, to coordinate calculation,
Algorithm is quite complicated, I think that should not be such, should direct the coordinates of the specified window,

Has solved this problem?
Experimental solutions:
1. The original menu window is created in the main window (but not the relationships window, menu window no independent message loop), I will be separated from the main window to create menu window, the hidden menu window, the pop-up menu, the problem still
2. Use separate menu window message loop, problems still
3. The menu window alone in one thread, independent news cycle, problems still,
Just left alone to create a process for the menu,

CodePudding user response:

TPM_RIGHTALIGN right-aligned can?
PMenu - & gt; TrackPopupMenu (TPM_RIGHTALIGN, point x, point y, this);

  • Related