[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Controlling mouse,dialogs,text of another program

Posted on 1997-10-16
6
Medium Priority
?
140 Views
Last Modified: 2010-04-04
By planning to build a StepbyStep help program.
It's a tutorial program for beginners. StepbyStep moves mouse, presses buttons and types text into dialogs of another program.

How can it be done?
0
Comment
Question by:olmy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 200 total points
ID: 1347729
Olmy,

For 50 points I'll give you a general overview of the steps :)

First, use API calls to get a list of running tasks until you locate the application you want to control.

Once you've done that, run through the child windows of the "screen" (form) to determine what buttons, etc are on it (the ones you wish to control)

With knowledge of the controls on the foreign form your program can issue standard windows messages to themt such as WM_Click, etc.

Hope this helps :)
Pegasus
0
 
LVL 1

Author Comment

by:olmy
ID: 1347730
OK, points added to 100 - sorry for the lower 50. I haven't used this that much so it's quite hard to estimate correct points.

You gave me instructions how to handle dialogs and tasks, but how to move mouse cursor? And perhaps little more instructions to first steps.
0
 
LVL 3

Expert Comment

by:Pegasus100397
ID: 1347731
Olmy,
I had to do something similiar not too long ago (controlling the Dial Up Networking dialog with my program). There are about 7 good Windows API functions you'll need to use and some are rather lengthy. As opposed to posting them here (which would violate the copyright of the book where *I* got them!) I'll point you where to look for *everything* your trying to do here:

Look in Chapter 14, "Windows API Functions" page 481+ in the  book called DELPHI PROGRAMMING PROBLEM SOLVER by Neil Rubenking, ISBN# 1-56884-795-5

I know it's not the best way to answer but I don't know how to give you an answer here without violating the copyright of the book's examples. I wish you luck with your tutorial.... NEXT! :)

Pegasus
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:olmy
ID: 1347732
All right. I'm not planning to buy a book for this purpose - sorry.

I will accept your answer if you name the api calls. I think I can find out how they should be used. I'm still intrested how to move the mouse cursor.

I'm sorry if I'm wasteing your time.
0
 
LVL 3

Expert Comment

by:Pegasus100397
ID: 1347733
Olmy,
Wasting my time? Never! I like the challenge of the questions posted here, the "points" thing is just for fun! :)

Check out the SetCapture API function to capture mouse movements outside of your application

The Mouse_Event API function is a blast for moving the mouse around and simulating button clicks! I used this in a "gag" application as a joke against another programmer, made his mouse move opposite of his physical hand motion. It was a riot! :)

The FindWindow function is but one of many that will help you locate the window handle of the application that you want to "control".  Once you bring up the Win32s help on this function, click on the GROUP hyperlink to get access to tons of other API functions to get info about the application you are running the tutorial on. Of main interest is, of course, the FindWindow to get the handle to the app your tutoring on and EnumChildWindows to find all of the controls currently visible on the app (that you found with FindWindow).

Even if you don't accept the answer, please continue to comment on your progress and I'll be glad to help where I can :)

Pegasus
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 1347734
Mouse capture won't work in 32-bit windows ( NT or 95 ) for the stuff you want to do.

Look at the SetWindowsHookEx API calls. You'll need a DLL. It isn't dead easy, but not too bad.

You'd do a hell of a lot better if you looked at a book, though!

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question