Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung (https://www.delphipraxis.net/141706-blockinput-user32-dll-apptype-console-keine-wirkung.html)

taveuni 14. Okt 2009 13:30


BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
Hallo Leute,

Ich habe ein eigenartiges Problem mit einer Konsolenapplikation.
Ich habe folgendes deklariert:

Delphi-Quellcode:
function BlockInput(fBlockInput: Boolean): DWORD; stdcall;
  external 'user32.dll';
Der Aufruf der Funktion dann:
Delphi-Quellcode:
  if GetCmdLineSwitch('freeze') then
    Writeln(Format('BlockCursor. Result:%d',[BlockInput(True)]));
Starte ich die Anwendung via IDE mit dem Parameter der diese Funktion aufruft
funkioniert alles wie gewünscht. Der Rückgabewert ist 1 und es können keine Eingaben
mehr gemacht werden (Vorsicht beim testen).
Starte ich die Anwendung ausserhalb mit dem Parameter -freeze wird ebenfalls
"BlockCursor. Result:1" ausgegeben. Aber der Input wird nicht geblockt.

Auch die MSDN hat mich nicht weitergebracht.
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Dies alles auf Windows XP SP3/ Delphi 2007

Hat da jemand eine Idee?

Edit: Crosspost Delphi-Treff
http://forum.delphi-treff.de/showthread.php?t=27641

Luckie 14. Okt 2009 13:37

Re: BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
Was willst du damit bezwecken? Warum willst du die Eingaben sperren?

taveuni 14. Okt 2009 13:43

Re: BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
Hallo,

Das ganze ist für eine Industrieapplikation.
Es sind 300 Windows XP Embedded Clients welche via Browser etwas darstellen.
Beim Start müssen via einem kleinen Konsolenprogramm u.a. die Zeit synchronisiert
und der Mauscursor versteckt und geblockt werden. Die PC's haben keine Peripherie.
Aber von Zeit zu Zeit können sich die Administratoren die Bildschirmausgabe via
Remoteaccess anzeigen lassen. Wenn die Eingabe nicht geblockt wird steht der
Mousecursor nach dem verlassen irgendwo im Screen. Mit der Funktion soll dies verhindert werden.

Danke für weitere Tips.

hathor 15. Okt 2009 06:44

Re: BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
Delphi-Quellcode:
ShowCursor(false); //Cursor NICHT sichtbar
ShowCursor(true); //Cursor sichtbar

taveuni 15. Okt 2009 07:07

Re: BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
Leider nein.

ShowCursor() gilt nur für die eigene Applikation.
Danke.

taveuni 15. Okt 2009 13:26

Re: BlockInput (USER32.DLL) in APPTYPE CONSOLE keine Wirkung
 
O.K. Leute,

Der Fehler sass mal wieder vorm Schirm.
Siehe hier: http://forum.delphi-treff.de/showthread.php?t=27641

Danke


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