Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi BlockInput function (https://www.delphipraxis.net/16164-blockinput-function.html)

geisi 11. Feb 2004 17:30


BlockInput function
 
Ich habe von einem Freund diese zwei Zeilen bekommen, um so die Eingabegeräte(maus, tastatur, ...) zu sperren.
Wie verwende ich ihn?

Delphi-Quellcode:
function TForm1.Blockinput(fBlock: boolean): boolean; stdcall;
  external 'user32.dll';
Bitte helft mir

Meflin 11. Feb 2004 17:50

Re: BlockInput function
 
füge das einfach nach der implementation in deinen quelltext ein. dann kannst du das ganze über
BlockInput(true) aktivieren und mit
BlockInput(false) deaktivieren!

geisi 11. Mai 2004 19:00

Re: BlockInput function
 
Habe ich gemacht, aber ich bekomme immer die Fehlermeldung:

"Der Prozedureinsprungpunkt 'TForm1.Blockinput' wurde in der DLL 'user32.dll' nicht gefunden"

was kann ich da machen?

toms 11. Mai 2004 19:03

Re: BlockInput function
 
Zitat:

Function Information

Import library User32.lib
Minimum operating systems Windows 98, Windows 2000

Christian Seehase 11. Mai 2004 19:10

Re: BlockInput function
 
Moin Geisi,

Du solltest das nicht als Methode von TForm1 deklarieren, sondern als normale Funktion.

Tubos 11. Mai 2004 19:42

Re: BlockInput function
 
Habe den Code auch probiert (habe win2k) und der Fehler kommt trotzdem, egal wie ich das deklariere.

Christian Seehase 11. Mai 2004 19:50

Re: BlockInput function
 
Moin Zusammen,

die Deklaration enthält zwei Fehler:
  1. Es wurde als Methode von TForm1 deklariert. Dadurch wird ein, unsichtbarer, Parameter deklariert (self), so dass der Aufruf schon fehlschlagen dürfte.
  2. Wenn man darauf verzichtet die Option name mit anzugeben, muss schon der Funktionsname exakt so geschrieben werden wie die Funktion in der DLL deklariert wurde, in diesem Falle also BlockInput statt Blockinput.
    Gross- / Kleinschreibung ist exakt einzuhalten.

Tubos 11. Mai 2004 19:55

Re: BlockInput function
 
ja, so geht es...thx!


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:58 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