AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Problem mit mehreren Hotkeys!?

Ein Thema von xShadowBoZz · begonnen am 27. Mär 2008 · letzter Beitrag vom 28. Mär 2008
 
Benutzerbild von xShadowBoZz
xShadowBoZz

Registriert seit: 19. Jan 2008
Ort: Deutschland ~.~
80 Beiträge
 
Delphi 7 Enterprise
 
#1

Problem mit mehreren Hotkeys!?

  Alt 27. Mär 2008, 17:58
also ich hab momentan folgendes problem mit diesem code, das ich es nicht schaffe 2oder mehr hotkeys zu setzten, habs schon probiert und nicht hingekriegt,
koennt ihr mir vllt. helfen wie ich hierbei mehrere hotkeys setzten kann?

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    Procedure WMHotkey( Var msg: TWMHotkey ) ;
       message WM_HOTKEY;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
If not RegisterHotkey
    (Handle, 1, 0, VK_F9) Then
     ShowMessage('Unable to assign F9 as hotkey.') ;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotkey( Handle, 1 ) ;
end;

Procedure TForm1.WMHotkey( Var msg: TWMHotkey ) ;
   Begin
     If msg.hotkey = 1 Then Begin
       If IsIconic( Application.Handle ) Then
         Application.Restore;
       Form2.Show;
     End;
   End;

Procedure TForm1.WMHotkey2( Var msg: TWMHotkey ) ;
   Begin
     If msg.hotkey = 1 Then Begin
       If IsIconic( Application.Handle ) Then
         Application.Restore;
       Form2.Show;
     End;
   End;
end.
also hier wird durch das druecken von F9 die 2. Form geoeffnet. *also das systemweit*

lg andy
Andreas
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:23 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