Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetCursorPos failed in Service mode....

GetCursorPos failed in Service mode....

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    onlyjaypatel
    wrote on last edited by
    #1

    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.

    _ 1 Reply Last reply
    0
    • O onlyjaypatel

      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.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups