![]() |
Problem mit OpenProcess
Hi!
Delphi-Quellcode:
Warum funcktioniert dieser Code nicht?
function OpenMinesweeper : boolean;
var PID : cardinal; Window : cardinal; begin Window := FindWindow(nil,'MineSweeper'); GetWindowThreadProcessId(Window,@PID); myHandle := OpenProcess(PROCESS_VM_READ,false,PID); if (myHandle <> 0) then result := true else result := false; end; myHandle isn cardinal. Window hat einen Wert <> 0; PID hat einen Wert <> 0; myHandle ist 0!! GetlastError sagt Invalid Parameter. Ich versteh das nicht. |
Re: Problem mit OpenProcess
Delphi-Quellcode:
geht ohne probleme
function OpenMinesweeper : cardinal;
var PID : cardinal; Window : cardinal; begin Window := FindWindow(nil,'MineSweeper'); GetWindowThreadProcessId(Window,PID); result := OpenProcess(PROCESS_VM_READ,false,PID); end; |
Re: Problem mit OpenProcess
Nein, bei mir nicht.
Edit: Hat sich erledigt. Close pls |
Re: Problem mit OpenProcess
Zitat:
|
Re: Problem mit OpenProcess
Hab die Funktion aus der dll direkt importiert und ein stdcall; vergessen :/
|
Re: Problem mit OpenProcess
Moin T3rm1n4T0r,
kleiner (Verbesserungs?)-Vorschlag:
Delphi-Quellcode:
result := (myHandle <> 0);
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:18 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz