Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi TApplicationEvents - OnShortcut (https://www.delphipraxis.net/21759-tapplicationevents-onshortcut.html)

phXql 7. Mai 2004 19:40


TApplicationEvents - OnShortcut
 
Moin leute, ich hab da ein problem.
ich bräuchte ne erklärung (oder n kleines tutorial) zu dem event onShortcut des TApplicationEvents. ich möchte einfach nur n shortcut auf meiner main-form, wenn man z.b. strg+p drückt, dass dann die z.b. die einstellungen aufgerufen werden. wie man nur den shortcut p abfängt, hab ich schon raus, aber wie kann man erkennen, ob gleichzeitig auch noch strg gedrückt wurde?

danke schonmal für eure (hoffentlich kommenden) antworten :)

phXql

toms 7. Mai 2004 19:44

Re: TApplicationEvents - OnShortcut
 
Zitat:

wie kann man erkennen, ob gleichzeitig auch noch strg gedrückt wurde

Hi,

Mit GetKeyState.

Ein Beispiel:

Delphi-Quellcode:
procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey;
  var Handled: Boolean);
begin
 if (Msg.CharCode = Ord('P')) and (GetKeyState(VK_CONTROL) < 0) then
 begin
    ShowMessage('strg+p');
    Handled := true;
  end;
end;

phXql 7. Mai 2004 19:48

Re: TApplicationEvents - OnShortcut
 
is ja ganz einfach ;), danke für die schnelle hilfe :)

phXql


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:47 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz