Click here to Skip to main content
15,887,338 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralServices - Advanced - Pin
JensB4-Mar-04 20:12
JensB4-Mar-04 20:12 
GeneralRe: Services - Advanced - Pin
Prakash Nadar4-Mar-04 20:17
Prakash Nadar4-Mar-04 20:17 
GeneralRe: Services - Advanced - Pin
JensB4-Mar-04 20:23
JensB4-Mar-04 20:23 
GeneralRe: Services - Advanced - Pin
JensB4-Mar-04 20:45
JensB4-Mar-04 20:45 
GeneralRe: Services - Advanced - Pin
Prakash Nadar4-Mar-04 21:26
Prakash Nadar4-Mar-04 21:26 
GeneralProblem with Hooks Pin
bilal784-Mar-04 19:17
bilal784-Mar-04 19:17 
GeneralRe: Problem with Hooks Pin
Mike Beckerleg5-Mar-04 1:11
Mike Beckerleg5-Mar-04 1:11 
GeneralRe: Problem with Hooks Pin
bilal787-Mar-04 17:58
bilal787-Mar-04 17:58 
g_hHook is a proper handle and yes all of this is within the DLL. Here is the piece of code:
//defined as DLL_USE __declspec(dllexport) OR __declspec(dllimport)<br />
BOOL DLL_USE WINAPI Dll_HookApp()<br />
{<br />
	g_hHook = SetWindowsHookEx(WH_CBT,(HOOKPROC)Dll_HookProc,(HMODULE)g_hInstDll,(DWORD)NULL);<br />
	if (g_hHook)<br />
		return TRUE;<br />
	else<br />
		return FALSE;<br />
}<br />
<br />
BOOL DLL_USE WINAPI Dll_UnhookApp()<br />
{<br />
	if (g_hHook != NULL)<br />
        	return ::UnhookWindowsHookEx(g_hHook);<br />
	else<br />
		return FALSE;<br />
}<br />
<br />
static LRESULT CALLBACK Dll_HookProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
	LRESULT lRes = 0;<br />
<br />
	if(nCode < 0)<br />
		return CallNextHookEx(g_hHook, nCode, wParam, lParam);<br />
<br />
	//Some operations<br />
<br />
	return lRes;<br />
}


Best Regards,
Bilal Anjum
GeneralRe: Problem with Hooks Pin
Mike Beckerleg7-Mar-04 22:51
Mike Beckerleg7-Mar-04 22:51 
GeneralRe: Problem with Hooks Pin
bilal788-Mar-04 1:07
bilal788-Mar-04 1:07 
GeneralRe: Problem with Hooks Pin
Mike Beckerleg9-Mar-04 3:13
Mike Beckerleg9-Mar-04 3:13 
GeneralRe: Problem with Hooks Pin
bilal789-Mar-04 17:37
bilal789-Mar-04 17:37 
QuestionHow to get Users and their rights of current system? Pin
.NetRams4-Mar-04 17:53
.NetRams4-Mar-04 17:53 
GeneralGet MAC address (exclude VPN adp) Pin
gilc1374-Mar-04 15:59
gilc1374-Mar-04 15:59 
Questionhow to receive app launch message? Pin
chpsoft4-Mar-04 14:28
chpsoft4-Mar-04 14:28 
AnswerRe: how to receive app launch message? Pin
Joel Lucsy4-Mar-04 16:00
Joel Lucsy4-Mar-04 16:00 
GeneralRe: how to receive app launch message? Pin
chpsoft4-Mar-04 16:16
chpsoft4-Mar-04 16:16 
GeneralRe: how to receive app launch message? Pin
bilal784-Mar-04 19:30
bilal784-Mar-04 19:30 
GeneralRe: how to receive app launch message? Pin
chpsoft4-Mar-04 19:58
chpsoft4-Mar-04 19:58 
GeneralRe: how to receive app launch message? Pin
bilal784-Mar-04 20:26
bilal784-Mar-04 20:26 
GeneralRe: how to receive app launch message? Pin
chpsoft4-Mar-04 20:41
chpsoft4-Mar-04 20:41 
GeneralShared Folders With Username/Password Pin
shultas4-Mar-04 13:50
shultas4-Mar-04 13:50 
GeneralRe: Shared Folders With Username/Password Pin
sunyou4-Mar-04 19:17
sunyou4-Mar-04 19:17 
Generalnmake and the c++ build tool. Pin
debutante4-Mar-04 13:36
debutante4-Mar-04 13:36 
GeneralRe: nmake and the c++ build tool. Pin
David Crow4-Mar-04 13:39
David Crow4-Mar-04 13:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.