{{page>en:templates:win16api}}
====== LocalHandle ======
==== Brief ====
Retrieves the handle associated with a given pointer to a local memory object.
==== Syntax ====
HLOCAL WINAPI LocalHandle(
LPCVOID pMem
);
==== Parameters ====
pMem – Pointer to a memory block inside the local heap (returned by LocalLock).
==== Return Value ====
Returns the handle of the object, or NULL if the pointer does not belong to the local heap. Call GetLastError.
==== Notes ====
This function is the inverse of LocalLock.
Useful when you only have a pointer and need the handle for other operations (e.g., LocalFlags, LocalSize).
==== Example Code ====
==== C Binding ====
HLOCAL h = LocalHandle(pData);
==== MASM Binding ====
push p
call LocalHandle
==== See also ====
* [[LocalLock]]
{{page>en:templates:win16}}