Results 1 to 9 of 9

Thread: Does anyone know how to move the mouse from DF code?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Queens, NY, NY
    Posts
    6,494

    Default Does anyone know how to move the mouse from DF code?

    I have a problem with the PC timing out, I need to make the stupid thing think there is a person busy doing stuff so that it doesn't go to sleep while I'm sucking in data through the serial & Ethernet ports.

    I'm looking to "nudge' the mouse by +/- a pixel or two during the processing, so that the system just stays awake during testing.

    I'm thinking there is a Send WM_Message kind of thing.
    Michael Mullan.
    Danes Bridge Enterprises.

    ++++++++++++++++++++++++++++
    There is just today. Tomorrow is a concept
    that is mostly theoretical. -- GM Wylie
    ++++++++++++++++++++++++++++

  2. #2
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    9,432

    Default Re: Does anyone know how to move the mouse from DF code?

    Garret

    Don't always believe what you think...



  3. #3
    Join Date
    Feb 2009
    Location
    South Florida
    Posts
    3,856

    Default Re: Does anyone know how to move the mouse from DF code?

    i wouldnt do it this way. Why? it is a hack may not work all the time, can annoy the user, etc.

    there are proper ways to tell the machine it should not go to sleep. Google it
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  4. #4
    Join Date
    Feb 2009
    Location
    Queens, NY, NY
    Posts
    6,494

    Default Re: Does anyone know how to move the mouse from DF code?

    What's wrong with annoying the user?

    :-)

    When I went down this rabbit hole, it seemed like nudging the mouse was the least intrusive way of doing this, as that's how the users keep the stupid thing alive anyway. Apparently SetThreadExecutionState is my friend here.
    Michael Mullan.
    Danes Bridge Enterprises.

    ++++++++++++++++++++++++++++
    There is just today. Tomorrow is a concept
    that is mostly theoretical. -- GM Wylie
    ++++++++++++++++++++++++++++

  5. #5
    Join Date
    Feb 2009
    Location
    Birmingham, UK
    Posts
    969

    Default Re: Does anyone know how to move the mouse from DF code?

    Michael,

    Did you see this post from Nils (and does it help you)?

    https://support.dataaccess.com/Forum...ate#post212194
    "My wife thinks I over-analyse our marriage, which, to be frank completely contradicts the findings of my report." - @MooseAllain

  6. #6
    Join Date
    Feb 2009
    Location
    Queens, NY, NY
    Posts
    6,494

    Default Re: Does anyone know how to move the mouse from DF code?

    Yep. That's exactly what I really needed.

    I needed it yesterday, so I had the other programmer in my office add it to our normal DotNet DLL instead because he thinks in c#.

    MM
    Michael Mullan.
    Danes Bridge Enterprises.

    ++++++++++++++++++++++++++++
    There is just today. Tomorrow is a concept
    that is mostly theoretical. -- GM Wylie
    ++++++++++++++++++++++++++++

  7. #7
    Join Date
    Feb 2009
    Location
    Goteborg, Sweden
    Posts
    2,922

    Default Re: Does anyone know how to move the mouse from DF code?

    Great finding Peter. I had totally forgot about that code (!)
    Nils Svedmyr
    RDC Tools International
    www.rdctools.com

    "One morning I shot an elephant in my pyjamas. How he got into my pyjamas I'll never know"
    Groucho Marx

  8. #8
    Join Date
    Sep 2016
    Location
    São Paulo - Brazil
    Posts
    294

    Default Re: Does anyone know how to move the mouse from DF code?

    I agree . . .

    Like a perpetual pendulum

    Click image for larger version. 

Name:	imagesPC6IFICB.jpg 
Views:	36 
Size:	8.0 KB 
ID:	13287


    . . . or . . .

    Click image for larger version. 

Name:	energia.jpg 
Views:	42 
Size:	73.0 KB 
ID:	13288


  9. #9
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    8,003

    Default Re: Does anyone know how to move the mouse from DF code?

    Michael, I don't think you can do it reliably. I tried it in .Net and could never make it work even though there are messages you can send to the keyboard and rat to "simulate" that kind of activity.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •