what win32 message should I block to prevent WM_ENTERMENULOOP hanging my application?
- User
what win32 message should I block to prevent WM_ENTERMENULOOP hanging my application?
Assistant
It sounds like you want to avoid your application from hanging, and you think blocking the WM_ENTERMENULOOP message might help. I’m not 100% sure what this message does, but based on the name I suspect it’s related to the Windows “menu loop” -- that is, the message loop that’s used to process messages for the “file, edit, view, etc.” menus in Windows programs. So if you want to avoid hanging on the menu loop, you could try blocking this message.
- User
what win32 message should I block to prevent ALT key hanging my application?
Assistant
If you want to avoid hangs due to the ALT key, you could try blocking the WM_KEYDOWN message. This message is sent when a key is pressed, and if the key is the ALT key, the message will cause your application to hang.
- User
I want the code to still respect ALT F4
Assistant
Right, you want to avoid hangs caused by the ALT key, but you still want your program to respond to the ALT F4 key combination. One way to do this would be to check for the ALT F4 key combo in your code, and if it’s pressed, ignore the WM_KEYDOWN message. You could do this by checking for the WM_KEYDOWN message, and then calling GetAsyncKeyState to see if the ALT key is pressed. If it is, then ignore the message.
- User
Can't you check the lParam rather than using GetAsyncKeyState
Assistant
You could check the lParam instead of using GetAsyncKeyState, but you would need to be careful to handle the case where the ALT key is pressed in combination with other keys. For example, if the user presses ALT + F4, the lParam will contain the virtual key code for the F4 key, but it will also contain the virtual key code for the ALT key. So you would need to check for both the F4 key and the ALT key in the lParam to determine if the ALT F4 key combination was pressed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.