Exemplo n.º 1
0
Arquivo: hook.c Projeto: aosm/bind
BOOL    mdnHook(HWND hWnd, u_int wMsg, char FAR *buf, CONVPTR pConv)
{
    if (hookHandle == NULL) {
        hookHandle = SetWindowsHookEx(WH_GETMESSAGE, hookProc, NULL, GetCurrentThreadId()) ;
    }
    if (hookHandle == NULL) {
        mdnPrintf("mdnHook: cannot set hook\n") ;
        return FALSE ;
    }
    if (hookListAppend(hWnd, wMsg, buf, pConv) != TRUE) {
        return FALSE ;
    }
    return TRUE ;
}
Exemplo n.º 2
0
/*
 * idnHook - hook async. completion message
 */
BOOL
idnHook(HWND hWnd, u_int wMsg, char FAR *buf, idn_resconf_t ctx)
{
	if (hookHandle == NULL) {
		hookHandle = SetWindowsHookEx(WH_GETMESSAGE, hookProc,
					      NULL, GetCurrentThreadId());
	}
	if (hookHandle == NULL) {
		idnPrintf("idnHook: cannot set hook\n");
		return (FALSE);
	}
	if (hookListAppend(hWnd, wMsg, buf, ctx) != TRUE) {
		return (FALSE);
	}
	return (TRUE);
}