Ok,
Tested it with WM_LBUTTONDOWN/ UP from a keyboard key and that works. It doesn't work only with injected input from the mouse. I have no problems with any other application on my pc, Win Forms included.
Don't know, if that is a bug?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
The application and anything else freezes, if i click the close button by my own MOUSEEVENTF_LEFTDOWN/UP.
I'm blocking WM_LBUTTONDOWN/ UP by a mouse hook to forward my own injected input. I can click everything (buttons, listview items) except the close button.
If it freezes and i open the task manager, the window closes immediately and the WM_CLOSE gets executed, the same in Debug and Release mode.
I avoid injected input in the hook:
if (MSLLHOOKSTRUCT* pMouseStruct = (MSLLHOOKSTRUCT*)lParam; nCode >= 0 && (pMouseStruct->flags & LLMHF_INJECTED) == 0)
It seems, as if the close button doesn't accept injected input.
What could be the solution here?
Regards
Ok,
Tested it with WM_LBUTTONDOWN/ UP from a keyboard key and that works. It doesn't work only with injected input from the mouse. I have no problems with any other application on my pc, Win Forms included.
Don't know, if that is a bug?
Really don't know what to do:
https://github.com/microsoft/microsoft-ui-xaml/issues/7858
Should i change to Electron. As i saw, the memory was pretty low in WinUI, in Electron it's not.
I could safely ignore that:
The docunment shows: The mouse_event function synthesizes mouse motion and button clicks.
It is recommended to use SendInput instead
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput
WM_LBUTTONDOWN/UP is viable, but be aware that you must get a window to create and deliver messages.