Catch a button press action
Posted on 1998-09-29
My code is doing a lengthy operation (reading one file and sending the readed bytes to serial port) supported by a dialog with a progress control.
In order to have UPDATE working i have done the following:
// BEGIN MY MESSAGE PROCESSING
//test message pending
PeekMessage( &lpMsg, NULL,WM_PAINT, WM_RBUTTONDOWN,PM_REMOVE);
The lengthy code is in one Object i´ve created so i have to pass a CDialog reference to it (the reason for dlg).
This piece of code is executed every 200 bytes readed.
In my dialog i have a button so that the user can cancel the operation. Yes, this is the problem.
What to catch to get a cancel and how?
I think i have to make the visual button action!?
// END MY MESSAGE PROCESSING