Solved

Using API Calls

Posted on 1998-12-08
8
184 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
[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
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
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!

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

749 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