SetWindowPos changes context menu size

If a context menu is open in the program being resized/repositioned it's size and position are also changed, is there any way around this?



Popup menus operate their own modal message loops. Key-presses are handled by the menu. Mouse clicks either invoke menu items, navigate sub-menus, or close the menu.

In short, there's no way for the user to invoke a move or size of a window whilst a menu is running its modal message loop.

Because of this, the designers of the system don't care what happens to the menu in the scenario that you describe because there's no supported way for that scenario to occur. It's happening for you because, I guess, you have a timer that calls SetWindowPos on the window that owns the menu.

The way around this is for you not to move or size windows whilst they have popup menus open.

Need Your Help

Post-commit hook that performs an action only if commit affects the specific path

svn batch-file hook visualsvn-server post-commit

In some cases it's required to perform a post-commit operation only if some condition is met.

Way to inject generic bean that have constructor with generic class argument

java spring generics autowired spring-annotations

I have generic class ObjectDaoReflect<T extends BaseEntity> it work with reflaction, because of type erasure it have constructor with generic class parameter public ObjectDaoReflect(Class<...