Club Builder - Foros de discusión Club Builder
Foro de C++Builder en español
 
 FAQFAQ   BuscarBuscar   MiembrosMiembros   Grupos de UsuariosGrupos de Usuarios   RegistrarseRegistrarse 
 PerfilPerfil   Entra para ver tus mensajes privadosEntra para ver tus mensajes privados   EntrarEntrar 

Tecla Alt+F4, Ctrl + Alt + Delete y telca Win

 
Publicar nuevo tema   Responder al tema    Foros de discusión -> Consultas
Ver tema anterior :: Ver tema siguiente  
Autor Mensaje
Mensaje    Asunto: Tecla Alt+F4, Ctrl + Alt + Delete y telca Win Responder citando

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
Ver perfil de usuario Enviar mensaje privado Enviar email MSN Messenger
Mensaje    Asunto: bloquear Alt+F4 Responder citando

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
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

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
Ver perfil de usuario Enviar mensaje privado Visitar sitio web del autor MSN Messenger
Mostrar mensajes de anteriores:   
Cambiar a:  
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


Hosting WordPress Indedmedia desde 3,99 €
© 2002–2026 Club Builder · Funciona con phpBB.