Discussion:
Creating macros to automate windows?
(too old to reply)
Leo Edwards
2003-07-07 12:44:19 UTC
Permalink
Hello all,

I'm not 100% sure if this is the right place, but anyway, I'm trying
to write a macro to automate a backup procedure in Windows '98. I've
had very little experience in programming/macros but all I really need
to do is to make the macro mimic an enter keystoke on the "start"
button (and perhaps another) on the windows backup prog. I think I can
do it via the VisualBasic editor in Word, but I'm not sure on that
either!

Anyway, I'd be very appreciative if anyone could offer some help
thanks!
Leo Edwards
Larry Hatch
2003-07-08 16:58:20 UTC
Permalink
Post by Leo Edwards
Hello all,
I'm not 100% sure if this is the right place, but anyway, I'm trying
to write a macro to automate a backup procedure in Windows '98. I've
had very little experience in programming/macros but all I really need
to do is to make the macro mimic an enter keystoke on the "start"
button (and perhaps another) on the windows backup prog. I think I can
do it via the VisualBasic editor in Word, but I'm not sure on that
either!
Anyway, I'd be very appreciative if anyone could offer some help
thanks!
Leo Edwards
PowerBASIC or O'BASIC. O'BASIC is pretty simple and free.
Lance Edmonds
2003-07-10 19:15:59 UTC
Permalink
This sounds like a job for the Windows Scheduler, rather than a
program? ie, all you need to do is set up a schedule that runs the MS
Backup app.

In any case, sending keystrokes is only relable if you use a
JournalPlayback routine. Search the PowerBASIC peer support forums
for "journalplayback" and you should find some examples of how it is
done.

Alternatively, you could SendMessage a %WM_COMMAND|%BN_CLICKED
message to the window that owns that button. First you'll need to use
a spy utility to get the ID of the button, then in your own program,
use hWndApp = FindWindow("classname", "windowname") to get the handle
of the application's window, and then you can get the button's handle
with hWndCtrl = GetDlgItem(hWndApp, CtrlID), then use something like
this: CALL SendMessage(hWndApp, %WM_COMMAND, MAKLNG(CtlID,
%BN_CLICKED), hWndCtl)

I hope this helps!
Post by Larry Hatch
Post by Leo Edwards
Hello all,
I'm not 100% sure if this is the right place, but anyway, I'm trying
to write a macro to automate a backup procedure in Windows '98. I've
had very little experience in programming/macros but all I really need
to do is to make the macro mimic an enter keystoke on the "start"
button (and perhaps another) on the windows backup prog. I think I can
do it via the VisualBasic editor in Word, but I'm not sure on that
either!
Anyway, I'd be very appreciative if anyone could offer some help
thanks!
Leo Edwards
PowerBASIC or O'BASIC. O'BASIC is pretty simple and free.
Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc. | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com
Carmel, CA 93923 | 831-659-8008 Fax | mailto:***@powerbasic.com
Loading...