Solved

Using API Calls

Posted on 1998-12-08
8
179 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

12 Experts available now in Live!

Get 1:1 Help Now