Home > Software engineering >  Send message simulation button twice, the second time no response, can you tell me what
Send message simulation button twice, the second time no response, can you tell me what

Time:10-23

 PostMessageW (m_hWnd, WM_COMMAND MAKEWPARAM (IDC_OpenClose, BN_CLICKED), (LPARAM) GetDlgItem (IDC_OpenClose) - & gt; M_hWnd);//send a message simulation click on the button 
M_BaudRate. SetCurSel (m_BaudRate. FindString (0, "57600"));//adjust parameter
PostMessageW (m_hWnd, WM_COMMAND MAKEWPARAM (IDC_OpenClose, BN_CLICKED), (LPARAM) GetDlgItem (IDC_OpenClose) - & gt; M_hWnd); Send the message again, no response

CodePudding user response:

You make a breakpoint in the response function of the buttons have a look at whether entered clearly ~ 2 times

CodePudding user response:

Did not enter the second, could you tell me how to solve

CodePudding user response:

Test for a moment, there is no problem, IDC_OpenClose response function is to call for two times, of course I just print something in the response function, can influence what have you done this response function.

CodePudding user response:

The second parameter adjustment code before send operation to remove the effect how?

CodePudding user response:

Manually by clicking on the button in the dialog box twice, response function is completely normal, but the message response function runs only once, delete the adjusting parameters of the code is the same

CodePudding user response:

SendMessage
  • Related