I want to send a SendMessage to the desktop app with Windows locked.

Asked 1 years ago, Updated 1 years ago, 116 views

During the Windows lock screen, the USB connection remote control operation is triggered.
I want to send a SendMessage with mouse click to the appropriate button on my desktop app
I am thinking that

 *It would be easier if you could call the mouse click process directly.
  External applications do not have APIs.
  I'm thinking of a way to program the mouse and call the action.

Below is an excerpt of the mouse click source:
It can only be done if it is not a lock screen, so
I don't think I can notify the desktop of the mouse operation when the lock screen is in progress.

Does anyone know how to make it happen?

------- Source excerpt begins -----

~USB remote control button event handle~

// Left mouse clickdown
SendMessage (clickable button handle, WM_LBUTTONDOWN, MK_LBUTTON, 0x000A000A);
// Left mouse click-up
SendMessage (clickable button handle, WM_LBUTTONUP, 0x000000, 0x000A000A);

~USB remote control button event handle~

------- Source Excerpt Ends -----

c# windows winapi

2022-09-30 16:21

2 Answers

In conclusion, you can't and shouldn't.

Windows has the ability to switch users, but the original user's desktop will not accept operations during the switchover.
Lock screens and UAC dialogs can say the same thing, and the original user's desktop is not allowed to operate.This desktop is called Secure Desktop.
If the question is to be answered, it will be SendMessage() to the original desktop after obtaining the mouse input from Secure Desktop.But if you can do this, you'll be able to wiretap your password keystrokes, which is the virus itself.


2022-09-30 16:21

As Sayuri wrote, it is not possible for the user to receive the input of the lock screen in the application they started, or to operate the lock screen.Rather than the lock screen, you cannot send or receive messages beyond the desktop.On the other hand, applications that started on the original desktop can send and receive window messages while switching to the lock screen.

So, isn't the wall not the sending of messages but the receiving of events from the USB remote control?If you rely on a window message, it will be difficult to receive it on the lock screen, and if it is socketed or serial, the desktop can receive it even if it is not active.


2022-09-30 16:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.