VisualC++ Tips

Just another WordPress.com weblog

Windows Handle

In windows OS, every resource is an “object” identified and referenced by handle of type HANDLE.
In 32 bit machine, it is a 32 bit value. HANDLE is just a typedef of void pointer.
This type is declared in WinNT.h as typedef PVOID HANDLE;
Usually, the HANDLE is wrapped in an instance of a class. CWnd is a good example; it contains HWND which is a handle to a window. Here CWnd brings the object oriented concept. For exapmle to show a window,

pWnd->ShowWindow( SW_SHOW ); this is exactly same as ::ShowWindow( pWnd->m_hWnd, SW_SHoW );

Kernal objects must be manipulated by HANDLES contains:
files, thread, memory,events,mutexes,semaphores,pipes,processes

July 7, 2008 - Posted by afsalm | Uncategorized | | No Comments Yet

No comments yet.

Leave a comment