Basically i am trying to make a script that detects if the currently active window is 1920 x 1080 or bigger. If it detects a window that is active, that is indeed that size. It will do some stuff.
The problem i am having is that it is detecting my desktop whenever i click on my desktop, so it's doing stuff when i don't want it to.
So all i need to know, is how can i do a simple check to see if a window = a title.
Here is what i have so far
$wintitledesktop = WinGetTitle("[ACTIVE]") If not $wintitledesktop = "Program Manager" Then ;does stuff endif Program Manager is what my desktop is called btw.
The problem with that code is that the script is still detecting the desktop and doing the code.
In case you need the whole section of the code, here it is.
$winsizecheck1 = WinGetClientSize("[ACTIVE]") $wintitledesktop = WinGetTitle("[ACTIVE]") If WinActive("[ACTIVE]") Then sleep(100) If $winsizecheck1 >= 1920 Then If $winsizecheck1 >= 1080 Then If not $wintitledesktop = "Program Manager" Then $gamesfolderstate = WinGetState($gamesfolder) If WinExists($gamesfolder) Then If Not BitAND($gamesfolderstate, 16) Then WinSetState($gamesfolder,"",@SW_MINIMIZE) EndIf EndIf EndIf EndIf EndIf EndIf
How do I setup a Hotkey without using so much of the CPU. There must be a better way.
HotKey Patient History.au3
Im looking to measure cpu usage thats free, and measure cpu usage of a program.
My goal is to turn intel speed step off under light cpu load.
I think I can do that, if I can find the cpu usage.
AutoIt SysInfo Clock is a small tool in widget style to show the clock, current CPU usage, CPU speed, memory usage and network activity (tcp, ip and udp). Additionally you can use it as an alarm clock. To stop alarm clock tone press the left LED (mail) or wait 60 seconds.
The current CPU usage code is beta and might be not working for some CPUs!
Move mouse to area below seconds and press rmb to select different color scheme.
Alarm Clock window:
Credits: see scroller (select About).
Special thanks to trancexx for helping me to read out current CPU speed using the WinAPI stuff, AndyG for troubleshooting performance counter issue, czardas for composing "Für Elise" and Ascend4nt for the support!
Download source code + compiled version: Click Me (previous downloads: 1386)
(Please don't use any download manager!)
Compiled version only: MediaFire.com or 4Shared.com
Coded on Win7 x64 using Aero / Win8.1 x64 and AutoIt v18.104.22.168.
This project is discontinued!
v0.9.5.0 build 2013-06-14: initial release
v0.9.6.0 build 2013-06-15: added _WinAPI_CreateRoundRectRgn() to fix transparency issue on non Aero desktops, small internal modifications and added check for whether performance counters are enabled
v0.9.6.5 build 2013-06-15: fixed a bug when "Reset Windows Position" was selected twice and color of scroller will fit to clock color schema
v0.9.8.0 build 2013-06-20: added little music to About part -> many thanks to czardas for mus++ and arranging "Für Elise", added date to clock, replaced CPU usage code -> thanks Ascend4nt
v0.9.9.0 build 2013-06-21: added 2 more color schemas (mint and purple), added network traffic LED, compiled exe now included in archive
v0.9.9.0 build 2013-06-22: forgot to increase a variable in ini section
v0.9.9.0 build 2013-06-24: found also missing modification in context menue after adding two more color schemas
v0.9.9.0 build 2013-06-26: Ops, forgot to change also radio item proper check in clock color schema sub menu
v0.9.9.1 build 2013-06-27: added option to select whether SysInfo Clock should start at windows startup
v0.9.9.2 build 2013-07-01: added yellow-red mark to the small info indicators and additional info when hovering about the small indicators, small internal changes
v0.9.9.5 build 2013-07-05: added features: singleton, update check, visit web site, bring GUI to front and fixed some smaller bugs + some internal changes
v0.9.9.6 build 2013-07-11: added alarm clock feature
v0.9.9.7 build 2014-06-23: adapted code to run on AutoIt version 22.214.171.124
v0.9.9.7 build 2014-08-27: some internal "cosmetic" changes -> this project is discontinued!
this is a part from my script
#include <Misc.au3> $dll = DllOpen("user32.dll") While 1 If _IsPressed("31", $dll) Then one() If _IsPressed("32", $dll) Then two() WEnd Func one() MsgBox(0, "", "1") While _IsPressed("31") or _IsPressed("61") Sleep(1) WEnd EndFunc Func two() MsgBox(0,"", "2") While _IsPressed("32") or _IsPressed("62") Sleep(1) WEnd EndFunc it is working fine but it takes 30 % of the CPU usage and it is a small simple script
when i put sleep(100) in the while loop the CPU is 1%
i think that this is a good solution but not for my case cuz the rest of my script really depends on time and 100 msec will matter
can i reduce the CPU usage without using sleep ?