Einzelnen Beitrag anzeigen

vip11

Registriert seit: 22. Jul 2008
32 Beiträge
 
#3

Re: Desktop symbole ein/ausblenden

  Alt 18. Jun 2009, 16:40
thx klappt
jetzt hab ich des problem das mein programm die hotkeys nimmer nimmt
was hab ich falsch gemacht?
Code:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    id3: Integer;
    procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
  public
    { Public declarations }
  end;

var
  x : integer;
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WMHotKey(var Msg: TWMHotKey);
begin
  if Msg.HotKey = id3 then
    button1.Click;
end;

procedure TForm1.FormCreate(Sender: TObject);
const
  VK_F4 = $73;
begin
x := 0;
  id3 := GlobalAddAtom('Hotkey3');
  RegisterHotKey(Handle, id3, 0, VK_F4);

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  UnRegisterHotKey(Handle, id3);
  GlobalDeleteAtom(id3);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if x = 0 then begin
      x:= 1;
ShowWindow(FindWindow(nil, 'Program Manager'), SW_SHOW);
end else if x= 1 then begin
x:= 0;
ShowWindow(FindWindow(nil, 'Program Manager'), SW_HIDE);
end;
end;

end.
  Mit Zitat antworten Zitat