Click here to Skip to main content
15,921,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CTabCtrl in a Dialog Bar Pin
stevenoliver24-Oct-02 1:49
stevenoliver24-Oct-02 1:49 
GeneralRe: CTabCtrl in a Dialog Bar Pin
Ravi Bhavnani24-Oct-02 1:54
professionalRavi Bhavnani24-Oct-02 1:54 
GeneralRe: CTabCtrl in a Dialog Bar Pin
Ravi Bhavnani24-Oct-02 7:02
professionalRavi Bhavnani24-Oct-02 7:02 
QuestionHow to get bytes sent and bytes receive with IP Helper function Pin
Fang Jing22-Oct-02 21:59
Fang Jing22-Oct-02 21:59 
GeneralOT: cheers to codeproject Pin
Anonymous22-Oct-02 21:35
Anonymous22-Oct-02 21:35 
GeneralRe: OT: cheers to codeproject Pin
Roger Allen23-Oct-02 0:34
Roger Allen23-Oct-02 0:34 
QuestionA question after looking at the "FTPWander",how can it support resuming interrupted transmission ? Pin
nothingremained22-Oct-02 21:13
nothingremained22-Oct-02 21:13 
Generalprevent the user to use some keystrokes using a service, I'v done this by this way, but it works only in some machines... Pin
Joan M22-Oct-02 20:52
professionalJoan M22-Oct-02 20:52 
I had developed a service that run under win2k, this service uses those functions in order to prevent the user to use the keys involved, but for my surprise it only works in some computers...

The fact is that I cannot use it in an industrial PC as I would do in a normal home PC.

take a look at those functions:

<br />
/*<br />
--------------------------------------------<br />
F(x) exportada que permet activar i <br />
desactivar el hook prèviament instal·lat, <br />
retorna true en cas d'èxit, i false en cas <br />
d'error.<br />
--------------------------------------------<br />
*/<br />
DLLSCT_API bool bActivarHook(bool bActivar /*=true*/)<br />
{<br />
	if(bActivar == true)<br />
	{<br />
		hHookTeclat = SetWindowsHookEx(WH_KEYBOARD_LL, HookTeclatLL, hInstDLLSCT, NULL);<br />
		return (hHookTeclat != NULL);<br />
	}<br />
	else<br />
	{<br />
		if(hHookTeclat != NULL)<br />
		{<br />
			UnhookWindowsHookEx(hHookTeclat);<br />
			return true;<br />
		}<br />
		else<br />
		{<br />
			return false;<br />
		}<br />
	}<br />
}<br />
<br />
/*<br />
--------------------------------------------<br />
F(x) contenidora del hook de teclat de baix<br />
nivell.<br />
--------------------------------------------<br />
*/<br />
static LRESULT CALLBACK HookTeclatLL(int nCode,WPARAM wParam,LPARAM lParam)<br />
{<br />
	if (nCode == HC_ACTION)<br />
  {<br />
		switch (nCode)<br />
    {<br />
			case WM_KEYDOWN:<br />
      case WM_SYSKEYDOWN:<br />
      case WM_KEYUP:<br />
      case WM_SYSKEYUP:<br />
			{<br />
				LPKBDLLHOOKSTRUCT p = (LPKBDLLHOOKSTRUCT)lParam;<br />
				bool bEliminarPressioTecla = false;<br />
<br />
				// Paquet de tecles amb combinació amb ALT.<br />
				if ((p->flags & LLKHF_ALTDOWN) != 0)<br />
				{<br />
					bEliminarPressioTecla = (p->vkCode == VK_TAB) || <br />
																	(p->vkCode == VK_ESCAPE) ||<br />
																	(p->vkCode == VK_F4) ||<br />
																	(p->vkCode == VK_LWIN) ||<br />
																	(p->vkCode == VK_RWIN);<br />
				}<br />
				// Paquet de tecles amb combinació amb CTRL.<br />
				else if ((GetKeyState(VK_CONTROL) & 0x8000) != 0)<br />
				{<br />
					bEliminarPressioTecla = (p->vkCode == VK_ESCAPE) || <br />
																	(p->vkCode == VK_F4) ||<br />
																	(p->vkCode == VK_LWIN) ||<br />
																	(p->vkCode == VK_RWIN);<br />
				}<br />
				// Paquet de tecles independents.<br />
        else<br />
				{<br />
					bEliminarPressioTecla =	(p->vkCode == VK_LWIN) ||<br />
																	(p->vkCode == VK_RWIN) ||<br />
																	(p->vkCode == VK_ESCAPE);<br />
				}<br />
				<br />
				if (bEliminarPressioTecla) <br />
				{<br />
					return 1;<br />
				}<br />
<br />
				break;<br />
			}<br />
		}<br />
	}<br />
<br />
	return CallNextHookEx(hHookTeclat, nCode, wParam, lParam);<br />
}<br />


