Hello, I am creating a program that opens and closes your CD drive repeatedly, and fixes your mouse position. I have created an initial while condition that loops the opening and closing of the drive. I was wondering how I can introduce a second infinate loop, fixing the position of the mouse. Using SetCursorPos( X, Y ); I want to make sure that the user has his mouse fixed, so he can't move it. Placing this line of code after the device eject or load function still gives the user enough time to close the application.
Thank you.
*SP* infinite
while(1)
{
DWORD d = 0;
DeviceIoControl(hcd, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0,
&d, NULL);
DeviceIoControl(hcd, IOCTL_STORAGE_LOAD_MEDIA, NULL, 0, NULL, 0,
&d, NULL);
}
CloseHandle(hcd);
return 0;
}