问题
Is it possible to disable the mouse feedback cursor when a process begins from within the process?
I know you can use the STARTF_FORCEOFFFEEDBACK
flag when creating the process, and that the feedback cursor will turn off when the process displays a window. However, I do not have control over the code that creates my process and my process is only used for background computation, so it does not display a window.
Anybody know of any system calls I can make to turn off the feedback cursor, other than creating a temporary window and immediately destroying it?
回答1:
Just using PeekMessage or some other message queue function in WinMain is not enough?
回答2:
I was able to turn off the feedback cursor by posting a dummy message to the main thread and immediately receiving the message. Here's the code if anybody else encounters the same problem:
MSG msg;
PostMessage(NULL,WM_NULL,0,0);
GetMessage(&msg,NULL,0,0);
来源:https://stackoverflow.com/questions/3857054/turning-off-process-feedback-cursor-in-windows