 |
AutoHotkey Community Wir helfen uns gegenseitig aus der Patsche
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
KitchenTV Gast
|
Verfasst am: Mi Jul 02, 2008 6:44 am Titel: Windows Fenster im Hintergrund steuern oder verstecken |
|
|
Hallo,
für meine Spezialrechnerlösung, wo ich einen PC in einen Kühlschrank eingebaut habe und nur vier Tastaturtasten plus den Power Schalter des Rechners an der Küchenfront zur Verfügung habe, brauche ich Eure Hilfe.
Mit dem Power Schalter des Rechners kann ich den PC immer schön in den Standyby Schlaf bekommen. Es laufen einige Anwendungen (Google Earth, Internet Explorer, ect. - hier Zusatzprogramme genannt) neben dem eigentlichen TV Programm auf dem Rechner. Damit das Gerät aber immer schön aufwacht und immer im selben Systemzustand ist, muss der Rechner aus dem TV Programm in den Standby geschickt werden. Daher möchte ich beim Start der Zusatzprogramme die Funktion des Netzschalters deaktivieren (Option: Nichts unternehmen) und beim Zurückkehren in das TV Programm wieder aktivieren (Option: In den Standbymodus wechseln), damit der Netzschalter nur im TV Programm aktiv ist. Das geht ganz schön über die Energieeinstellungen unter Windows. Zwar kann man auch alles über die Registry einstellen, doch diese müsste dafür neu eingelesen werden oder der Rechner neu gestartet werden. Das hilft leider nicht, daher bediene ich mich AHK, um die Fenstereinstellungen zu setzen.
Und hier brauche ich Eure Hilfe. Ich möchte das Fenster im Hintergrund halten, also hinter dem TV Programm. Leider wird es beim aufruf meines Scriptes immer nach vorne geholt. Für den Anwender vor dem PC ist es auch nicht schön zu sehen, was im Hintergrund für Scripte ablaufen, daher würde ich dies gerne verstecken.
Aber hier erstmal das Script:
| Code: |
SetTitleMatchMode,2
run, c:\windows\system32\powercfg.cpl
winwaitactive, Eigenschaften von Energieoptionen
control, Tabright, 1, Systabcontrol321, Eigenschaften von Energieoptionen
control, Choose, 3, ComboBox2, Eigenschaften von Energieoptionen
controlclick, Button6, Eigenschaften von Energieoptionen
Return |
Vielen Dank für jede Hilfestellung
Der KitchenTV |
|
| Nach oben |
|
 |
Zer00
Anmeldedatum: 01.06.2006 Beiträge: 158
|
Verfasst am: Mi Jul 02, 2008 6:55 am Titel: |
|
|
Ich sehe bei Dir kein WinActivate. Wenn das Fenster im Hintergrund aktiv ist kann das Script bei winwaitactive, Eigenschaften von Energieoptionen lange warten.  _________________ o
L_
O L
This is Schäuble. Copy Schäuble into your signature to help him on his way to Überwachungsstaat. |
|
| Nach oben |
|
 |
KitchenTV Gast
|
Verfasst am: Mi Jul 02, 2008 3:31 pm Titel: |
|
|
Hallo,
wenn ich es doch aufrufe, brache ich doch kein WinActivate, weil es schon vorne ist.
Viele Grüße
Der KitchenTV |
|
| Nach oben |
|
 |
BoBo² Gast
|
Verfasst am: Mi Jul 02, 2008 3:37 pm Titel: |
|
|
Ich schätze mal das solche Konfigurationen auch über die Kommandozeile oder als Service triggerbar sein sollten. Google?
Btw. Wie wärs mal mit einem Satz Fotos vom AHKbetriebenenFridgePC? So als kleiner Ansporn für uns! (Die kannst du auch auf www.autohotkey.net uppen). |
|
| Nach oben |
|
 |
