Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to CLOSE a context menu after a timeout?

Tags:

c

windows

winapi

I need to have a context menu (currently created with TrackPopupMenu) close automatically after a period of inactivity. I'm trying to search but only finding the opposite (how to activate a popup after a timeout) or specialized things for particular applications. The only things I've found that is even close is to enumerate the children of the desktop until a window with class name #32768 is found -- that will be the menu -- and close it.

I'm hoping for a better, clearer way. Any suggestions?

like image 520
Steve Valliere Avatar asked Sep 21 '26 19:09

Steve Valliere


1 Answers

Send WM_CANCELMODE message to the parent window that host the context menu .

like image 128
S.MAHDI Avatar answered Sep 23 '26 08:09

S.MAHDI



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!