Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 25-04-2005
Avatar de merlin
merlin merlin is offline
Miembro
 
Registrado: nov 2003
Posts: 64
Poder: 21
merlin Va por buen camino
Mayusculas

Hola a tod@s!

Bueno mi problemas es el siguiente quiero que cuando arranque el programa se activen las mayusculas y que cunado cerremos la aplicación se quiten como puedo hacer eso, gracias espero vuestras respuestas lo antes posible.

Un saludo.
__________________
.:|Merlin|:.
Responder Con Cita
  #2  
Antiguo 25-04-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.275
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Se puede hacer utilizando la api keybd_event y la tecla virtual VK_CAPITAL.

Coloca el siguiente código tanto para activarla como para desactivarla:
Código Delphi [-]
      keybd_event( VK_CAPITAL, MapVirtualkey( VK_CAPITAL, 0 ),
                   KEYEVENTF_EXTENDEDKEY, 0);
      keybd_event( VK_CAPITAL, MapVirtualkey( VK_CAPITAL, 0 ),
                   KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);

Si deseas saber si está activada o desactivada en un momento dado puedes utilizar ésto:

Código Delphi [-]
   if not Odd(GetAsyncKeyState( VK_CAPITAL )) then begin
     MessageDlg('Activa', mtInformation, [mbOK], 0);
   end
   else begin
     MessageDlg('Desacivada', mtInformation, [mbOK], 0);
   end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #3  
Antiguo 25-04-2005
Avatar de merlin
merlin merlin is offline
Miembro
 
Registrado: nov 2003
Posts: 64
Poder: 21
merlin Va por buen camino
Res mayusculas

Hola Neftali.

La parte de activar las mayusculas funciona muy bien pero esta otra parte de codigo:

Código:
 if not Odd(GetAsyncKeyState( VK_CAPITAL )) then begin
     MessageDlg('Activa', mtInformation, [mbOK], 0);
   end
   else begin
     MessageDlg('Desacivada', mtInformation, [mbOK], 0);
   end;
Solo entra en la condicion en la parte de activa tanto si estan activadas las mayusculas como si no. Sabes xq?
__________________
.:|Merlin|:.
Responder Con Cita
  #4  
Antiguo 25-04-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.275
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cierto, en éste caso tal vez me he complicado la vida, prueba con ésto:
Código Delphi [-]
   if Odd(GetKeyState( VK_CAPITAL )) then begin
     MessageDlg('Activa', mtInformation, [mbOK], 0);
   end
   else begin
     MessageDlg('Desacivada', mtInformation, [mbOK], 0);
   end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 19:12:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi