AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

key an console senden 2

Offene Frage von "moin339"
Ein Thema von moin339 · begonnen am 4. Aug 2003 · letzter Beitrag vom 7. Okt 2004
 
Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: key an console senden 2

  Alt 5. Aug 2003, 13:02
Hallo

Du könntest
Delphi-Quellcode:
IF indent = 0 THEN
BEGIN
  Setforegroundwindow(aWnd);
  sleep(200);
END;
durch ersetzen

Delphi-Quellcode:
IF indent = 0 THEN
WHILE NOT Setforegroundwindow(aWnd) DO
BEGIN
  Application.ProcessMessages;
END;
allerdings muß das Fenster natürlich gefunden werden, sonst
gibt es eine Endlosschleife. Als eleganten Zusatz
(und zur Sicherheit!) kannst Du z.B. die Schleife ja nach
ca. 750ms oder so abbrechen ...

Bedenke, der Fokus Deiner App verschwindet trotzdem solange,
bis das Fenster durch Setforegroundwindow gesetzt wurde.

Auszug aus dem PSDK:
Zitat:
The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.

Syntax

BOOL SetForegroundWindow( HWND hWnd
);
Parameters

hWnd
[in] Handle to the window that should be activated and brought to the foreground.
Return Value

If the window was brought to the foreground, the return value is nonzero.

If the window was not brought to the foreground, the return value is zero.
...
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:47 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