AGB  ·  Datenschutz  ·  Impressum  







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

Monitor einschalten

Ein Thema von himitsu · begonnen am 14. Okt 2025 · letzter Beitrag vom 15. Okt 2025
Antwort Antwort
Seite 2 von 2     12   
Benutzerbild von blawen
blawen

Registriert seit: 30. Nov 2003
Ort: Luterbach (CH)
730 Beiträge
 
Delphi 13 Florence
 
#11

AW: Monitor einschalten

  Alt 14. Okt 2025, 16:18
Manuell funktioniert es ja weiterhin, also Touch, Tastatur und Maus,
aber es muß doch auch möglich sein, das via Software zu erledigen.
Und wenn Du den Mausklick, bzw. deren Bewegung einfach softwareseitig simulierst?

Delphi-Quellcode:
procedure WakeUpMonitor;
var
  Input: TInput;
begin
  // Maus minimal bewegen, um Aktivität zu simulieren
  ZeroMemory(@Input, SizeOf(Input));
  Input.Itype := INPUT_MOUSE;
  Input.mi.dx := 0;
  Input.mi.dy := 1;
  Input.mi.dwFlags := MOUSEEVENTF_MOVE;
  SendInput(1, Input, SizeOf(Input));

  // Wieder zurückbewegen, damit Cursorposition gleich bleibt
  ZeroMemory(@Input, SizeOf(Input));
  Input.Itype := INPUT_MOUSE;
  Input.mi.dx := 0;
  Input.mi.dy := -1;
  Input.mi.dwFlags := MOUSEEVENTF_MOVE;
  SendInput(1, Input, SizeOf(Input));
end;
Roland
  Mit Zitat antworten Zitat
EKON 29
Benutzerbild von Olli73
Olli73

Registriert seit: 25. Apr 2008
Ort: Neunkirchen
803 Beiträge
 
#12

AW: Monitor einschalten

  Alt 14. Okt 2025, 16:28
Also wenn es (auch) um USB geht, gibt es dann vielleicht hier was passendes einzustellen:

Geräte-Manager -> USB Controller -> Eigenschaften -> Power Management

?
  Mit Zitat antworten Zitat
TomyN

Registriert seit: 8. Nov 2006
Ort: Bayreuth
303 Beiträge
 
Delphi 10.3 Rio
 
#13

AW: Monitor einschalten

  Alt 14. Okt 2025, 20:23
Powermanagement (Energiespareinstellungen) wäre auch mein erster Tip.
Evtl. auch mal im UEFI schauen, da kann man manchmal den Energiesparlevel einstellen.
Kann man windows-Systemmessages 'faken', ich würde da an wm-powerbroadcast denken.
Thomas Neumann
Meine Projekte
www.satlive.audio
www.levelcheck.de
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
487 Beiträge
 
#14

AW: Monitor einschalten

  Alt 15. Okt 2025, 07:59
Es wird ein spezieller RFID-Reader genutzt, welcher direkt mit unserem Programm kommuniziert.
Es könnte prinzipiell auch ein Fingerabdruckscanner sein.
Es sind aber keine Geräte, welche mit Windows reden, über eine Autehtifizierungs-API, wie z.B. für Login via FaceID, RFID/NFC oder Fingerprint.

Es muß nicht zwangsläufig ein COM-Port sein.
Wir unterstützen mehrere Geräte, welche via COM-Port, Ethernet oder einen propitärem USB-Protokoll (via DLL) mit unserer Software reden.
Außerdem geht über COM/USB nicht nur die Info über einen angelegten RFID-Chip, sondern auch regelmäßig Statusinformationen von und zum Gerät.
(z.B. die Geräte von Datafax besitzen ein Display und konfigurierbare Buttons, welche vom Programm gestuert werden, ohne dass dabei der PC-Monitor aktiv sein muß)

