Solved

Using API Calls

Posted on 1998-12-08
8
180 Views
Last Modified: 2010-04-04
Hi all,

I've been doing a bit of Delphi Programming in my time but, Unfortunately, I have not completely understood the 32 BIT Windows API.

I'd appreciate it if somebody could explain to me how to call fucntions in teh API and what the params in the functions mean. Or if they could send me a URL explaining all of that.

Something I really would like to know is how to get a window handle, and then perform functions on the owner object of that handle.

thanx.
0
Comment
Question by:X_Kalibur
8 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1350003
The Win32 is described quite fully in the on line help. You may find a book helpful as well - the ones by Charles(?) Petzold are recognised as the old and new testaments of Win32 API reference information.

In Delphi every component which has a window (forms, edit control etc etc) has a Handle property - this is the windows handle. You can give this handle to API functions that want it. eg:

SetWindowText(MyComboBox.Handle, 'Boo!');

Cheers,

Raymond.

0
 
LVL 1

Expert Comment

by:chengjian
ID: 1350004
API stand on application programming Interface
It is nothing just some function you can call.
You could see HELP file and windows.pas
Windows.pas declare many apis it can tell you how to use.

you can use findwindow to find a window it return's the handle of the window.

You could see MSDN to find more information. It is useful. You can find MSDN in Visual Studio 6(6cd). When you call api the size of paramenters must be the same.


0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1350005
hi, excalibur.

the api is such a wide topic that it would be good if you told us in which direction your wishes go.

maybe you can state a question like:

"how can i retrieve system information via api-calls?" or
"how to get/change the volume settings?" or
something like that.

then we could post an example which would make the usage quite clear.
that's better to handle than a general explanation.

so far,

rex,

Black Death.
0
 
LVL 1

Author Comment

by:X_Kalibur
ID: 1350006
BlackDeath:

Well basically what i want to do is to learn all aspects of the API. I'm interested in doing stuff with window handles, and performing "Magic" to the owners of the window - EG: Maybe disable the close button on a form etc...

really just anything explaining the win32 api in clear english would be appreciated.

I've been going through the win32.hlp file for a long time, but really cannot  grasp the concept of what they say - EG: When they say the params of the function are
  Function(
  HWIND,
  PARAM1
  PARAM2
etc....


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:X_Kalibur
ID: 1350007
rwilson:

Thanks for your answer. Its at least a guide in the right direction, But what i'm also curious about is what all the
WH_######## properties in the API are...

Any help?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1350008
Do you mean WM_########## properties?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1350009
I see what you mean.

These are for setting windows hooks. Say you want to have an app get a mouse down regradless of whether it has focus or not. You can register a window hook that traps these messages before they are sent to the active application in which case you would use a WH_MOUSE hook.

Cheers,

Raymond.
0
 
LVL 1

Author Comment

by:X_Kalibur
ID: 1350010
rw:

yeah. That should be about all I'll need to know to get me started. I've already written a little app that just sets the visiblity of objects at runtime based ontheir window handles.

anyway, thanks!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now