void GlobalNotify(lpNotifyProc) | |||||
GNOTIFYPROC lpNotifyProc; | /* instance address of callback function | */ |
The GlobalNotify function installs a notification procedure for the current task. A notification procedure is a library-defined callback function that the system calls whenever a global memory object allocated with the GMEM_NOTIFY flag is about to be discarded.
lpNotifyProc
Specifies the address of the current task's notification procedure. For more information, see the description of the NotifyProc callback function.
This function does not return a value.
An application must not call the GlobalNotify function more than once per instance.
The system does not call the notification procedure when discarding memory that belongs to a dynamic-link library (DLL).
If the object is discarded, the application must use the GMEM_NOTIFY flag when it calls the GlobalRealloc function to recreate the object. Otherwise, the application will not be notified when the object is discarded again.
If the notification procedure returns a nonzero value, Windows discards the global memory object. If the procedure returns zero, the block is not discarded.
The address of the NotifyProc callback function (specified in the lpNotifyProc parameter) must be in a fixed code segment of a dynamic-link library.