User`s guide
cvi Contents
WinHLLAPISetBlockingHook( )
This function installs a new function which a Windows HLLAPI Implementation should use to
implement blocking HLLAPI function calls.
This mechanism is provided to allow a Windows version 3.x application to make blocking calls without
blocking the rest of the system. By default under Windows NT, blocking calls will suspend the calling
application’s thread until the request completes. Therefore if a single-threaded application is targeted at
both Windows version 3.x and Windows NT and relies on this functionality it should register a
blocking hook even if the default hook would suffice.
FARPROC WinHLLAPISetBlockingHook(FARPROC lpBlockFunc)
A Windows HLLAPI Implementation has a default mechanism by which blocking HLLAPI functions
are implemented. This function gives the application the ability to execute its own function at blocking
time in place of the default function.
Parameter Type Description
lpBlockFunc FARPROC Specifies the procedure instance address of the
blocking function to be installed.
The default blocking function is equivalent to:
BOOL DefaultBlockingHook(void) {
MSG msg;
/* get the next message if any */
if( PeekMessage(&msg,0,0,PM_NOREMOVE) ) {
if ( msg.message == WM_QUIT )
return FALSE; // let app process WM_QUIT
PeekMessage(&msg,0,0,PM_REMOVE);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/* TRUE if no WM_QUIT received */
return TRUE;
}
The WinHLLAPISetBlockingHook function is provided to support those applications which require
more complex message processing - for example, those employing the MDI (multiple document
interface) model.
Blocking functions must return FALSE if it receives a WM_QUIT message so WinHLLAPI can return
control to the application to process the message and terminate gracefully. Otherwise the function
should return TRUE.
The return value points to the procedure-instance of the previously installed blocking function. The
application or library that calls the SetBlockingHook function should save this return value so that it
can be restored if necessary. (If “nesting” is not important, the application may simply discard the
value returned by WinHLLAPISetBlockingHook and eventually use
WinHLLAPIUnhookBlockingHook to restore the default mechanism.)
Windows HLLAPI Supplier Notes
This function must be implemented on a per-thread basis. It thus provides for a particular thread to
replace the blocking mechanism without affecting other threads.
See also: WinHLLAPIUnhookBlockingHook( )
Syntax
Description
Returns