Autor Beitrag
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 22.03.05 18:43 
wie mache ich das ? (ohne hooks)

:D

ich möchte gerne ctrl + mouseleft abfragen

ausblenden Delphi-Quelltext
1:
if (GetAsyncKeyState(vk_control) = 1) and (GetAsyncKeyState(???) = 1) then					


aber wie ein hotkey nicht aus einer procedure heraus, weil die kombo einen timer disablen soll, soll ich dafür einen thread erstellen ?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure hotkey;
begin
  while true do
    if (getasynckeystate(vk_control) = 1) then
      showmessage('Control gedrückt');
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  tid: cardinal;
begin
  createthread(nil, 0, @hotkey, nil, 0, tid);
end;

soweit funzt es schonmal net, und wie mache ich die mausstatus abfrage ?


Zuletzt bearbeitet von F34r0fTh3D4rk am Do 24.03.05 10:11, insgesamt 1-mal bearbeitet
Lesco
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 42



BeitragVerfasst: Di 22.03.05 20:20 
afaik geht das ohne hooks net
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 23.03.05 13:52 
warum gibts denn da sowas wie getasynckeystate nich ?
was macht getasynckeystate ?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 24.03.05 03:29 
also erstmal wird deine funktion nur ein einziges mal aufgerufen
du musst das schon irgendwie loopen lassen z.b. while true do Suche im MSDN GETASYNCKEYSTATE
ob das dann aber auch funzt ist die andere frage

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 24.03.05 10:12 
oh, hab ich vergessen zu posten, funzt aber trotzdem net, müsste doch aber eigentlich, oder ? naja egal, wie mache ich den die mausabfrage, für sonn kleines tool ist mir n hook zu überdimensional :?