 |
Club Builder Foro de C++Builder en español
|
| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
Lalo Ens


Registrado: 24 Jun 2005Mensajes: 39Ubicación: Bs. As. (Argentina)
|
Publicado: Mie 04 Jun, 2008 12:31 pm Asunto: Tecla Alt+F4, Ctrl + Alt + Delete y telca Win |
|
|
Hola a todos,
Antes que nada perdón por tratar un tema que ya se discutió.
Quiero que mi aplicación ignore las teclas : Alt+F4, Ctrl+Alt+Delete y la tecla Windows.
Por lo que leí en el foro hay un Hooks de teclado que lo resuelve, si bien encontré enlaces para descargarlo, dicho link no me funciono.
También encontré algo de código de Cesar para Ctrl + Alt + Suprimir.
Lo que necesitaría si alguien tiene dicho Hooks o algo de código para la deshabitar la tecla de windows y Alt+F4.
Mi mail es l_sulik@hotmail.com, l_sulik@yahoo.com.ar
Gracias _________________ Saludos.
Lalo. |
|
| Volver arriba |
|
 |
Cri_sys Master


Registrado: 13 Feb 2004Mensajes: 198Ubicación: Maringá, Brazil
|
Publicado: Mie 04 Jun, 2008 1:36 pm Asunto: bloquear Alt+F4 |
|
|
Para bloquear Alt+F4, intenta con...
.cpp
| Código: |
void __fastcall TForm1::CreateParams(TCreateParams& Params)
{
TForm::CreateParams(Params);
Params.WindowClass.style |= CS_NOCLOSE;
}
|
//------------------------------------------
.h
| Código: |
void __fastcall TForm1::CreateParams(TCreateParams& Params);
|
_________________ Read what I mean, not what I write! |
|
| Volver arriba |
|
 |
Touchsoftwares Master


Registrado: 16 Dic 2002Mensajes: 869Ubicación: MEXICO Playa del Carmen
|
Publicado: Mie 04 Jun, 2008 4:57 pm Asunto: |
|
|
| Código: |
//---------------------------------------------------------------------------
#include <windows>
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
HHOOK g_hookHandle;
LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam)
{
if (code >= 0)
{
PKBDLLHOOKSTRUCT hs = reinterpret_cast<PKBDLLHOOKSTRUCT>(lParam);
if (hs->vkCode == VK_SNAPSHOT ||
hs->vkCode == VK_PRINT ||
hs->vkCode == VK_LWIN ||
hs->vkCode == VK_RWIN ||
hs->vkCode == VK_F1 ||
hs->vkCode == VK_LCONTROL ||
hs->vkCode == VK_RCONTROL ||
hs->vkCode == VK_TAB )
{
return -1;
}
}
return CallNextHookEx(g_hookHandle, code, wParam, lParam);
}
int WINAPI DllEntryPoint(HINSTANCE hInst, unsigned long reason, void*)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
g_hookHandle = SetWindowsHookEx(WH_KEYBOARD_LL,
reinterpret_cast<HOOKPROC>(KeyboardProc), hInst, 0);
break;
case DLL_PROCESS_DETACH:
UnhookWindowsHookEx(g_hookHandle);
}
return g_hookHandle != 0;
} |
_________________ Ing. Gabriel Góngora Navarrete
TouchSoftwares Inc
http://www.touchsoftwares.com |
|
| Volver arriba |
|
 |
|
|
No puedes publicar temas nuevos en este foro No puedes responder a temas en este foro No puedes editar tus mensajes en este foro No puedes borrar tus mensajes en este foro No puedes votar en las encuestas de este foro
|
© 2002–2026 Club Builder · Funciona con phpBB.
|