Turning off process feedback cursor in windows

会有一股神秘感。 提交于 2021-01-29 16:22:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!