Alexander
Alexander

Reputation: 323

Change window menu's location

In Windows when you open a menu, its location on the screen depends on the location of its parent window and screen resolution. Ie when a menu does not fit the screen, then it moves to another side. How does this mechanism work in the OS? Is it possible to substitute the value of screen resolution, so that the window would consider that the screen is smaller than it actually is?

I want to make a drop-down and context menus to appear only in window area. Now I use CBThook and WndProc and recount the location of the menu that appears. Perhaps there is a way to make it easier?

Upvotes: 0

Views: 252

Answers (1)

Anders
Anders

Reputation: 101764

TrackPopupMenuEx does allow you to specify a rectangle on the screen that the menu should not overlap, I guess that is sort of the opposite of what you want, but it is as close as you are going to get without horrible hacks.

Upvotes: 1

Related Questions