Click here to Skip to main content
15,913,669 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Winhttp from service not working Pin
gP_t_gr824-Apr-05 19:20
gP_t_gr824-Apr-05 19:20 
GeneralGetting input in an array... Pin
Aqseel A. Mirza23-Apr-05 7:12
sussAqseel A. Mirza23-Apr-05 7:12 
GeneralRe: Getting input in an array... Pin
Ravi Bhavnani23-Apr-05 7:43
professionalRavi Bhavnani23-Apr-05 7:43 
GeneralRe: Getting input in an array... Pin
Member 190113623-Apr-05 15:24
Member 190113623-Apr-05 15:24 
Generalcin.get is creating problem Pin
Aqueel25-Apr-05 1:55
Aqueel25-Apr-05 1:55 
GeneralRe: cin.get is creating problem Pin
Member 190113625-Apr-05 2:06
Member 190113625-Apr-05 2:06 
GeneralThanks Pin
Aqueel25-Apr-05 3:50
Aqueel25-Apr-05 3:50 
GeneralWM_KILLFOCUS Pin
PeteMan_R23-Apr-05 6:55
PeteMan_R23-Apr-05 6:55 
Is there any message or virtual in MFC that asks the consumer "Can this control loose focus?" and sends the CWnd* or HWND of the control the user is trying to set focus to in the message or virtual?

I'm working on code where when the user leaves a control, the code needs to validate the control's data immediately. If the data is not valid, then a "bad user" messagebox shows and the control must retain focus. There is an exception though. If the user clicks on the "Cancel" or "Close" button or the "x" on the top right, then that's allowed because the user obviously wants to shut down the form so no validation is required.

But then it gets even more complex. The form has a dirty flag so if the form is "dirty", when the form shuts down, I have to ask the user if he/she wants to save the data. If the user clicks "Yes", then the control that previously had focus must be validated first. If it is invalid, then I have to set focus back to it.

From what I've researched, WM_KILLFOCUS is just a notification that the API sends in the middle of the focus change process. What I want is something that allows me to abort the focus change process completely.

I've put PostMessage code in my WM_KILLFOCUS handler to try to get around this but it gets really squirly and the logic just seems unstable. It gets really messy when the user tries to go from one property page to another on a property sheet.

Any ideas?

Peteman_R
Boise, Idaho
GeneralRe: WM_KILLFOCUS Pin
Peter Ritchie23-Apr-05 8:36
Peter Ritchie23-Apr-05 8:36 
GeneralRe: WM_KILLFOCUS Pin
PJ Arends23-Apr-05 14:55
professionalPJ Arends23-Apr-05 14:55 
GeneralRe: WM_KILLFOCUS Pin
PeteMan_R23-Apr-05 15:18
PeteMan_R23-Apr-05 15:18 
GeneralRe: WM_KILLFOCUS Pin
Ravi Bhavnani23-Apr-05 18:24
professionalRavi Bhavnani23-Apr-05 18:24 
GeneralRe: WM_KILLFOCUS Pin
Anonymous25-Apr-05 18:07
Anonymous25-Apr-05 18:07 
GeneralPlease help me! Pin
dSolariuM23-Apr-05 4:27
dSolariuM23-Apr-05 4:27 
GeneralRe: Please help me! Pin
Ravi Bhavnani23-Apr-05 7:46
professionalRavi Bhavnani23-Apr-05 7:46 
GeneralRe: Please help me! Pin
dSolariuM24-Apr-05 5:01
dSolariuM24-Apr-05 5:01 
GeneralRe: Please help me! Pin
Ravi Bhavnani24-Apr-05 5:51
professionalRavi Bhavnani24-Apr-05 5:51 
Generaltext over image Pin
Lampros Giampouras23-Apr-05 4:06
Lampros Giampouras23-Apr-05 4:06 
Generalvirtual static Pin
Konrad Windszus23-Apr-05 3:38
Konrad Windszus23-Apr-05 3:38 
GeneralRe: virtual static Pin
Maximilien23-Apr-05 4:19
Maximilien23-Apr-05 4:19 
Generali want help in game programing Pin
medlteam23-Apr-05 3:37
medlteam23-Apr-05 3:37 
GeneralRe: i want help in game programing Pin
namaskaaram23-Apr-05 4:26
namaskaaram23-Apr-05 4:26 
Generaldisable Message Reflection of OLE Controls Pin
Anonymous23-Apr-05 2:59
Anonymous23-Apr-05 2:59 
Generalborland c++ bulider book Pin
aloktambi23-Apr-05 0:44
aloktambi23-Apr-05 0:44 
GeneralShow an Editbox Pin
fan wei fang23-Apr-05 0:09
fan wei fang23-Apr-05 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.