Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Looking for idea(s) Pin
Albert Holguin20-Mar-12 8:31
professionalAlbert Holguin20-Mar-12 8:31 
AnswerRe: Looking for idea(s) Pin
enhzflep20-Mar-12 8:42
enhzflep20-Mar-12 8:42 
GeneralRe: Looking for idea(s) Pin
David Crow20-Mar-12 10:09
David Crow20-Mar-12 10:09 
GeneralRe: Looking for idea(s) Pin
enhzflep20-Mar-12 18:58
enhzflep20-Mar-12 18:58 
GeneralRe: Looking for idea(s) Pin
David Crow21-Mar-12 3:10
David Crow21-Mar-12 3:10 
GeneralRe: Looking for idea(s) Pin
Randor 21-Mar-12 8:56
professional Randor 21-Mar-12 8:56 
QuestionRe: Looking for idea(s) Pin
David Crow21-Mar-12 10:05
David Crow21-Mar-12 10:05 
AnswerRe: Looking for idea(s) Pin
Randor 21-Mar-12 10:49
professional Randor 21-Mar-12 10:49 
DavidCrow wrote:
Is it the SetCapture() that keeps the new control on top until a
selection is made?


Well the SetCapture() function is simply to ensure that the window recieves mouse input regardless of what/where the mouse is hovering. The control closes when a selection is made because the control is handling the WM_LBUTTONUP message (Yes, it recieves this message even if the user clicked on another window because of SetCapture). The control closes the window when it loses focus because the control is handling the WM_KILLFOCUS message. By handling both messages... it ensures that the window will close if the user is using keyboard navigation (WM_KILLFOCUS) or clicking around with the mouse (WM_LBUTTONUP).

DavidCrow wrote:
While playing around with all of this eaarlier, I was crudely able to get a
window to popup over my list control (correctly covering the other controls),
but it was possessed and would not go away when I clicked outside of it.
Closing the dialog behind it was the only way to kill it!


Windows do not close by themselves so you would need to derive a class from CListCtrl and handle the WM_KILLFOCUS message to have the window close when the user changes focus to another window. Handle the WM_LBUTTONUP message to close in response to a user selection (should also fire if the user clicks outside the window if you called SetCapture). I would also recommend closing in response to the VK_RETURN and VK_ESCAPE keys. (It doesn't look like Iian was doing this in his control)

Best Wishes,
-David Delaune
GeneralRe: Looking for idea(s) Pin
David Crow21-Mar-12 18:05
David Crow21-Mar-12 18:05 
GeneralRe: Looking for idea(s) Pin
Randor 22-Mar-12 11:37
professional Randor 22-Mar-12 11:37 
GeneralRe: Looking for idea(s) Pin
David Crow23-Mar-12 6:05
David Crow23-Mar-12 6:05 
GeneralRe: Looking for idea(s) Pin
Randor 23-Mar-12 7:08
professional Randor 23-Mar-12 7:08 
GeneralRe: Looking for idea(s) Pin
David Crow23-Mar-12 8:04
David Crow23-Mar-12 8:04 
Questionabout send and receive msg from gsm modem with 8051 controller Pin
bh_krunal19-Mar-12 22:23
bh_krunal19-Mar-12 22:23 
GeneralRe: about send and receive msg from gsm modem with 8051 controller Pin
Jochen Arndt19-Mar-12 23:14
professionalJochen Arndt19-Mar-12 23:14 
QuestionRe: about send and receive msg from gsm modem with 8051 controller Pin
David Crow20-Mar-12 4:12
David Crow20-Mar-12 4:12 
AnswerRe: about send and receive msg from gsm modem with 8051 controller Pin
Albert Holguin20-Mar-12 5:09
professionalAlbert Holguin20-Mar-12 5:09 
Questionsending messages Pin
sarfaraznawaz19-Mar-12 21:17
sarfaraznawaz19-Mar-12 21:17 
AnswerRe: sending messages Pin
Chandrasekharan P19-Mar-12 22:53
Chandrasekharan P19-Mar-12 22:53 
AnswerRe: sending messages Pin
CPallini19-Mar-12 23:39
mveCPallini19-Mar-12 23:39 
GeneralRe: sending messages Pin
Albert Holguin20-Mar-12 5:02
professionalAlbert Holguin20-Mar-12 5:02 
GeneralRe: sending messages Pin
sarfaraznawaz20-Mar-12 18:57
sarfaraznawaz20-Mar-12 18:57 
AnswerRe: sending messages Pin
Albert Holguin20-Mar-12 5:04
professionalAlbert Holguin20-Mar-12 5:04 
Questioncode pow(a,b) function in Visual studio 2010 professional Pin
mrby12319-Mar-12 19:06
mrby12319-Mar-12 19:06 
AnswerRe: code pow(a,b) function in Visual studio 2010 professional Pin
Jochen Arndt19-Mar-12 22:08
professionalJochen Arndt19-Mar-12 22:08 

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.