Announcement

Collapse
No announcement yet.

Ultimate SendKeys App

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ultimate SendKeys App

    Well, it has been one big headache, but with some pieces of code here and my own research I've created a pretty neat application for Journal Recording...or what some might call Windows Macros.

    Let me know what you think and if you find any errors or areas for improvement. The only restriction right now is Win XP+ since I make use of GetProcessImageFileName in a tricky way to get the application/exe icons of the running Windows without using any resources in my own app. Not much of a big deal to me as I intend to not go back to Win9x...but with some type of monetary contribution I could write it to work with Win9x if it is wanted that bad.

    This could be a neat little tool for all those people needing to show someone how to run an application or how to replicate an error, etc. I can't even count all of the Show Me messages and people writing back and forth about not being able to replicate something...now you can record it, send them the file and let them playback your keys/mouse movements...

    http://webpages.charter.net/fervid/Sendy.zip
    sigpic
    Mobile Solutions
    Sys Analyst and Development

  • #2
    100 lookers and no posts. I guess that means 1 of 3 things:

    1. It is so awesome no one has time to post.
    2. Zip only contains an exe and people either think it is a virus or are mad because I didn't post source code.
    3. They played back a Journal and it got stuck somewhere and they didn't push a Windows key sequence like Ctrl+Esc, Ctrl+Alt+Del, or Win+L to break out of it and are ticked thinking I froze their PC...

    I guess in the mean time I have a question. If anyone tried it, did you have any luck playing anything back to an Office App? I can record anything, but for some reason all Office apps seem to block Journal Playback somehow. I guess it doesn't matter since they do Macros anyway, I was just wondering why/how they block it. Might be a cool feature for people that figure this out like I did, but don't make the app as productive or the user aware of what goes on. Then we can have a Journal Blocker, etc. That is one reason why I didn't post source and why I designed this so the user can be aware of what is going on no matter what and not be recorded without their knowledge.

    One thing I haven't tested yet is that it breaks the record/playback when any specific Windows keys are pressed to prevent stealing passwords and such, and it sends a message letting the app know which I check for and unhook the journal since it is no longer being used. Never tried rehooking it though and seeing what happens. I'd hope it still sends the message and stops the recording for security...but you never know with M$.
    Last edited by Roger Garstang; 21 Apr 2008, 03:58 PM.
    sigpic
    Mobile Solutions
    Sys Analyst and Development

    Comment


    • #3
      Roger,

      I tried it and your app worked pretty good. Actually better than expected since a few years ago I experimented with Journal Playback myself, with moderate success..
      So, 'moderate' that I then concluded that this would never work reliably.
      I tried your app with Notepad and Wordpad. Everything worked except selecting text by holding LMB and dragging over the text. This could not be repeated by your macro.

      What Office is concerned, it is notorious for handling user input in a non-standard Windows way. In fact, it does pretty much everything the non-Windows way ..

      Kind regards
      Eddy

      Comment


      • #4
        You sure the highlighting text doesn't work? I just opened a Notepad Window, typed 0-9 into it to have some text then started recording. While recording I highlighted the middle 4 chars and even right clicked. During playback, everything did as expected.

        For the mouse I capture mouse moves and Up/Down messages for the Right/Left/Middle Button. I ignore the wheel scroll messages as they have a documented bug of Journaling not getting the delta, so it doesn't move right. I also capture regular and sys key up/down messages. Journaling doesn't send double click messages as they are only two quick clicks to it and when played back it will be a double.

        I do have an updated version I haven't posted yet that does delays a little better. I originally was going by the .hlp file API which is older and said to delay you return the delay and Windows will wait that long then call your callback again and the 2nd time you return 0 with the same message to play the command. Well, online it says the system may call back before hand if busy or something else is going on. I confirmed this by holding a key down like Ctrl during playback and it speeds up the playback like twice as fast. So, I added a check to see if the time had elapsed and if not to return the difference to delay the proper time. Works pretty good so far, I'm just trying to get a few more improvements before uploading.

        It is a little slow with my check to see if the clock tick has hit Max Dword and get the delay. I originally had a DWORD storing the delay and during recording if the message suddenly had too low of a time I'd make the delay = 4294967295 + msg.time - prevDelay...which would fit in a dword, I just couldn't remember how the PB Type casting worked and if the variables I was using were DWORD and during the calculation they would need to go above DWORD if it would do what it needed and assign the proper value or if it would wrap around and mess up the calculation...so I'm using a QUAD temporarily until I find something in the help or until I do it backwards or something and subtract a value...
        Last edited by Roger Garstang; 21 Apr 2008, 07:08 PM.
        sigpic
        Mobile Solutions
        Sys Analyst and Development

        Comment


        • #5
          Just uploaded a new version. I think I fixed the issue with Office Apps too. I was able to now record and playback in Excel and Word...
          sigpic
          Mobile Solutions
          Sys Analyst and Development

          Comment


          • #6
            Phew... finally some time to check PB's posts!
            Ill try it...

            Comment


            • #7
              Roger... what was that? It was scary... my keyboard and mouse frozen
              for a while when i clicked Play (after recording)... I guess i first read the
              posts! LOL :P

              Comment


              • #8
                Originally posted by Roger Garstang View Post
                You sure the highlighting text doesn't work?
                Roger,
                I retried with your recent version. Text highlighting by dragging indeed does work on Notepad but not on Wordpad.

                Kind regards
                Eddy

                Comment


                • #9
                  Originally posted by Elias Montoya View Post
                  Roger... what was that? It was scary... my keyboard and mouse frozen
                  for a while when i clicked Play (after recording)... I guess i first read the
                  posts! LOL :P
                  While it plays back Windows shuts off the keyboard and mouse. It says it queues all keyboard messages and they will come after playback. If for some reason the keys get sent to the wrong window or something you can press Ctrl+Esc, Ctrl+Alt+Del, Win+L, etc to break out of it. I'm still trying to figure out a weird issue I see every now and then when playing back it will pause for a few seconds...if I wiggle the mouse or press a key like Ctrl it continues playing again. I ran some test and it is returning the right delay, it is like Windows just doesn't call the callback. If I break out and play again it will play fine. I think Windows may be a bit slow sometimes to do what it is supposed to, but it works pretty slick when Windows keeps up on the playback.
                  sigpic
                  Mobile Solutions
                  Sys Analyst and Development

                  Comment


                  • #10
                    Originally posted by Eddy Van Esch View Post
                    Roger,
                    I retried with your recent version. Text highlighting by dragging indeed does work on Notepad but not on Wordpad.

                    Kind regards
                    Weird, you are right, it is like it completely ignores the drag operation. I can see it records the LButton Down and Up, but WordPad ignores them in a drag??? I repeated it and just clicked and it moved the cursor, so it sees the clicks. I then held shift and used the arrow keys and that worked. Just no drag select. Interesting.
                    sigpic
                    Mobile Solutions
                    Sys Analyst and Development

                    Comment

                    Working...
                    X