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
Yes, you can check the lParam of the WM_KEYDOWN message to see if the ALT key is pressed. You can do this by checking the wParam of the message, which will be the virtual key code of the key that was pressed. If the wParam is VK_F4, then the key was the F4 key, and if the wParam is VK_ALT, then the key was the ALT key. So you can check for the VK_ALT key in the lParam of the message, and if it’s pressed, ignore the message.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.