Sending a BN_CLICKED message
-
Hi, I need to send a button click message to a dialog window button from a thread. I use "PostMessage(BN_CLICKED, IDC_GPS,m_hWnd) " but I think the lparam and wparam are incorrect. I don't find an example or something else. Can anybody help me? Thank you. Regards. Regards, Javier
-
Hi, I need to send a button click message to a dialog window button from a thread. I use "PostMessage(BN_CLICKED, IDC_GPS,m_hWnd) " but I think the lparam and wparam are incorrect. I don't find an example or something else. Can anybody help me? Thank you. Regards. Regards, Javier
I try to use use PostMessage(WM_COMMAND, MAKEWPARAM(IDC_GPS, BN_CLICKED), handle>). Then I try to use "HWND GetDlgItem( int nID )" to get the button handle, but the compiler makes a error: I can use Cwnd::GetDlgItem ( ) , but not CWindow::GetDlgItem , which returns the button handle. How can I use the Window classe? Thanks. Regards, Javier
-
Hi, I need to send a button click message to a dialog window button from a thread. I use "PostMessage(BN_CLICKED, IDC_GPS,m_hWnd) " but I think the lparam and wparam are incorrect. I don't find an example or something else. Can anybody help me? Thank you. Regards. Regards, Javier
The
BN_CLICKED
message is a notification sent to the button's parent window. If you want to simulate a button press, send theBM_CLICK
message to the button. Regards, João Paulo Figueira Embedded MVP -
The
BN_CLICKED
message is a notification sent to the button's parent window. If you want to simulate a button press, send theBM_CLICK
message to the button. Regards, João Paulo Figueira Embedded MVPHi, João . ok, I use:
HWND Hbutton = GetDlgItem(ptrDlg->m_hWnd,IDOK); SendMessage (Hbutton,BM_CLICK,0,0);
from my thread and it works. Another question: if I want to send it from the same dialog window (for example from other button), How can I get the handle to the button? Well, I test the following:SendDlgItemMessage(IDC_GPS,BM_CLICK, 0, 0 );
from the same dialog and it works. Thanks Regards, Javier