Solved

what exactly is a handle

Posted on 2006-06-25
8
151 Views
Last Modified: 2010-04-23
I have read on handles a bit but I am still unsure of what it is. Is it a pointer like in c. What exacly is a handle?

Thanks

San
0
Comment
Question by:Sanmarie
  • 4
  • 4
8 Comments
 
LVL 37

Expert Comment

by:Harisha M G
Comment Utility
Hi, it is a unique identifier assigned by Windows to almost every object it creates..

Basically, it is an unsigned integer. (Just a typedef)

---
Harish
0
 

Author Comment

by:Sanmarie
Comment Utility
So, it is a unique identifier that points to every object in windows, kind of like a integer pointer if you know C ?

So this means that I can get the control by using its integer handle value?

Thanks
0
 
LVL 37

Accepted Solution

by:
Harisha M G earned 50 total points
Comment Utility
No, it is NOT a pointer.

It is not the address of any location either.

Say you create a form, and a button inside it.

Then windows will create the following (Not exactly, but as an example)

- Form (Handle: 1)
- Title Bar (Handle: 2)
- Minimize Button (Handle: 3)
- Maximize Button (Handle: 4)
- Close Button (Handle: 5)
- Your Button (Handle: 6)

So, it is just an value to uniquely identify every object in Windows.

You can use Windows APIs to know what is the type, position and property of an object if you know its handle.
0
 

Author Comment

by:Sanmarie
Comment Utility

excellent!

Thank you

San
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 37

Expert Comment

by:Harisha M G
Comment Utility
0
 

Author Comment

by:Sanmarie
Comment Utility
I know I closed the question. but just to clarify,

the purpose of a handle is for using the windows api? It uniquely identifies an object in windows but what is its other purpose
0
 

Author Comment

by:Sanmarie
Comment Utility
thanks for the links

san
0
 
LVL 37

Expert Comment

by:Harisha M G
Comment Utility
Please go through the above link

Glad I could help !
0

Featured Post

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!

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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