BoBo² Gast
|
Verfasst am: Mi Jul 02, 2008 3:44 pm Titel: |
|
|
Du bist Admin auf der FrostMöhre?. Bestens, denn dann ... | Zitat: | When you open a CMD.EXE prompt, on a Windows XP SP2 computer, and type powercfg /?, you receive:
POWERCFG [/LIST | /QUERY [name] | /CREATE name | /DELETE name |
/SETACTIVE name | /CHANGE name settings |
/HIBERNATE {ON|OFF} | /EXPORT name [/FILE filename] |
/IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag |
/BATTERYALARM {LOW|CRITICAL} [settings] |
/DEVICEQUERY queryflags | /DEVICEENABLEWAKE devicename |
/DEVICEDISABLEWAKE devicename | /?]
Description:
This command line tool enables an administrator to control
the power settings on a system.
Parameter List:
/LIST, /L Lists the names of existing power schemes.
/QUERY, /Q Displays the configuration of the specified power scheme.
If no name is specified, the configuration of the currently
active power scheme is displayed.
/CREATE, /C Creates a power scheme with the specified name. The new
scheme is created with the properties of the currently
active scheme.
/DELETE, /D Deletes the power scheme with the specified name.
/SETACTIVE, /S Makes the power scheme with the specified name active.
/CHANGE, /X Changes settings of the specified power scheme. Additional
switches specify the changes as follows:
/monitor-timeout-ac
/monitor-timeout-dc
/disk-timeout-ac
/disk-timeout-dc
/standby-timeout-ac
/standby-timeout-dc
/hibernate-timeout-ac
/hibernate-timeout-dc
/processor-throttle-ac
/processor-throttle-dc
AC settings are used when the system is on AC power.
DC settings are used when the system is on battery power.
Setting a timeout to zero will disable the corresponding
timeout feature. Supported throttle settings are NONE
CONSTANT, DEGRADE, and ADAPTIVE.
/EXPORT, /E Exports the power scheme with the specified name to a
file. If no filename is specified, the default is
SCHEME.POW. This additional parameter is supported:
/FILE
/IMPORT, /I Imports the power scheme from a file under the specified
name. If no filename is specified, the default is
SCHEME.POW. If a scheme with that name already exists, it
is replaced with the new one. This additional parameter
is supported:
/FILE
/HIBERNATE, /H {ON|OFF} Enables/Disables the hibernate feature. Hibernate
timeout is not supported on all systems.
/NUMERICAL, /N Allows the power scheme to be operated upon to be specified
using a numerical identifier. When using this switch, in
place of the name of the power scheme on the command line,
specify its numerical identifier. This switch may be used
in combination with the /QUERY, /DELETE, /SETACTIVE,
/CHANGE, /EXPORT, and /IMPORT commands.
/GLOBALPOWERFLAG, /G {ON|OFF} Turns one of the global power flags on/off.
Valid flags (to be used after "/OPTION ") are:
BATTERYICON: Turns the battery meter icon in the
system tray on/off.
MULTIBATTERY: Turns on/off multiple battery display
in system Power Meter.
RESUMEPASSWORD: Prompt for password on resuming the
system.
WAKEONRING: Turn on/off wake on ring support.
VIDEODIM: Turn on/off support for dimming video
display on battery power.
/AVAILABLESLEEPSTATES, /A Reports the sleep states available on the
system. Attempts to report reasons why sleep states are
unavailable.
/BATTERYALARM, /B {LOW|CRITICAL} Configures the battery alarm. The
following switches can be specified:
/activate
Enables or disables the alarm.
/level
The alarm will be activated when the power level
reaches this percentage.
/text
Turns the text notification on or off.
/sound
Turns the audible notification on or off.
/action
Specifies the action to take when this alarm goes
off. Not all actions are always available.
/forceaction
Force stand by or shutdown even if a program stops
responding.
/program
Specifies a program to run. schtasks.exe /change
may be used to configure the program.
/DEVICEQUERY will return a list of devices that meet the
criteria specified in . Possible values
for are:
wake_from_S1_supported - return all devices that support
waking the system from a light sleep state.
wake_from_S2_supported - return all devices that support
waking the system from a deeper sleep state.
wake_from_S3_supported - return all devices that support
waking from the deepest sleep state.
wake_from_any - return all devices that support waking
from any sleep state.
S1_supported - list devices supporting light sleep states.
S2_supported - list devices supporting deeper sleep.
S3_supported - list devices supporting deepest sleep.
S4_supported - list devices supporting system hibernation.
wake_programmable - list devices that are user-configurable
to wake the system from a sleep state.
wake_armed - list devices that are currently configured to
wake the system from any sleep state.
all_devices - return all devices present in the system.
all_devices_verbose - return verbose list of devices.
/DEVICEENABLEWAKE enable the device to wake the system from a
sleep state. is a device retrieved using
the '/DEVICEQUERY wake_programmable' parameter.
/DEVICEDISABLEWAKE disable the device from waking the system
from a sleep state. is a device retrieved
using the '/DEVICEQUERY wake_armed' parameter.
/HELP, /? Displays information on command-line parameters.
Examples:
POWERCFG /LIST
POWERCFG /QUERY scheme
POWERCFG /QUERY
POWERCFG /CREATE scheme
POWERCFG /DELETE scheme
POWERCFG /SETACTIVE scheme
POWERCFG /CHANGE scheme /monitor-timeout-dc 15
POWERCFG /CHANGE scheme /monitor-timeout-dc 0
POWERCFG /HIBERNATE on
POWERCFG /EXPORT scheme /file file
POWERCFG /QUERY number /NUMERICAL
POWERCFG /GLOBALPOWERFLAG on /OPTION BATTERYICON
POWERCFG /AVAILABLESLEEPSTATES
POWERCFG /BATTERYALARM low
POWERCFG /BATTERYALARM critical /ACTIVATE on /LEVEL 6 /ACTION hibernate
POWERCFG /DEVICEQUERY wake_armed
POWERCFG /DEVICEENABLEWAKE "Microsoft USB IntelliMouse Explorer" |
|
|
| Nach oben |
|
 |
