Solved

Using API Calls

Posted on 1998-12-08
8
185 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
Independent Software Vendors: 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

Technology Partners: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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