Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using API Calls

Posted on 1998-12-08
8
Medium Priority
?
188 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 100 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

598 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