Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   API de Windows (https://www.clubdelphi.com/foros/forumdisplay.php?f=7)
-   -   como cargar en pantalla el teclado (https://www.clubdelphi.com/foros/showthread.php?t=77471)

satabel 30-01-2012 10:13:08

como cargar en pantalla el teclado
 
Codial saludo

manejo delphi 7 , me pueden colaborar inidicando como presento el teclado en pantalla, gracias

olbeup 30-01-2012 10:18:32

En San Google lo puedes encontrar, mira ésta página

Un saludo.

olbeup 30-01-2012 10:23:19

También en el Club he encontrado esto
Un saludo.

P.D.: Sólo hay que buscar.

cesarsoftware 30-01-2012 11:58:28

Hola satael.

Te lo pongo mas facil, esta son las funciones que uso yo habitualmente.

Código Delphi [-]
function SacaTeclado(): HWND;
var
  TecladoPgm: string;
  TecladoWND: HWND;
  Resultado: integer;
  msg: string;
begin
  TecladoPGm := 'c:\windows\osk.exe' // se puede usar otro.
  TecladoWND := FindWindow(nil, 'Teclado en pantalla'); // comprueba si esta en ram
  if TecladoWND = 0 then
  begin
    Resultado := ShellExecute(Application.Handle, 'open', PChar(TecladoPgm), Pchar(''), PChar(ExtractFilePath(TecladoPgm)), SW_SHOW);
    case Resultado of
      0: msg := 'The operating system is out of memory or resources.';
      ERROR_FILE_NOT_FOUND: msg := 'The specified file was not found.';
      ERROR_PATH_NOT_FOUND: msg := 'The specified path was not found.';
      ERROR_BAD_FORMAT: msg := 'The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image).';
      SE_ERR_ACCESSDENIED: msg := 'The operating system denied access to the specified file.';
      SE_ERR_ASSOCINCOMPLETE: msg := 'The file name association is incomplete or invalid.';
      SE_ERR_DDEBUSY: msg := 'The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed.';
      SE_ERR_DDEFAIL: msg := 'The DDE transaction failed.';
      SE_ERR_DDETIMEOUT: msg := 'The DDE transaction could not be completed because the request timed out.';
      SE_ERR_DLLNOTFOUND: msg := 'The specified DLL was not found.';
      SE_ERR_NOASSOC: msg := 'There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.';
      SE_ERR_OOM: msg := 'There was not enough memory to complete the operation.';
      SE_ERR_SHARE: msg := 'A sharing violation occurred.';
    else
      msg := 'Otro problema';
    end;
    if Resultado < 32 then
    begin
      Application.MessageBox(PChar('Problema al ejecutar' + #13 + TecladoPgm + #13 + msg), 'Error', MB_ICONERROR);
      Result := TecladoWND;
      Exit;
    end;
    EsperaSegundos(0.5); // Esperar a que se ejecute
    TecladoWND := FindWindow(nil, 'Teclado en pantalla'); //encuentra la nueva ventana
    if TecladoWND = 0 then
      Application.MessageBox('No encuentro la ventana del teclado', 'Error', MB_ICONERROR);
  end;
  Result := TecladoWND;
end;

procedure CierraTeclado();
var
  TecladoWND: HWND;
begin
  TecladoWND := FindWindow(nil, 'Teclado en pantalla'); // comprueba si es esta en ram
  if TecladoWND = 0 then
    Exit;
  CloseWindow(TecladoWND);  // minimiza
  PostMessage(TecladoWND, WM_CLOSE, 0, 0); // Cierra
end;


La franja horaria es GMT +2. Ahora son las 19:14:30.

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