Hwnd what is
Just know that a given HWND represents a window. You will pass HWNDs to various functions, which lets those functions know which window they are to be working with. As far as you care: none.
It's just an id. Amplifying what Disch said, sometimes you'll see the term 'Opaque Pointer'. Meaning something to the effect that you can't really clearly see what its pointing at. Only Windows knows that. One thing about it, as Disch said, is that its oftentimes passed to various Api functions that work with a window in some way, and I don't believe I've ever seen it as anywhere but in the first position as a function parameter.
That analogy actually works very well. The HWND parameter identifies the actual instance of some Window Class to which some operation is to be performed, as is exactly the case with the implicit 'this' pointer. But if it's a ptr to a struct or some other pass-by-reference thing then presumably const is desirable. Comments anyone? Thanks Plumer. January 16th, , PM 2. Posts 1, Re: HWND. January 16th, , PM 3.
Join Date Jan Posts Technically it's not a structure - it's a pointer to a structure. In reality, HWND is just a pointer to a block of memory that has a Microsoft proprietary size and format - the single unused integer member is a trick that Microsfot uses to hide the real format.
For a user it actually looks like a pointer to a structure whose size is the size of an integer. January 16th, , PM 4. Chaos ensues If it happens to be a pointer to some data structure is an implementation detail that you shouldn't rely on. It certainly isn't. It's not a direct reference to the parent. If it was, all child windows would have the same hwnd.
Mattias, I really don't want to argue but lets take your point regarding 'a handle is just a reference to an object. Where does this object exist exactly?
Please find me an instance where two or more controls share the same pointer in a safe and practiced context and I'll accept your point and eat my words quite happily. Learn More. Ask a question. Quick access. Search related threads.
Remove From My Forums. Answered by:. Archived Forums. Windows Forms General. Sign in to vote. Hi, i searched the definiton of window handle on the internet hard to find actully A window handle usually shortened to hWnd is a unique identifer that Windows assigns to each window created. Wednesday, April 2, AM. Hi, hWnd is just a variable name.
0コメント