when I start windows by default I start that service automatically.

but it don't prevent those keystrokes in the industrial PC that I'm using now...

I will contact my supplier in order to know which differences are between that industrial PC and the "normal" ones, but as far as I can see the only difference is that it need to be configured as an american keyboard...

Is there any way in which I can see which key is being pressed, or somewhere where I can find information related (keyscan codes...)

As always thank you very much...
GeneralMDI tutorial/links Pin
Mandalay22-Oct-02 20:13
Mandalay22-Oct-02 20:13 
GeneralUNICODE problem! Pin
Daniel Strigl22-Oct-02 20:05
Daniel Strigl22-Oct-02 20:05 
GeneralRe: UNICODE problem! [corrected] Pin
Joaquín M López Muñoz22-Oct-02 21:23
Joaquín M López Muñoz22-Oct-02 21:23 
GeneralRe: UNICODE problem! [corrected] Pin
Daniel Strigl23-Oct-02 3:27
Daniel Strigl23-Oct-02 3:27 
GeneralRe: UNICODE problem! Pin
Maximilien23-Oct-02 3:07
Maximilien23-Oct-02 3:07 
GeneralRe: UNICODE problem! Pin
Daniel Strigl23-Oct-02 3:19
Daniel Strigl23-Oct-02 3:19 
Question_ConnectionPtr pCon ????? Pin
Anonymous22-Oct-02 19:23
Anonymous22-Oct-02 19:23 
AnswerRe: _ConnectionPtr pCon ????? Pin
Nish Nishant22-Oct-02 19:29
sitebuilderNish Nishant22-Oct-02 19:29 
GeneralRe: _ConnectionPtr pCon ????? Pin
Anonymous25-Oct-02 19:59
Anonymous25-Oct-02 19:59 
Generallost unicode... Pin
Mel Feik22-Oct-02 18:28
Mel Feik22-Oct-02 18:28 
GeneralRe: lost unicode... Pin
jmkhael23-Oct-02 2:04
jmkhael23-Oct-02 2:04 
GeneralRe: lost unicode... Still Pin
Mel Feik23-Oct-02 3:17
Mel Feik23-Oct-02 3:17 
GeneralView Print Preview Pin
act_x22-Oct-02 17:59
act_x22-Oct-02 17:59 
GeneralRe: View Print Preview Pin
Roger Allen23-Oct-02 1:07
Roger Allen23-Oct-02 1:07 
QuestionHow to change menu's font ? Pin
Nguyen Huynh Hung22-Oct-02 17:52
Nguyen Huynh Hung22-Oct-02 17:52 
AnswerRe: How to change menu's font ? Pin
José Luis Sogorb23-Oct-02 7:11
José Luis Sogorb23-Oct-02 7:11 
GeneralHelp! ON_UPDATE_COMMAND_UI Not called prior to menu display Pin
work_to_live22-Oct-02 15:24
work_to_live22-Oct-02 15:24 

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.