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#
  4. Sending/Simulating Mouse Clicks

Sending/Simulating Mouse Clicks

Scheduled Pinned Locked Moved C#
questiontutorial
3 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.
  • C Offline
    C Offline
    CyberKewl
    wrote on last edited by
    #1

    I'm developing a software which is similar to PCAnywhere and would like to know how to send / simulate a mouse click (with co-ordinates and stuff) that is not form dependant meaning that i can send / simulate the mouse click anywhere i want, be it the taskbar, tray icon, etc. How do i go about doing it? Are there any samples for this sort of thing?

    J 1 Reply Last reply
    0
    • C CyberKewl

      I'm developing a software which is similar to PCAnywhere and would like to know how to send / simulate a mouse click (with co-ordinates and stuff) that is not form dependant meaning that i can send / simulate the mouse click anywhere i want, be it the taskbar, tray icon, etc. How do i go about doing it? Are there any samples for this sort of thing?

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      In Win98 or higher, there is a function called SendInput which you can use to send input as if it is coming from the keyboard, the mouse, or even another device. For any OS below that, you have to simulate it by using windows messages.

      "Do unto others as you would have them do unto you." - Jesus
      "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

      C 1 Reply Last reply
      0
      • J J Dunlap

        In Win98 or higher, there is a function called SendInput which you can use to send input as if it is coming from the keyboard, the mouse, or even another device. For any OS below that, you have to simulate it by using windows messages.

        "Do unto others as you would have them do unto you." - Jesus
        "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

        C Offline
        C Offline
        CyberKewl
        wrote on last edited by
        #3

        After some searching yes that's the only way i guess but it seems to require me to define the structs, do you happen to know the full definitions and probably show me a sample syntax on how to call it?

        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