Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC UI Behaviour
The bad behaviour was caused by a not-yet fully understood modification in another CDockablePane that messed up the focus; it causes the button to loose the focus and I did not visually see that when I thought I clicked on the button, I was putting the focus back to it; and if I was lucky enough to click fast enough on the button before it loosed focus again.
 
We reverted the small changes that cause that more important problem.
 
Thanks again.
 
Max.
 
========================
I've got a simple MFC application with menus, and a menu item and a CDockablePane containing a CButton.
 
The application creates a worker thread ( by doing a new CWinThread derived class)
 
Both menu item and the button will call the same code; the code will stop the thread.
 
When running the application, the thread is created and is doing its job, when the menu item is selected, the handler is called and the code stopping the thread works normally.
 
When I try clicking on the button (the button is enabled) nothing happen, the handler is not called, or I have to click like demented person and eventually the handler will be called.
 
ON_BN_CLICKED(IDC_STOP_BUTTON, &MyWindow::OnButtonStop )
 

The button is created in a window (CWnd) inside the CDockablePane.
 
The button is enabled/disabled by using ON_UPDATE_COMMAND_UI (as explained in Applying an update UI notification interface to user-defined controls[^]) with the WM_IDLEUPDATECMDUI message to call UpdateDialogControls(this, FALSE);.
 
----
 
Question:
 

I don't know if there is a way or if there is a message that will give that particular UI a "nudge" to handle the button message with a higher priority.
 
Thanks.
 
Max.
Posted 6-Jun-13 6:43am
Edited 6-Jun-13 8:35am
v3
Comments
Richard MacCutchan at 6-Jun-13 12:39pm
   
Try using your debugger to find out what happens when you click it.
Maximilien at 6-Jun-13 13:12pm
   
A non-issue, see the update I wrote at the top of the question. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 BillWoodruff 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 6 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100