views:

36

answers:

2

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?

A: 

Just using PeekMessage or some other message queue function in WinMain is not enough?

Anders
Using PeekMessage by itself does not work. However, posting a message and calling GetMessage seems to do the trick.
flashk
A: 

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);
flashk