🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
4 messages
4 total messages Started by Eric Mon, 21 Jul 2003 22:03
Beginner Win32 / C question
#4656
Author: Eric
Date: Mon, 21 Jul 2003 22:03
17 lines
2791 bytes
Hello,

How difficult is it to write an interface for my program to control another
application?
IE a piece of code that catches other programs' text and graphical output
and converts that to a workable format for my core program?
I intend to write a bot for an Internet game which uses a client stored on
my PC. However, I don't really have much experience with the Win32 API and
would really appreciate some hints and pointers (no pun intended) to get me
started.
I already received some good help in response to my earlier post, but I'm
looking for as many approaches possible to help me better understand the
whole problem.

Thanks in advance,

Eric
Re: Beginner Win32 / C question
#4658
Author: Gary Chanson
Date: Mon, 21 Jul 2003 23:38
34 lines
3027 bytes
"Eric" <justusenetplease@nospam4me.com> wrote in message 
news:1058825242.740685@halkan.kabelfoon.nl...
> Hello,
>
> How difficult is it to write an interface for my program to control 
> another
> application?
> IE a piece of code that catches other programs' text and graphical output
> and converts that to a workable format for my core program?
> I intend to write a bot for an Internet game which uses a client stored on
> my PC. However, I don't really have much experience with the Win32 API and
> would really appreciate some hints and pointers (no pun intended) to get 
> me
> started.
> I already received some good help in response to my earlier post, but I'm
> looking for as many approaches possible to help me better understand the
> whole problem.

    You've asked a very broad question which has multiple answers depending 
on what you're trying to do and how the program works.  Basically, it's 
going to involve message hooks, faked messages and input events, and 
communications between processes.

    I suggest telling us what you're trying to do and what questions you 
have.  I'm sure we can help.

-- 

-GJC
-Software Consultant (Embedded systems and Real Time Controls)
-gchanson@mvps.org

-Abolish public schools
Re: Beginner Win32 / C question
#4659
Author: Tristan
Date: Tue, 22 Jul 2003 03:16
36 lines
2956 bytes
"Eric" <justusenetplease@nospam4me.com> wrote in message news:<1058825242.740685@halkan.kabelfoon.nl>...
> Hello,
> 
> How difficult is it to write an interface for my program to control another
> application?

Not very. There are a few things you can try. 

> IE a piece of code that catches other programs' text and graphical output
> and converts that to a workable format for my core program?
> I intend to write a bot for an Internet game which uses a client stored on
> my PC. However, I don't really have much experience with the Win32 API and
> would really appreciate some hints and pointers (no pun intended) to get me
> started.

Then do a search on WM_COPYDATA . It's a windows message you can use
to transfer data between applications.

> I already received some good help in response to my earlier post, but I'm
> looking for as many approaches possible to help me better understand the
> whole problem.
> 

Well I'm a firm beleiver in DIY. Look up how to pass data from app to
app using the WM_COPYDATA message. If you're feeling brave, once
WM_COPYDATA is a peice of cake for you, then lookup how to synchronize
processes using mutexes.

> Thanks in advance,
> 
> Eric

Well I know code samples kick ass .. but if you search for WM_COPYDATA
, you'll find what you need.

Tristan
Re: Beginner Win32 / C question
#4660
Author: Programmer Dude
Date: Tue, 22 Jul 2003 16:41
44 lines
3492 bytes
Eric wrote:

> How difficult is it to write an interface for my program to control
> another application?

Others have mentioned, and I want to highlight, that it depends a
great deal on the application you want to control.

Some apps, for example Microsoft Excel, expose an interface that
allows you *total* control.  With that interface (called COM),
you can do anything programmatically in Excel that a user could
do using the app.

Other apps will be much harder to control, because they do not
offer a public API.  Sometimes in Windows, you can do a lot by
sending messages to the application you want to control.  This
often requires you identify the objects within the app and get
their "handles".  Tools exist (e.g. spy++) that can help you do
this.

> I intend to write a bot for an Internet game which uses a
> client stored on my PC.

Depending on a number of factors, you might wish to consider making
a new client rather than controlling the existing one.  Some of
the factors are: how complicated the client is, what it does,
whether you know or can get the internet protocol, the tools you
have and exactly what your goals are.

> However, I don't really have much experience with the Win32 API
> and would really appreciate some hints and pointers (no pun
> intended) to get me started.

You have a lot of material to cover.  Charles Petzold's book,
PROGRAMMING WINDOWS (5th ed.) is considered by many to be *THE*
Bible for Windows programming.  I know it taught me a great
deal.

And you might as well start getting used to MSDN...

-- 
|_ CJSonnack <Chris@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL  |
|_____________________________________________|_______________________|
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads