Home > Back-end >  [Windows API] [SendMessage] SendMessage () function is not used
[Windows API] [SendMessage] SendMessage () function is not used

Time:09-21

System is win10 want to achieve, using SendMessage sends a mouse click message, makes the left upper corner of the task manager menu as shown in figure,
The following code is invalid, what is the reason?

 
#include
#include

Int main () {
HWND win=FindWindowA (NULL, "task manager");
SendMessage (win, WM_LBUTTONDOWN MK_LBUTTON, MAKELPARAM (0, 0));
SendMessage (win, WM_LBUTTONUP, NULL, MAKELPARAM (0, 0));
return 0;
}

CodePudding user response:

SendMessage (win, WM_LBUTTONDOWN, 0, 0).
SendMessage (win, WM_LBUTTONUP, 0, 0).
This also tried

CodePudding user response:

As if can't sending WM_LBUTTONDOWN and WM_LBUTTONUP across processes,
Simulation of the mouse to click baidu mouse_event, please

CodePudding user response:

refer to the second floor light bamboo hat reply:
across processes seems to be able to sending WM_LBUTTONDOWN and WM_LBUTTONUP,
Simulation of the mouse to click please baidu mouse_event

SendMessage is software of internal blocked? I use SendMessage to own vs2019 message to use, to the software is not in the other

CodePudding user response:

The
reference mei ah ~ 3 floor response:
SendMessage is software of internal blocked? I use SendMessage to own vs2019 useful message, sent to other software not

Interprocess communication, I study much, however, usage of the two messages you column must be wrong,
WM_LBUTTONDOWN
WM_LBUTTONUP
Wparam and lparam't literally fill a 0
  • Related