• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Enable/Disable a Message :: MFC

kuphryn

Senior member
Hi.

Is it possible to enable/disable a message from the message for a time interval?

For example, let say I have a program that plays AVI files. For the first ten seconds, I want to disable the open button. I can disable a button. However, I found that if the user clicks on it while it is disabled, the framework keeps the message and class the message handler after I enable the button.

Is it possible to disable a button *completely*, or even better, ignore/unignore a specific message?

Thanks,
Kuphryn
 
There is a Windows API Peek command that allows you to look at messages in your queue.

However, the disabling of a button should prevent the button message from being generated.
You may need to investigate to ensure that you have not generated an end around or another message is being created.
 
Which message are you handling? OnMouseDown or OnBtnClicked? If it's the first, then use should be handling the second message.
 
I think I know the problem. The problem is before Windows draw the dialog box and the disabled button, there is another process that draws and update a progress bar. If the user clicks the button before the progress bar is done, Windows ignores the fact that the button is disabled. Windows then sends the message about the click button after the progress bar is done.

I ultimately need to multithread that portion of the program.

Kuphryn
 
Back
Top