Click here to Skip to main content
15,902,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File in Append Mode Pin
CPallini28-Apr-08 0:24
mveCPallini28-Apr-08 0:24 
GeneralRe: File in Append Mode Pin
Hamid_RT29-Apr-08 1:47
Hamid_RT29-Apr-08 1:47 
JokeRe: File in Append Mode Pin
Nelek29-Apr-08 4:24
protectorNelek29-Apr-08 4:24 
GeneralRe: File in Append Mode Pin
Hamid_RT29-Apr-08 5:40
Hamid_RT29-Apr-08 5:40 
GeneralRe: File in Append Mode Pin
Nelek7-May-08 11:46
protectorNelek7-May-08 11:46 
GeneralRe: File in Append Mode Pin
Hamid_RT7-May-08 18:20
Hamid_RT7-May-08 18:20 
GeneralRe: File in Append Mode Pin
Nelek8-May-08 12:35
protectorNelek8-May-08 12:35 
Generalmessage handling for a popup window Pin
misha_grewal27-Apr-08 23:56
misha_grewal27-Apr-08 23:56 
I create a list box as a popup window with parent as NONE and display it below a combo box. (This is imitation of intellisearch IE or IAutoComplete in WTL)


The creation of the listbox looks like this

<br />
CMyComboBox::CreateListbox() {<br />
  BOOL bRet =  _list.CreateEx(0, <br />
                                 _T("ComboLBox"), <br />
                                 _T(""), <br />
                                 WS_POPUP | WS_VISIBLE | WS_BORDER | WS_VSCROLL <br />
                                 | LBS_NOTIFY,<br />
                                    clientRect.left, clientRect.top, <br />
                                    clientRect.Width(), clientRect.Height(), <br />
                                    this->GetSafeHwnd(), //this is the combobox control's hwnd//<br />
                                    NULL, <br />
                                    NULL);<br />
}<br />


I display this listbox when user starts typing some text in the combobox. I add the filtered strings as per the text to this listbox.

There are two problems

1. I am trapping all the messages send to Listbox in its windowproc.
I find that the first time I display this listbox, I am able to see LBN_SELCHANGE (or other listbox specific messages) being trapped in Windowproc. But they are sent only once. The next time when I try to change any selection, LBN_SELCHANGE is not sent/trapped (I don't know where this message goes).
Although the basic messages - LBUTTON_DOWN/UP, KEY_DOWN/UP are being sent to the Listbox.

I intend to write something like below, but LBN_SELCHANGE is caught only once.


<br />
LRESULT CAutoCompListBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
     <br />
   switch(message) {<br />
      case LBN_SELCHANGE: {<br />
         //Send this message to the combobox with the selected text<br />
         // as argument<br />
       }break;         <br />


Does the question make sense? or its too vague? Unsure | :~

2. I need to find a decent way to send the listbox messages to the combobox. Since the combobox is not at all related to Listbox here, I may have to resort to registering a callback in the Listbox to handle the messages. Is there any other way to handle the messages?

Thanks first of all for reading the question.
Many many thanks if you got some answers

Evil triumphs when good people sit quiet...

GeneralRe: message handling for a popup window [modified] Pin
Rajkumar R28-Apr-08 4:00
Rajkumar R28-Apr-08 4:00 
GeneralRe: message handling for a popup window Pin
misha_grewal28-Apr-08 19:12
misha_grewal28-Apr-08 19:12 
GeneralRe: message handling for a popup window [modified] Pin
Rajkumar R28-Apr-08 20:10
Rajkumar R28-Apr-08 20:10 
Questioncan anybody tell me where a static variable get stored in memory Pin
Deepu Antony27-Apr-08 23:36
Deepu Antony27-Apr-08 23:36 
AnswerRe: can anybody tell me where a static variable get stored in memory Pin
Naveen28-Apr-08 0:04
Naveen28-Apr-08 0:04 
GeneralCode behind ::SetFocus(m_hWndFocus) Pin
baerten27-Apr-08 23:24
baerten27-Apr-08 23:24 
GeneralRe: Code behind ::SetFocus(m_hWndFocus) Pin
Saurabh.Garg27-Apr-08 23:38
Saurabh.Garg27-Apr-08 23:38 
AnswerRe: Code behind ::SetFocus(m_hWndFocus) [modified] Pin
baerten28-Apr-08 1:17
baerten28-Apr-08 1:17 
Questionhow to find handle of a window(Hwnd) belongs to particular application? Pin
Super Hornet27-Apr-08 23:19
Super Hornet27-Apr-08 23:19 
AnswerRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
Saurabh.Garg27-Apr-08 23:31
Saurabh.Garg27-Apr-08 23:31 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
Super Hornet28-Apr-08 0:09
Super Hornet28-Apr-08 0:09 
QuestionRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
CPallini28-Apr-08 0:18
mveCPallini28-Apr-08 0:18 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
Super Hornet28-Apr-08 0:22
Super Hornet28-Apr-08 0:22 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
CPallini28-Apr-08 0:31
mveCPallini28-Apr-08 0:31 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
Super Hornet28-Apr-08 0:36
Super Hornet28-Apr-08 0:36 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
CPallini28-Apr-08 0:50
mveCPallini28-Apr-08 0:50 
GeneralRe: how to find handle of a window(Hwnd) belongs to particular application? Pin
Saurabh.Garg28-Apr-08 0:49
Saurabh.Garg28-Apr-08 0:49 

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.