Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUsing NtCreateFile Pin
Chintoo7234-Aug-05 7:25
Chintoo7234-Aug-05 7:25 
GeneralRe: Using NtCreateFile Pin
Toby Opferman4-Aug-05 11:54
Toby Opferman4-Aug-05 11:54 
Generalrunning with less cpu usage Pin
Chintoo7234-Aug-05 7:21
Chintoo7234-Aug-05 7:21 
GeneralRe: running with less cpu usage Pin
Blake Miller4-Aug-05 7:49
Blake Miller4-Aug-05 7:49 
GeneralGetThemeColor of disabled BP_PUSHBUTTON Pin
RazorBridge4-Aug-05 7:10
RazorBridge4-Aug-05 7:10 
GeneralRe: GetThemeColor of disabled BP_PUSHBUTTON Pin
Jose Lamas Rios4-Aug-05 18:12
Jose Lamas Rios4-Aug-05 18:12 
GeneralRe: GetThemeColor of disabled BP_PUSHBUTTON Pin
RazorBridge4-Aug-05 21:49
RazorBridge4-Aug-05 21:49 
GeneralDisallowing Ctrl-Alt-Del Pin
#realJSOP4-Aug-05 6:26
mve#realJSOP4-Aug-05 6:26 
Target OS = WinXP/SP2
Using VC6

I'm trying to modify Tom Delascia's TaskKeyHook DLL as follows

<br />
LRESULT CALLBACK MyTaskKeyHookLL(int nCode, WPARAM wp, LPARAM lp)<br />
{<br />
	KBDLLHOOKSTRUCT *pkh = (KBDLLHOOKSTRUCT *) lp;<br />
<br />
	if (nCode == HC_ACTION) <br />
	{<br />
		BOOL bCtrlKeyDown =	GetAsyncKeyState(VK_CONTROL)>>((sizeof(SHORT) * 8) - 1);<br />
		BOOL bDelKeyDown  = (pkh->vkCode == VK_DELETE);<br />
		BOOL bAltKeyDown  = (pkh->flags & LLKHF_ALTDOWN);<br />
<br />
		if (  (pkh->vkCode==VK_ESCAPE && bCtrlKeyDown)        // Ctrl+Esc<br />
			||(pkh->vkCode==VK_TAB    && bAltKeyDown)         // Alt+TAB<br />
			||(pkh->vkCode==VK_ESCAPE && bAltKeyDown)         // Alt+Esc<br />
			||(pkh->vkCode==VK_LWIN || pkh->vkCode==VK_RWIN)  // Start Menu<br />
			||(bCtrlKeyDown && bAltKeyDown && bDelKeyDown))   // ctrl+alt+del<br />
		{<br />
			if (g_bBeep && (wp == WM_SYSKEYDOWN || wp == WM_KEYDOWN))<br />
			{<br />
				MessageBeep(0); // only beep on downstroke if requested<br />
			}<br />
			return 1; // gobble it: go directly to jail, do not pass go<br />
		}<br />
	}<br />
	return CallNextHookEx(g_hHookKbdLL, nCode, wp, lp);<br />
}<br />


My line of code is the addition of the last comparison in the if statement:

||(bCtrlKeyDown && bAltKeyDown && bDelKeyDown)

This does not have the desired affect of simply eating the keystroke. Why not, and how do I get to where I want to go if a global hook isn't going to work?



------- sig starts

"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt

"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
GeneralRe: Disallowing Ctrl-Alt-Del Pin
Graham Bradshaw4-Aug-05 6:53
Graham Bradshaw4-Aug-05 6:53 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
#realJSOP4-Aug-05 8:26
mve#realJSOP4-Aug-05 8:26 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
Maximilien4-Aug-05 9:16
Maximilien4-Aug-05 9:16 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
Graham Bradshaw4-Aug-05 10:37
Graham Bradshaw4-Aug-05 10:37 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
Tom Archer4-Aug-05 11:54
Tom Archer4-Aug-05 11:54 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
Anonymous4-Aug-05 15:59
Anonymous4-Aug-05 15:59 
GeneralRe: Disallowing Ctrl-Alt-Del Pin
David Crow9-Aug-05 9:23
David Crow9-Aug-05 9:23 
GeneralConverting char* to unicode big-endian Pin
scchan19844-Aug-05 5:36
scchan19844-Aug-05 5:36 
GeneralRe: Converting char* to unicode big-endian Pin
GKarRacer4-Aug-05 6:26
GKarRacer4-Aug-05 6:26 
GeneralRe: Converting char* to unicode big-endian Pin
scchan19844-Aug-05 16:17
scchan19844-Aug-05 16:17 
GeneralRe: Converting char* to unicode big-endian Pin
Jose Lamas Rios4-Aug-05 19:59
Jose Lamas Rios4-Aug-05 19:59 
GeneralRe: Converting char* to unicode big-endian Pin
scchan19844-Aug-05 20:41
scchan19844-Aug-05 20:41 
GeneralRe: Converting char* to unicode big-endian Pin
Jose Lamas Rios4-Aug-05 21:59
Jose Lamas Rios4-Aug-05 21:59 
GeneralRe: Converting char* to unicode big-endian Pin
scchan19844-Aug-05 22:37
scchan19844-Aug-05 22:37 
GeneralRe: Converting char* to unicode big-endian Pin
scchan19844-Aug-05 23:42
scchan19844-Aug-05 23:42 
GeneralRe: Converting char* to unicode big-endian Pin
Jose Lamas Rios5-Aug-05 6:19
Jose Lamas Rios5-Aug-05 6:19 
GeneralRe: Converting char* to unicode big-endian Pin
scchan19844-Aug-05 22:31
scchan19844-Aug-05 22:31 

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.