Im Grunde läuft permanent ein Programm (24x7),
für Lebensdauer und Energieersparnis schaltet Windows vorübergehend den Monitor ab
und, wenn das Programm etwas mitteilen will, bzw. eine Eingabe erwartet, dann wird der Monitor aktiviert (sollte jedenfalls).


Es ist möglich, das Ausschalten zu verhinden, dann geht er aber nie aus, wie es z.B. Mediaplayer oft machen.
Und früher war es auch möglich den Monitor zu aktivieren, wenn er aus war, aber dieses funktioniert eben nicht mehr.

Manuell funktioniert es ja weiterhin, also Touch, Tastatur und Maus,
aber es muß doch auch möglich sein, das via Software zu erledigen.
Here the English translation, and i am really sorry, all what i want is try to help,

Zitat:
We support several devices
Devices means drivers, drivers means power management is involved, BUT from what i understand now the code is running and detecting signal from RFID (device) and execute fine, only the turning the monitor part is the failing part, right ?

Zitat:
To ensure its service life and save energy, Windows temporarily switches off the monitor.
This is the most important part, and yet it is not clear for me, Windows did turn the monitor OFF ? How ?
By power saving settings ? or by your code ? how did it figure it out that the monitor need to go off ? that what you should follow.

Zitat:
* Monitor active
* Screen saver (which is almost always deactivated)
* Monitor in standby (black image with active backlight)
* Monitor off, deactivated via Windows (here it is actually in standby, i.e. screen off, but it is waiting)
* Monitor completely off (manually switched off and does not respond to Windows)
Fantastic, now, when monitor in StandBy and/or monitor is off, is the display adapter (video card) is off too ? or in power saving regime?

I really believe it is ACPI and power management settings, most likely combined with different or updated drivers by Windows 11, see my Windows 10 sometimes reverts nVidia geforce driver to WHQL from Microsoft instead of sticking to the newer i downloaded from nVidia which is also WHQL, this happen when power is shut suddelnly and on next rerstart Windows decide to go back to older driver, same happen to my Android ADB drivers, keep returning to older ones.

ps : again, i suggest to check and log what devices are off every minute, this might reveal the real culprit, as i said when code request monitor to be turned on Windows might has different opinion about its state, or simply it can't because the code is asking different request from it should, so it might not fulfill this request as lets say the display card is off or even some other device controller is the one is off.
Kas
  Mit Zitat antworten Zitat
HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
994 Beiträge
 
Delphi 6 Professional
 
#15

AW: Monitor einschalten

  Alt 15. Okt 2025, 11:28
Hmm..

Bis Windows 7 konnte man die Monitore mit einem SendMessage Ausschalten und wieder Einschalten.
Ab Windows 8 funktioniert nur noch das Ausschalten per SendMessage.

Um ab Windows 8 die Monitore einzuschalten genügt jedoch ein MouseMove:

Delphi-Quellcode:
{
  // Special HWND value for use with PostMessage() and SendMessage()
  HWND_BROADCAST  = $FFFF;

  WM_SYSCOMMAND  = $0112;
  SC_MONITORPOWER = $F170
}


const
  MONITOR_ON = -1; // Monitor Wake up
  MONITOR_OFF = 2; // Monitor Shut down
  MONITOR_STANDBY = 1; // Monitor Standby

procedure TForm1.Button1Click(Sender: TObject);
begin
  SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); // Monitor Shut down
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_STANDBY); // Monitor Standby
  Timer1.Enabled := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Enabled := False;
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON); // Monitor Wake up
  Wake;
end;

procedure TForm1.Wake;
begin
  mouse_event(MOUSEEVENTF_MOVE, 0, 1, 0, 0);
  mouse_event(MOUSEEVENTF_MOVE, 0, 0, 0, 0);
end;
(Getestet mit Win7 / Win10 / Win11)
(Ja ich Verwende Delphi 6 Pro und will NICHT wechseln!)
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


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 06:00 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