KitchenTV Gast
|
Verfasst am: Mi Jul 02, 2008 8:59 pm Titel: |
|
|
Hallo zusammen,
per Commandozeile geht das leider nicht. Google hab ich schon leergesucht.
Den passenden Registry Eintrag hab ich eigentlich auch schon. Komisch ist nur, dass die Änderungen in der Registry nur nach einem Neustart wirken, obwohl die Einstellung über das Energieoptionen Fenster direkt greift. Es soll wohl auch funktionieren, die Explorer.exe zu beenden und neu zu starten, aber bei mir geht es nicht, ausserdem finde ich das keine saubere Lösung. Die Einstellungen liegen im HKCU, vielleicht weiß einer von Euch rat. Oder man kann mir sagen, wie ich das Energieoptionenfenster im Hintergrund mit AHK bedienen kann, während das TV Bild und Vollbildmodus aktiv und im Vordergrund ist, ohne dass man sieht, dass eine Änderung stattfindet.
Als Dank und Ansporn habe ich Euch schnell eine Website zusammengebastelt
[url]
http://cmueller.wtal.de/cooltv/index.htm
[/url]
Viele Grüße
Der KitchenTV |
|
| Nach oben |
|
 |
BoBo² Gast
|
Verfasst am: Mi Jul 02, 2008 9:51 pm Titel: |
|
|
| Zitat: | | Oder man kann mir sagen, wie ich das Energieoptionenfenster im Hintergrund mit AHK bedienen kann, während das TV Bild und Vollbildmodus aktiv und im Vordergrund ist, ohne dass man sieht, dass eine Änderung stattfindet. | Das tust du bereits durch Verwendung der AHK Control-Befehle. Also entweder ein Fenster in den Vordergrund zwingen 'AlwaysOnTop', oder in den Hintergrund, oder aus dem sichtbaren Fensterbereich. A_ScreenWidth+n, DetectHiddenWindows, On |
|
| Nach oben |
|
 |
BoBo² Gast
|
Verfasst am: Mi Jul 02, 2008 10:03 pm Titel: |
|
|
Holla, cooles Projekt!! Alein eines verwundert mich jedoch: Tastatur- / Tastensteuerung: AutoIT
Entweder ich bin im falschen Forum, oder wie wo da so ... äh!?  |
|
| Nach oben |
|
 |
fredchf
Anmeldedatum: 18.09.2006 Beiträge: 693 Wohnort: Deutschland
|
Verfasst am: Mi Jul 02, 2008 10:28 pm Titel: |
|
|
hallo!
respekt für dein projekt erstmal!
solltest du die passenden registry-schlüssel kennen und ändern,versuch doch mal EnvUpdate.
| hilfe hat Folgendes geschrieben: | | Notifies the OS and all running applications that environment variable(s) have changed. |
_________________ Mit freundlichen Grüßen
fredchf |
|
| Nach oben |
|
 |
KitchenTV Gast
|
Verfasst am: Mi Jul 02, 2008 10:35 pm Titel: |
|
|
Hallo zusammen,
sorry, aber AutoIT kannte ich schon länger und bin dadurch an Euch gestoßen. Auf dem neuen läuft nur noch AHK.
Viele Grüße
Der KitchenTV |
|
| Nach oben |
|
 |
KitchenTV Gast
|
Verfasst am: Mi Jul 02, 2008 10:57 pm Titel: |
|
|
Hallo fredchf,
super Idee mit Envupdate, aber leider klappt es nicht zusammen mit den Registry Keys. Was macht das Fenster beim Abspeichern noch zusätzlich zum Registryeintrag?
Viele Grüße
KitchenTV |
|
| Nach oben |
|
 |
fredchf
Anmeldedatum: 18.09.2006 Beiträge: 693 Wohnort: Deutschland
|
Verfasst am: Mi Jul 02, 2008 11:42 pm Titel: |
|
|
hallo!
vielleicht mal ein anderer ansatz:
netzschalter-aktivität auf ruhezustand/standby belassen,aber bei zusatzanwendung aktion verhindern.
thread _________________ Mit freundlichen Grüßen
fredchf |
|
| Nach oben |
|
 |
KitchenTV Gast
|
Verfasst am: Do Jul 03, 2008 8:38 am Titel: |
|
|
Hi fredchf,
neuer Ansatz - und nochmals super Idee! Es funktioniert, sogar noch besser, als ich es mir vorgestellt habe. Heute Abend geht es dann in den Praxistest.
Danke und viele Grüße
Der KitchenTV
PS: Wer meine "Frost Kiste" mal anschauen will, weiter oben ist der Link. |
|
| Nach oben |
|
 |
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten.
|
Powered by phpBB © 2001, 2005 phpBB Group Deutsche Übersetzung von phpBB.de
|