GetCursorPos failed in Service mode....
-
Hi, We have one program that is taking current cursor position in timer with GetCursorPos(). In normal exe its working fine.We have changed the program in to service. Now In service mode the GetCursurPos return true but values are given by the function are garbage values. we changed function with GetMessagePos but the result is same. Any body know how to make it work. We had also tried to get desktop rights to our service with OpenDesktop and SetThreadDesktop but SetThreadDesktop function failed with error code 170. If anybody knows about this problem please let me know the solution. Thank you, Regards, Jay.
-
Hi, We have one program that is taking current cursor position in timer with GetCursorPos(). In normal exe its working fine.We have changed the program in to service. Now In service mode the GetCursurPos return true but values are given by the function are garbage values. we changed function with GetMessagePos but the result is same. Any body know how to make it work. We had also tried to get desktop rights to our service with OpenDesktop and SetThreadDesktop but SetThreadDesktop function failed with error code 170. If anybody knows about this problem please let me know the solution. Thank you, Regards, Jay.
For getting the cursor position in a desktop, you will need to run an application on the same desktop. If that is an option you can have the service communicate with the application using named events and the application can pass the cursor position to the service using shared memory or the file system or the registry.
«_Superman_» I love work. It gives me something to do between weekends.