Leaderboard
Popular Content
Showing content with the highest reputation on 05/09/2016 in all areas
-
UDF Input Event Capture - Mouse & Keyboard
nend reacted to MouseSpotter for a topic
This module allows a program to monitor mouse events and keyboard events. The module invokes user defined _InputEvent_* functions to process events captured. Documentation InputEvent version 1.2a InputEvent 1.2a.zip Attachment contains: InputEvent.au3InputEvent.dllExamples example_full,au3 demonstrating all events capturedexample_simple.au3 demonstrating mouseMove event capture1 point -
11-3-2016: Uploaded a new SciTE4AutoIt3.exe. Merged the SciTE 3.6.2 source into our version and several other changes and fixes to the supporting utilities. Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 6-3-2016 *** Merged the SciTE v 3.6.2 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v16.306.1237.0 (Jos) - 15.920.938.2 removed the check for utf8 for au3check as that is supported - 15.920.938.3 Reverted __ConsoleWrite() to ConsoleWrite for ShowStdOutErr() - 15.920.938.4 added info for codepage and utf8 check to header. - 15.920.938.5 Only warn about #RequireAdmin for Run option. - 15.920.938.6 fixed issue when these were used together: #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_Res_SaveSource=Y - 15.920.938.8 Modifications from DickG for the GUI Control locations and sizes to fit other screen sizes. *** Updated Au3Stripper v16.306.1237.0 (Jos) - 15.920.938.2 Fixed error line number for statements using unresolved func name Added logic to remove the () behind the Func in case of this type of lines: Call(Example3(), 'fff') NewFoundWord$ is then="Example3()" - 15.920.938.3 Added minus sign support to preexpand variables. - 15.920.938.4 Fixed crash in the get firstword logic to limit the returned length to 500. - 15.920.938.5 Fixed /PE replacing the variable in a For $x= statement. *** Updated SciTEConfig v16.306.1237.0 (Jos) - 15.920.938.1 hide/unhide when opening Tidy.ini to avoid a hidden msgbox hanging SciTEConfig.au3 - 15.920.938.2 Added the creation of includes.txt for AutoComplete Standard UDFs when "#include" is typed. - 15.920.938.3 Fixed for CallTip not always updating correctly. *** Updated Tidy v16.306.1237.0 (Jos) - 15.920.938.1 Fixed issue with space removal between [ and Then - 15.920.938.2 #forceref and #forcedef now also tidied. - 15.920.938.3 Enfoces a single space between end-of-line and inline comment - 15.920.938.4 Fixed regression extra space between EndFunc and #EndRegion and the added comments. -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the newly formatted the online documentation for an overview of all extra's you get with this installer.1 point
-
.. and this script is to do what exactly? Just click on 2 buttons? Jos1 point
-
Have a look at this example: The script to compile, then Run and you like to close gracefully: OnAutoItExitRegister("OnAutoItExit") AutoItWinSetTitle("testing") While 1 sleep(50) WEnd Func OnAutoItExit() MsgBox(0,"testing closing","test") EndFunc ;==>OnAutoItExit The AutoIt3 command to close it gracefully: WinClose("testing") Jos1 point
-
JARVIS !!?
TheSpannish reacted to KeshHERE for a topic
#include <Array.au3> #include <WinAPIFiles.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #Include <ButtonConstants.au3> #include <EditConstants.au3> #include <StringConstants.au3> HotKeySet("{ESC}", "MyExit") HotKeySet ("{F9}", "Pause") Global $voice = ObjCreate("SAPI.SpVoice") $sFilePath = @ScriptDir & "\Data.ini" Global $Paused If FileExists($sFilePath) Then Sleep(50) Else $string="[General]"&@CRLF&"google=google"&@CRLF&"youtube=youtube"&@CRLF&"time=time"&@CRLF&"date=date"&@CRLF&"torrent=torrent"&@CRLF&"google images=google images" $file=FileOpen($sFilePath,1) FileWrite($file,$string) FileClose($file) EndIf $gui1=GUICreate("JARVIS", 250 , 150) $input1 = GUICtrlCreateInput("", 75, 40, 100, 25) $OK1 = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$gui1) speak('How may i help you?') While 1 ;getting all commands for perticular func $google=IniRead($sFilePath, "General", 'google', "") $youtube=IniRead($sFilePath, "General", 'youtube', "") $torrent=IniRead($sFilePath, "General", 'torrent', "") $time=IniRead($sFilePath, "General", 'time', "") $date=IniRead($sFilePath, "General", 'date', "") $Gimages=IniRead($sFilePath, "General", 'google images', "") $googleJ=StringSplit($google,",") $timeJ=StringSplit($time,",") $dateJ=StringSplit($date,",") $youtubeJ=StringSplit($youtube,",") $torrentJ=StringSplit($torrent,",") $GimagesJ=StringSplit($Gimages,",") Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $ok1 ;checking if given command exist in any of the func $i=_ArraySearch($googleJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) $k=_ArraySearch($torrentJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) $j=_ArraySearch($youtubeJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) $l=_ArraySearch($timeJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) $m=_ArraySearch($dateJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) $n=_ArraySearch($GimagesJ,GUICtrlRead ($input1), 0, 0, 0, 0, 1) If $i<>-1 Then google() ElseIf $j<>-1 Then youtube() ElseIf $k<>-1 Then torrent() ElseIf $l<>-1 Then speak('time') ElseIf $m<>-1 Then speak('date') ElseIf $n<>-1 Then Gimages() Else speak("command not found, would you like to add?") edit() EndIf EndSwitch WEnd Func Gimages() $guin = GUICreate("JARVIS:Gimages",250,150) $inputn= GUICtrlCreateInput("", 25, 40, 200, 25) $OKn = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$guin) speak("what would you like to search?") While 2 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $okn Sleep(1000) $search= GUICtrlRead($inputn) ShellExecute("https://images.google.com/?q="&$search) Sleep(4000) Send("{ENTER}") Sleep(1000) GUIDelete($guin) Sleep(1000) speak("search is complete sir.") ExitLoop EndSwitch WEnd EndFunc Func torrent() $gui3 = GUICreate("JARVIS:torrent",250,150) $input3= GUICtrlCreateInput("", 25, 40, 200, 25) $OK3 = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$gui3) speak("what would you like to search?") While 4 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $ok3 $string= GUICtrlRead($input3) $search=StringReplace($string," ","{+}") ShellExecute("https://kat.cr/usearch/"&$string&"/") Sleep(2000) Send("^t") Send("https://isohunt.to/torrents/?ihq="&$search) Send("{ENTER}") Sleep(2000) Send("^t") Send("http://www.torrentz.eu/search?q="&$search) Send("{ENTER}") Sleep(2000) GUIDelete($gui3) Sleep(2000) speak("search is complete sir.") ExitLoop EndSwitch WEnd EndFunc Func youtube() $gui8 = GUICreate("JARVIS:youtube",250,150) $input8= GUICtrlCreateInput("", 25, 40, 200, 25) $OK8 = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$gui8) speak("which video sir?") While 8 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $ok8 $search= GUICtrlRead($input8) ShellExecute("https://www.youtube.com/results?search_query="&$search) Sleep(3000) GUIDelete($gui8) speak("search is complete sir.") ExitLoop EndSwitch WEnd EndFunc Func google() $gui2 = GUICreate("JARVIS:google",250,150) $input2= GUICtrlCreateInput("", 25, 40, 200, 25) $OK2 = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$gui2) speak("what would you like to search?") While 2 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $ok2 Sleep(1000) $search= GUICtrlRead($input2) ShellExecute("https://www.google.co.in/search?q="&$search) Sleep(1000) GUIDelete($gui2) Sleep(1000) speak("search is complete sir.") ExitLoop EndSwitch WEnd EndFunc Func edit() $gui = GUICreate("JARVIS-EDIT_COMMAND_PROTOCOL",250,150) $yes = GUICtrlCreateRadio("YES", 10, 10, 120, 20) $no = GUICtrlCreateRadio("NO", 10, 40, 120, 20) GUICtrlSetState($yes, $GUI_CHECKED) $OK = GUICtrlCreateButton("Done", 100, 120, 55, 20,$BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW,$gui) Local $idMsg While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop Case $idMsg = $OK And BitAND(GUICtrlRead($yes), $GUI_CHECKED) = $GUI_CHECKED GUIDelete($gui) yes() ExitLoop Case $idMsg = $OK And BitAND(GUICtrlRead($no), $GUI_CHECKED) = $GUI_CHECKED GUIDelete($gui) ExitLoop EndSelect WEnd EndFunc Func yes() $guia = GUICreate("JARVIS-EDIT_COMMAND_PROTOCOL",250,150) $OKa = GUICtrlCreateButton("Done", 100, 120, 55, 20) $inputa=GUICtrlCreateInput("",10,25,200,30) GUICtrlCreateLabel("COMMAND",10,5,200,20) GUICtrlCreateLabel("FUNC",10,65,200,20) $inputb=GUICtrlCreateInput("",10,90,200,30) GUISetState(@SW_SHOW,$guia) Local $idMsg While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop Case $idMsg = $OKa $type=IniRead($sFilePath, "General", GUICtrlRead($inputb), "") $value=$type&","&GUICtrlRead($inputa) IniWrite($sFilePath, "General",GUICtrlRead($inputb) , $value) Local $sRead = IniRead($sFilePath, "General", GUICtrlRead($inputb), "") speak("command successfully added to "& GUICtrlRead($inputb)) GUIDelete($guia) ExitLoop EndSelect WEnd EndFunc Func MyExit() sleep(100) ToolTip('Script is "terminated"',0,0) sleep(500) Exit EndFunc Func Pause () $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func speak($speak) If $speak='time' Then $t='speaks=hour(time) & "hour" & minute(time) & "minutes" & second(time) & "seconds"'&@CRLF&'set speech= CreateObject("sapi.spvoice")'&@CRLF&'speech.Rate = -3'&@CRLF&'speech.Speak speaks' FileWrite("t.vbs",$t) RunWait('cscript.exe "t.vbs"',"",@SW_MINIMIZE) FileDelete('t.vbs') ElseIf $speak='date' Then $d='speaks=date'&@CRLF&'set speech= CreateObject("sapi.spvoice")'&@CRLF&'speech.Rate = -3'&@CRLF&'speech.Speak speaks' FileWrite("d.vbs",$d) RunWait('cscript.exe "d.vbs"',"",@SW_MINIMIZE) FileDelete('d.vbs') Else $Voice.Speak($speak,11) Sleep(500) EndIf EndFunc Well, not exactly as Ironman of course, and still in progress. SAPI included so use speaker or earphone/headphone to hear. For input you have to type it. Any ideas, Suggestions are welcomed. Included FUNC: -google -youtube -google images -torrent -time -date Command to access each func is FUNC name itself.. If you enter wrong command like"Search" instead of "google", then it will ask you if you want to add that command in any of FUNC. Say yes and add COMMAND "Search" in FUNC "google", so that you can now excess FUNC "google", using "Search" COMMAND. JARVIS.au31 point -
I'm a C noop and I would interpret it this way: Func Moon_Phase($year, $month, $day, $hour, ByRef $ip) Local $j = Julian($year, $month, $day + $hour / 24.0) - 2444238.5 Local $ls = Sun_Position($j) Local $lm = Moon_Position($j, $ls) Local $t = $lm - $ls If ($t < 0) Then $t += 360 $ip = BitAND(Int(($t + 22.5) / 45), 0x7) Return (1.0 - Cos(($lm - $ls) * $fRad)) / 2 EndFunc ;==>Moon_Phase I also tried to translate it to AutoIt but I don't know what "->" means: now->day = c - e - g1; now->hour = (jd - jdi) * 24.0; if (g <= 13) now->month = g - 1; else now->month = g - 13; if (now->month > 2) now->year = d - 4716; else now->year = d - 4715;1 point
-
Skysnake, I would say not. If there is one simple condition to be met then I would use a Do...Until loop: Local $x = 1 Do ; do something ; If condition is met then $x = 0 ; --> exit the loop? Until $x = 0 In the OP's case I would not use the built-in Progress* functions at all - I would simplify the whole thing by using a custom marquee progressbar along with a Do...Until loop: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> Status() Func Status() $hGUI = GUICreate("Test", 500, 50) GUICtrlCreateProgress(10, 10, 480, 20, $PBS_MARQUEE) GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() Do Sleep(1000) Until ProcessExists("notepad.exe") GUIDelete($hGUI) MsgBox(0, "", "Testing completed!") EndFunc ;==>Status The marquee progress is designed for events when the timing is uncertain - and "45-60 minutes" certainly falls into that category! M231 point
-
LisHawj, You need to add an "ExitLoop 2" after closing the Progress, otherwise you just remain within the loops. M23 M231 point
-
howto determine mouse on gui with exLayer&transparency
guiltyking reacted to InunoTaishou for a topic
Double post, server lagged right after I pressed submit Edit: half an hour later, this seems like a good spot to put this #include <GuiConstantsEx.au3> #include <GUIConstants.au3> #include <WinAPISys.au3> #include <WinAPI.au3> Opt("GUIOnEventMode", 1) Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo" Global $hMouseHook = DllCallbackRegister("MouseHook", "long", "int;wparam;lparam") Global $hMod = Null Global $g_hHook = Null Global $_cGUI_Visible, $_nTimer, $nMX, $nMY, $_cDrag, $_cGUI_Collapsed = False Global $nGuiXLeft = 400, $nGuiYTop = 100, $nGui_Width = 400, $nGui_Height = 200, $RET = False Global $ParentWin_mn = 20, $_nBkColor_Shield = 0x000001, $_nBkColor_RayBan = 0xfff000 Global $tWindowPos = _WinAPI_CreateRect($nGuiXLeft, $nGuiYTop, $nGuiXLeft + $nGui_Width, $nGuiYTop + 40) #Region hGUI_OSKMenu Global $hGUI_OSKMenu = GUICreate("", $nGui_Width, $nGui_Height, $nGuiXLeft, $nGuiYTop, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) ;<===== since EX_LAYERED Global $_LGUI_OSK_logo = GUICtrlCreateLabel("AUTOIT ROCKS", 10, 0, 180, 20, -1, $GUI_WS_EX_PARENTDRAG) Global $_LGUI_OSK_Drag = GUICtrlCreateLabel("This is text on" & @CRLF & "a transparent Layered", 10, 0, 180, 40, -1, $GUI_WS_EX_PARENTDRAG) Global $idButton = GUICtrlCreateButton("Click Me!", 150, 135, 100, 30) GUICtrlSetOnEvent($idButton, "_BUTTON") WinSetTrans($hGUI_OSKMenu, "", 255) GUISetBkColor($_nBkColor_RayBan, $hGUI_OSKMenu) ;==>Set GUI Colour GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") ; Call a common GUI close function GUISetState(@SW_SHOW, $hGUI_OSKMenu) GUIRegisterMsg($WM_WINDOWPOSCHANGED, WM_WINDOWPOSCHANGED) $hMod = _WinAPI_GetModuleHandle(0) $g_hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hMouseHook), $hMod) While 1 WEnd Func _exit() _WinAPI_UnhookWindowsHookEx($g_hHook) DllCallbackFree($hMouseHook) Exit EndFunc ;==>_exit Func _BUTTON() MsgBox(64, "Button", "You clicked the button!", 3) EndFunc ;==>_BUTTON Func MouseHook($nCode, $wParam, $lParam) Local Static $bExpanded = True Local Static $tMouseInfo = Null Local $tKeyInfo = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If ($nCode < 0) Then $tKeyInfo = Null Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam) EndIf Switch ($wParam) Case $WM_MOUSEMOVE $tMouseInfo = DllStructCreate($MSLLHOOKSTRUCT, $lParam) $tMousePos = _WinAPI_CreatePoint(DllStructGetData($tMouseInfo, 1), DllStructGetData($tMouseInfo, 2)) If (Not $bExpanded and _WinAPI_PtInRect($tWindowPos, $tMousePos)) Then $bExpanded = True DllStructSetData($tWindowPos, 4, $nGuiYTop + $nGui_Height) WinMove($hGUI_OSKMenu, "", $nGuiXLeft, $nGuiYTop, $nGui_Width, $nGui_Height) WinSetTrans($hGUI_OSKMenu, "", 255) ElseIf ($bExpanded and Not _WinAPI_PtInRect($tWindowPos, $tMousePos)) Then $bExpanded = False DllStructSetData($tWindowPos, 4, $nGuiYTop + 40) WinMove($hGUI_OSKMenu, "", $nGuiXLeft, $nGuiYTop, $nGui_Width, 40) WinSetTrans($hGUI_OSKMenu, "", 150) EndIf $tMouseInfo = Null $tMousePos = Null EndSwitch Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam) EndFunc ;==>MouseHook Func WM_WINDOWPOSCHANGED($hWnd, $iMsg, $wParam, $lParam) Local $tNewWinPos = DllStructCreate($tagWINDOWPOS, $lParam) Local $iOldWidth = (DllStructGetData($tWindowPos, 4) - $nGuiYTop) $nGuiXLeft = DllStructGetData($tNewWinPos, "x") $nGuiYTop = DllStructGetData($tNewWinPos, "y") DllStructSetData($tWindowPos, 1, $nGuiXLeft) DllStructSetData($tWindowPos, 2, $nGuiYTop) DllStructSetData($tWindowPos, 3, $nGuiXLeft + $nGui_Width) DllStructSetData($tWindowPos, 4, $nGuiYTop + $iOldWidth) $tNewWinPos = Null Return $GUI_RUNDEFMSG EndFunc ;==>WM_WINDOWPOSCHANGED This works very well. Faster, cleaner, and pretty easy to follow. I'd opt to use just the $tWindowPos to keep track of the window's X and Y position and just get rid of $nGuiXLeft and $nGuiYTop all together, but I left them in there for this. Just don't put a sleep in your While loop, it causes the ouse to move very slowly and poorly (This is a hook after all ;)).1 point -
Thank you very much Jos. This is a x86/64 issue: I have compile same script in x86/64 x86: not working ....\Common not expected ... error x64: working1 point
-
So back to the basics: What is the exact command you type in the admin level CMD window ? Which directory is the workdir at that moment? What is the issue when you run the script? Try running it with /k in stead of /c to see if there is any error shown. Jos1 point
-
How to click img or span in frame
ChaitanyaK reacted to mLipok for a topic
You have not declared variable $Frame : Local $oFrame = _IEFrameGetObjByName($Page, "APPLICATION_FRM") _IEFormImageClick($Frame,"/light/images/claims.gif","src") here is modified testing script: ;~ https://www.autoitscript.com/forum/topic/182347-how-to-click-img-or-span-in-frame/#comment-1309506 #include <IE.au3> #include <MsgBoxConstants.au3> Global $__g_sLoginUrl = '' _Example() Func _Example() ;~ Local $oIE = _IECreate() ;~ _IEDocWriteHTML($oIE, ClipGet()) Local $oIE = _IECreate($__g_sLoginUrl) ConsoleWrite(@ScriptLineNumber & @CRLF) If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) Local $oFrames = _IEFrameGetCollection($oIE) Local $iNumFrames = @extended If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) If $iNumFrames Then If _IEIsFrameSet($oIE) Then If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) Local $oFrame = _IEFrameGetObjByName($oIE, "APPLICATION_FRM") If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) _IEFormImageClick($oFrame, "/light/images/claims.gif", "src") If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) EndIf If @error Then MsgBox($MB_ICONERROR, @ScriptLineNumber, '@error = ' & @error & @CRLF & '@extended = ' & @extended) ConsoleWrite(@ScriptLineNumber & @CRLF) EndIf EndFunc ;==>_Example1 point -
How to disable GUI button if no data or input box is empty?
LisHawj reacted to InunoTaishou for a topic
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 168, 148, 192, 124) Global $Input1 = GUICtrlCreateInput("ServiceTag", 24, 40, 121, 21) Global $Label1 = GUICtrlCreateLabel("Serial#", 24, 24, 37, 17) Global $Button1 = GUICtrlCreateButton("Start", 72, 112, 75, 25) Global $Input2 = GUICtrlCreateInput("Input2", 24, 88, 121, 21) Global $Label2 = GUICtrlCreateLabel("Asset#", 24, 72, 37, 17) GUICtrlSetState($Button1, $GUI_DISABLE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_COMMAND, WM_COMMAND) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Local $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word Local $iCode = BitShift($wParam, 16) ; Hi Word Switch ($hWnd) Case $Form1 Switch ($iIDFrom) Case $Input1 Switch ($iCode) Case $EN_CHANGE If (GUICtrlRead($iIDFrom) <> "ServiceTag") Then GUICtrlSetState($Button1, $GUI_ENABLE) Else GUICtrlSetState($Button1, $GUI_DISABLE) EndIf EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc1 point -
Yes "ABC"&@CRLF <> "ABC".1 point
-
CPU Multi-Processor Usage This is an example of getting and displaying processor usage for all processors in a system. It uses the 'undocumented' NtQuerySystemInformation function to gather processor usage information and then does calculations based on the delta of two readings. I wrote this as an alternative to using my >Performance Counters UDF - specifically, check out >Example # 4: System CPU Usage (by Processor). There is now a new interface, as well as two ways to track CPU usage. The first method tracks usage for all CPU's, and additionally produces an overall CPU usage result. The second method tracks Overall CPU usage - a combined value representing all cores as one unit. Note that this second method uses GetSystemTimes, which requires Windows XP SP1 or higher. The usage works like this for all CPU's: $aCPUsUsageTracker = _CPUsUsageTracker_Create() $iTotalCPUs = $aCPUsUsageTracker[0][0] ; Call the following repeatedly - $aCPUsUsageTracker will be updated automatically: $aPercents = _CPUsUsageTracker_GetUsage($aCPUsUsageTracker) For Overall CPU usage, either look at $aPercents[$iTotalCPUs] above, or use this interface (reliant on GetSystemTimes): $aCPUOverallTracker = _CPUOverallUsageTracker_Create() ; Call the following repeatedly - $aCPUOverallTracker will be updated automatically: $fUsage = _CPUOverallUsageTracker_GetUsage($aCPUOverallTracker) _ Need to see how CPU usage is affected? A simple tool I use to stress-test individual CPU cores is Stress Prime 2004, which can be run multiple times. P.S. All I ask is that you acknowledge me in some way if you use any of this code. updates: 2013-08-31: - Added a simple Overall and Idle CPU usage example 2013-06-18: - Changed interface for getting CPU usage. Now there's no need to juggle arrays around [obsolete version]: - fixed bound check in _CPUCalculateUsages() to look at 2nd dimension CPU_ProcessorUsage.au3 (prev downloads: ~15) ; ======================================================================================================== ; <CPU_ProcessorUsage.au3> ; ; Example of an alternative means to read individual CPU Usages for multiple CPUs, ; along with the combined overall CPU usage. (Alternative to Performance Counters) ; Readings are shown in a 'Splash' window ; ; Functions: ; _CPUGetTotalProcessorTimes() ; Gets Overall (combined CPUs) Processor Times ; _CPUGetIndividualProcessorTimes() ; Returns an array of CPU usage info for individual processors ; _CPUsUsageTracker_Create() ; Creates a CPU usage tracker for all CPUs ; _CPUsUsageTracker_GetUsage() ; Updates CPU usage tracker and returns a CPU usage array ; _CPUOverallUsageTracker_Create() ; Creates a CPU usage tracker for Overall CPU usage ; _CPUOverallUsageTracker_GetUsage(); Updates CPU usage tracker and returns CPU usage [Overall Usage] ; ; See also: ; Performance Counters UDF ; ; ; Author: Ascend4nt ; ======================================================================================================== ; -------------------- HOTKEY FUNCTION & VARIABLE -------------------- Global $bHotKeyPressed=False Func _EscPressed() $bHotKeyPressed=True EndFunc ; ============================================================================================== ; Func _CPUGetTotalProcessorTimes() ; ; Gets the total (combined CPUs) system processor times (as FILETIME) ; Note that Kernel Mode time includes Idle Mode time, so a proper calculation of usage time is ; Kernel + User - Idle ; And percentage (based on two readings): ; (Kernel_b - Kernel_a) + (User_b - User_a) - (Idle_b - Idle_a) * 100 ; / (Kernel_b - Kernal_a) + (User_b - User_a) ; ; O/S Requirements: min. Windows XP SP1+ ; ; Returns: ; Success: Array of info for total (combined CPU's) processor times: ; [0] = Idle Mode Time ; [1] = Kernel Mode Time -> NOTE This INCLUDES Idle Time ; [2] = User Mode Time ; ; Failure: "" with @error set: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUGetTotalProcessorTimes() Local $aRet, $stSystemTimes $stSystemTimes = DllStructCreate("int64 IdleTime;int64 KernelTime;int64 UserTime;") $aRet = DllCall("kernel32.dll", "bool", "GetSystemTimes", "ptr", DllStructGetPtr($stSystemTimes, 1), _ "ptr", DllStructGetPtr($stSystemTimes, 2), "ptr", DllStructGetPtr($stSystemTimes, 3) ) If @error Then Return SetError(2, @error, "") If Not $aRet[0] Then Return SetError(3, 0, "") Dim $aRet[3] = [ _ DllStructGetData($stSystemTimes, 1), _ DllStructGetData($stSystemTimes, 2), _ DllStructGetData($stSystemTimes, 3) ] Return $aRet EndFunc ; ============================================================================================== ; Func _CPUGetIndividualProcessorTimes() ; ; Gets an array of system processor times (as FILETIME) ; Note that Kernel Mode time includes Idle Mode time, so a proper calculation of usage time is ; Kernel + User - Idle ; And percentage (based on two readings): ; (Kernel_b - Kernel_a) + (User_b - User_a) - (Idle_b - Idle_a) * 100 ; / (Kernel_b - Kernal_a) + (User_b - User_a) ; ; Returns: ; Success: 2 Dimensional Array of info [@extended = #of CPU's]: ; [0][0] = # of CPUs (and array elements) ; [1..n][0] = Idle Mode Time for CPU # n ; [1..n][1] = Kernel Mode Time for CPU # n -> NOTE This INCLUDES Idle Time ; [1..n][2] = User Mode Time for CPU # n ; ; Failure: "" with @error set: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: NTSTATUS returned error code, @extended contains error code ; @error = 4: Invalid length returned, @extended is length ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUGetIndividualProcessorTimes() ; DPC = Deferred Procedure Calls Local $tagSYSTEM_PROCESSOR_TIMES = "int64 IdleTime;int64 KernelTime;int64 UserTime;int64 DpcTime;int64 InterruptTime;ulong InterruptCount;" Local $aRet, $stProcessorTimes, $stBuffer Local $i, $nTotalCPUStructs, $pStructPtr ; 256 [maximum CPU's] * 48 (structure size) = 12288 $stBuffer = DllStructCreate("byte Buffer[12288];") ; SystemProcessorTimes = 8 Local $aRet=DllCall("ntdll.dll", "long", "NtQuerySystemInformation", "int", 8, "ptr", DllStructGetPtr($stBuffer), "ulong", 12288, "ulong*", 0) If @error Then Return SetError(2, @error, "") ; NTSTATUS of something OTHER than success? If $aRet[0] Then Return SetError(3, $aRet[0], "") ; Length invalid? If $aRet[4] = 0 Or $aRet[0] > 12288 Or Mod($aRet[4], 48) <> 0 Then Return SetError(4, $aRet[4], "") $nTotalCPUStructs = $aRet[4] / 48 ;~ ConsoleWrite("Returned buffer length = " & $aRet[4] & ", len/48 (struct size) = "& $nTotalCPUStructs & @CRLF) ; We are interested in Idle, Kernel, and User Times (3) Dim $aRet[$nTotalCPUStructs + 1][3] $aRet[0][0] = $nTotalCPUStructs ; Traversal Pointer for individual CPU structs $pStructPtr = DllStructGetPtr($stBuffer) For $i = 1 To $nTotalCPUStructs $stProcessorTimes = DllStructCreate($tagSYSTEM_PROCESSOR_TIMES, $pStructPtr) $aRet[$i][0] = DllStructGetData($stProcessorTimes, "IdleTime") $aRet[$i][1] = DllStructGetData($stProcessorTimes, "KernelTime") $aRet[$i][2] = DllStructGetData($stProcessorTimes, "UserTime") ; Next CPU structure $pStructPtr += 48 Next Return SetExtended($nTotalCPUStructs, $aRet) EndFunc ; ============================================================================================== ; Func _CPUsUsageTracker_Create() ; ; Creates a CPU usage tracker array for all processors. This array should be passed ; to _CPUsUsageTracker_GetUsage() to get current usage information back. ; ; Returns: ; Success: An array used to track CPU usage [@extended = # of CPU's] ; Array 'internal' format: ; $arr[0][0] = # of CPU's ; $arr[1..n][0] = Total CPU Time (Kernel + User Mode) ; $arr[1..n][1] = Total Active CPU Time (Kernel + User - Idle) ; ; Failure: "" with @error set [reflects _CPUGetIndividualProcessorTimes codes]: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: NTSTATUS returned error code, @extended contains error code ; @error = 4: Invalid length returned, @extended is length ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUsUsageTracker_Create() Local $nTotalCPUs, $aCPUTimes, $aCPUsUsage $aCPUTimes = _CPUGetIndividualProcessorTimes() If @error Then Return SetError(@error, @extended, "") $nTotalCPUs = @extended Dim $aCPUsUsage[$nTotalCPUs + 1][2] $aCPUsUsage[0][0] = $nTotalCPUs For $i = 1 To $nTotalCPUs ; Total $aCPUsUsage[$i][0] = $aCPUTimes[$i][1] + $aCPUTimes[$i][2] ; TotalActive (Kernel Time includes Idle time, so we need to subtract that) $aCPUsUsage[$i][1] = $aCPUTimes[$i][1] + $aCPUTimes[$i][2] - $aCPUTimes[$i][0] Next Return SetExtended($nTotalCPUs, $aCPUsUsage) EndFunc ; ============================================================================================== ; Func _CPUOverallUsageTracker_Create() ; ; Creates a CPU usage tracker array for Overall combined processors usage. ; This array should be passed to _CPUOverallUsageTracker_GetUsage() to get ; current usage information. ; ; Returns: ; Success: An array used to track Overall CPU usage ; Array 'internal' format: ; $arr[0] = Total Overall CPU Time (Kernel + User Mode) ; $arr[1] = Total Active Overall CPU Time (Kernel + User - Idle) ; ; Failure: "" with @error set [reflects _CPUGetTotalProcessorTimes codes]: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUOverallUsageTracker_Create() Local $aCPUTimes, $aCPUsUsage[2] $aCPUTimes = _CPUGetTotalProcessorTimes() If @error Then Return SetError(@error, @extended, "") ; Total $aCPUsUsage[0] = $aCPUTimes[1] + $aCPUTimes[2] ; TotalActive (Kernel Time includes Idle time, so we need to subtract that) $aCPUsUsage[1] = $aCPUTimes[1] + $aCPUTimes[2] - $aCPUTimes[0] Return $aCPUsUsage EndFunc ; ============================================================================================== ; Func _CPUsUsageTracker_GetUsage(ByRef $aCPUsUsage) ; ; Updates a CPUsUsage array and returns an array of CPU Usage information for all processors. ; ; Returns: ; Success: Array of CPU Usage -> 1 for each processor + 1 for Overall [@extended = # of processors] ; [0..n] = CPU Usage (Percentage) ; [#CPUs] = CPUs Overall Usage (Percentage) ; Failure: "" with @error set to 1 for invalid parameters, or: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: NTSTATUS returned error code, @extended contains error code ; @error = 4: Invalid length returned, @extended is length ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUsUsageTracker_GetUsage(ByRef $aCPUsUsage) If Not IsArray($aCPUsUsage) Or UBound($aCPUsUsage, 2) < 2 Then Return SetError(1, 0, "") Local $nTotalCPUs, $aUsage, $aCPUsCurInfo Local $nTotalActive, $nTotal Local $nOverallActive, $nOverallTotal $aCPUsCurInfo = _CPUsUsageTracker_Create() If @error Then Return SetError(@error, @extended, "") $nTotalCPUs = $aCPUsCurInfo[0][0] Dim $aUsage[$nTotalCPUs + 1] $nOverallActive = 0 $nOverallTotal = 0 For $i = 1 To $nTotalCPUs $nTotal = $aCPUsCurInfo[$i][0] - $aCPUsUsage[$i][0] $nTotalActive = $aCPUsCurInfo[$i][1] - $aCPUsUsage[$i][1] $aUsage[$i - 1] = Round($nTotalActive * 100 / $nTotal, 1) $nOverallActive += $nTotalActive $nOverallTotal += $nTotal Next $aUsage[$nTotalCPUs] = Round( ($nOverallActive / $nTotalCPUs) * 100 / ($nOverallTotal / $nTotalCPUs), 1) ; Replace current usage tracker info $aCPUsUsage = $aCPUsCurInfo Return SetExtended($nTotalCPUs, $aUsage) EndFunc ; ============================================================================================== ; Func _CPUOverallUsageTracker_GetUsage(ByRef $aCPUsUsage) ; ; Updates a CPUsUsage array and returns CPU Usage information [Overall processor usage] ; ; Returns: ; Success: CPU Usage (Percentage) ; Failure: 0 with @error set to 1 for invalid parameters, or: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUOverallUsageTracker_GetUsage(ByRef $aCPUsUsage) If Not IsArray($aCPUsUsage) Or UBound($aCPUsUsage) < 2 Then Return SetError(1, 0, "") Local $aCPUsCurInfo, $fUsage, $nTotalActive, $nTotal $aCPUsCurInfo = _CPUOverallUsageTracker_Create() If @error Then Return SetError(@error, @extended, 0) $nTotal = $aCPUsCurInfo[0] - $aCPUsUsage[0] $nTotalActive = $aCPUsCurInfo[1] - $aCPUsUsage[1] ; Replace current usage tracker info $aCPUsUsage = $aCPUsCurInfo Return Round($nTotalActive * 100 / $nTotal, 1) EndFunc ; -------------------- MAIN PROGRAM CODE -------------------- HotKeySet("{Esc}", "_EscPressed") Local $hSplash, $sSplashText ; CPU Usage for all CPU's Local $iTotalCPUs, $aCPUsUsageTracker, $aPercents ; Overall CPU Usage Tracker ; (GetSystemTimes) ;~ Local $aCPUOverallTracker ; CPUs Usage Tracker $aCPUsUsageTracker = _CPUsUsageTracker_Create() If @error Then Exit ConsoleWrite("Error calling _CPUsUsageTracker_Create():" & @error & ", @extended = " & @extended & @CRLF) ; Overall CPU Usage tracker ;~ $aCPUOverallTracker = _CPUOverallUsageTracker_Create() ;~ If @error Then Exit ConsoleWrite("Error calling _CPUOverallUsageTracker_Create():" & @error & ", @extended = " & @extended & @CRLF) $iTotalCPUs = $aCPUsUsageTracker[0][0] ConsoleWrite("Total # CPU's: " & $iTotalCPUs & @CRLF) Sleep(250) $hSplash=SplashTextOn("CPU Usage Information [" & $iTotalCPUs & " total CPU's]", "", _ 240, 20 + ($iTotalCPUs + 1) * 35, Default, Default, 16, Default, 12) ; Start loop Do $aPercents = _CPUsUsageTracker_GetUsage($aCPUsUsageTracker) $sSplashText="" For $i=0 To $iTotalCPUs - 1 $sSplashText &= "CPU #"& $i+1 & ": " & $aPercents[$i] & " %" & @CRLF Next $sSplashText &= @CRLF &"[Overall CPU Usage] :" & $aPercents[$iTotalCPUs] & " %" & @CRLF ; Alternative, if all we wanted was Overall CPU Usage: ;~ $sSplashText &= @CRLF &"[Overall CPU Usage] :" & _CPUOverallUsageTracker_GetUsage($aCPUOverallTracker) & " %" & @CRLF $sSplashText &= @CRLF & "[Esc] exits" ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until $bHotKeyPressed _ Overall CPU Usage (and Idle calculation) example: ; ======================================================================================================== ; <CPU_ProcessorUsageOverall.au3> ; ; Example of reading combined overall CPU usage and deducing Idle CPU usage as well ; Readings are shown in a 'Splash' window ; ; Functions: ; _CPUGetTotalProcessorTimes() ; Gets Overall (combined CPUs) Processor Times ; _CPUOverallUsageTracker_Create() ; Creates a CPU usage tracker for Overall CPU usage ; _CPUOverallUsageTracker_GetUsage(); Updates CPU usage tracker and returns CPU usage [Overall Usage] ; ; External Functions: ; _CPUGetIndividualProcessorTimes() ; Returns an array of CPU usage info for individual processors ; _CPUsUsageTracker_Create() ; Creates a CPU usage tracker for all CPUs ; _CPUsUsageTracker_GetUsage() ; Updates CPU usage tracker and returns a CPU usage array ; ; See also: ; <CPU_ProcessorUsage.au3> ; Individual CPU processor usage example ; Performance Counters UDF ; ; ; Author: Ascend4nt ; ======================================================================================================== ; --- UDF's --- ; ============================================================================================== ; Func _CPUGetTotalProcessorTimes() ; ; Gets the total (combined CPUs) system processor times (as FILETIME) ; Note that Kernel Mode time includes Idle Mode time, so a proper calculation of usage time is ; Kernel + User - Idle ; And percentage (based on two readings): ; (Kernel_b - Kernel_a) + (User_b - User_a) - (Idle_b - Idle_a) * 100 ; / (Kernel_b - Kernal_a) + (User_b - User_a) ; ; O/S Requirements: min. Windows XP SP1+ ; ; Returns: ; Success: Array of info for total (combined CPU's) processor times: ; [0] = Idle Mode Time ; [1] = Kernel Mode Time -> NOTE This INCLUDES Idle Time ; [2] = User Mode Time ; ; Failure: "" with @error set: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUGetTotalProcessorTimes() Local $aRet, $aTimes $aRet = DllCall("kernel32.dll", "bool", "GetSystemTimes", "uint64*", 0, "uint64*", 0, "uint64*", 0) If @error Then Return SetError(2, @error, "") If Not $aRet[0] Then Return SetError(3, 0, "") Dim $aTimes[3] = [ $aRet[1], $aRet[2], $aRet[3] ] Return $aTimes EndFunc ; ============================================================================================== ; Func _CPUOverallUsageTracker_Create() ; ; Creates a CPU usage tracker array for Overall combined processors usage. ; This array should be passed to _CPUOverallUsageTracker_GetUsage() to get ; current usage information. ; ; Returns: ; Success: An array used to track Overall CPU usage ; Array 'internal' format: ; $arr[0] = Total Overall CPU Time (Kernel + User Mode) ; $arr[1] = Total Active Overall CPU Time (Kernel + User - Idle) ; ; Failure: "" with @error set [reflects _CPUGetTotalProcessorTimes codes]: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUOverallUsageTracker_Create() Local $aCPUTimes, $aCPUsUsage[2] $aCPUTimes = _CPUGetTotalProcessorTimes() If @error Then Return SetError(@error, @extended, "") ; Total $aCPUsUsage[0] = $aCPUTimes[1] + $aCPUTimes[2] ; TotalActive (Kernel Time includes Idle time, so we need to subtract that) $aCPUsUsage[1] = $aCPUTimes[1] + $aCPUTimes[2] - $aCPUTimes[0] Return $aCPUsUsage EndFunc ; ============================================================================================== ; Func _CPUOverallUsageTracker_GetUsage(ByRef $aCPUsUsage) ; ; Updates a CPUsUsage array and returns CPU Usage information [Overall processor usage] ; ; Returns: ; Success: CPU Usage (Percentage) ; Failure: 0 with @error set to 1 for invalid parameters, or: ; @error = 2: DLLCall error, @extended = error returned from DLLCall ; @error = 3: API call returned False - call GetLastError for more info ; ; Author: Ascend4nt ; ============================================================================================== Func _CPUOverallUsageTracker_GetUsage(ByRef $aCPUsUsage) If Not IsArray($aCPUsUsage) Or UBound($aCPUsUsage) < 2 Then Return SetError(1, 0, "") Local $aCPUsCurInfo, $fUsage, $nTotalActive, $nTotal $aCPUsCurInfo = _CPUOverallUsageTracker_Create() If @error Then Return SetError(@error, @extended, 0) $nTotal = $aCPUsCurInfo[0] - $aCPUsUsage[0] $nTotalActive = $aCPUsCurInfo[1] - $aCPUsUsage[1] ; Replace current usage tracker info $aCPUsUsage = $aCPUsCurInfo Return Round($nTotalActive * 100 / $nTotal, 1) EndFunc ; -------------------- HOTKEY FUNCTION & VARIABLE -------------------- Global $bHotKeyPressed=False Func _EscPressed() $bHotKeyPressed=True EndFunc ; -------------------- MAIN PROGRAM CODE -------------------- HotKeySet("{Esc}", "_EscPressed") Local $hSplash, $sSplashText ; Overall CPU Usage Tracker ; (GetSystemTimes) Local $aCPUOverallTracker, $fPercent ; Overall CPU Usage tracker $aCPUOverallTracker = _CPUOverallUsageTracker_Create() If @error Then Exit ConsoleWrite("Error calling _CPUOverallUsageTracker_Create():" & @error & ", @extended = " & @extended & @CRLF) Sleep(250) $hSplash=SplashTextOn("CPU [Overall] Usage Information", "", _ 240, 100, Default, Default, 16, Default, 12) ; Start loop Do $fPercent = _CPUOverallUsageTracker_GetUsage($aCPUOverallTracker) $sSplashText="" $sSplashText &= "[Overall CPU Usage] :" & $fPercent & " %" & @CRLF $sSplashText &= "[Idle] : " & (100 - $fPercent) & " %" & @CRLF $sSplashText &= @CRLF & "[Esc] exits" ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until $bHotKeyPressed CPU_ProcessorUsageOverall.au31 point
-
Here's the self-contained function to hide Systray icons properly. Tested on XP and Win7, you can compile it as x86 and it still should work on x64 systems too (well, at least it works for me ). Wraithdu's excellent is required for the identification & enumeration part. Example will hide all Systray icons, sleep 3 seconds and show them all again... test on your own risk ... #include <_SysTray.au3> #include <Process.au3> Local $count = _SysTrayIconCount() For $i = $count - 1 To 0 Step -1 $handle = _SysTrayIconHandle($i) $pid = WinGetProcess($handle) $name = _ProcessGetName($pid) _SysTray_HideIcon($i, 1) Next Sleep(3000) For $i = $count - 1 To 0 Step -1 $handle = _SysTrayIconHandle($i) $pid = WinGetProcess($handle) $name = _ProcessGetName($pid) _SysTray_HideIcon($i, 0) Next Func _SysTray_HideIcon($iID, $iHide = 0) Local $aRet Local Const $MEM_COMMIT = 0x00001000 Local Const $MEM_RESERVE = 0x00002000 Local Const $MEM_RELEASE = 0x00008000 Local Const $PAGE_READWRITE = 0x4 Local Const $TB_GETBUTTON = 0x0417 Local $_hTrayWnd = WinGetHandle("[CLASS:Shell_TrayWnd]") Local $_hTrayNotifyWnd = ControlGetHandle($_hTrayWnd, "", "[CLASS:TrayNotifyWnd]") Local $_hSysPager = ControlGetHandle($_hTrayNotifyWnd, "", "[CLASS:SysPager]") Local $_hToolbar = ControlGetHandle($_hSysPager, "", "[CLASS:ToolbarWindow32; INSTANCE:1]") ; User Promoted Notification Area/Notification Area/SysTray Local $hWnd = DllCall("user32.dll", "hwnd", "FindWindow", "str", "NotifyIconOverflowWindow", "ptr", 0) Local $_hWnd_NotifyIconOverflowWindow = DllCall("user32.dll", "hwnd", "FindWindowEx", "hwnd", $hWnd[0], "hwnd", 0, "str", "ToolbarWindow32", "ptr", 0) Local $_GetIcon_tTBBUTTON If @OSArch = "X86" Then $_GetIcon_tTBBUTTON = DllStructCreate("int iBitmap;int idCommand;byte fsState;byte fsStyle;byte bReserved[2];dword_ptr dwData;int_ptr iString") Else ; X64 $_GetIcon_tTBBUTTON = DllStructCreate("int iBitmap;int idCommand;byte fsState;byte fsStyle;byte bReserved[6];dword_ptr dwData;int_ptr iString") EndIf Local $_GetIcon_pTBBUTTON = DllStructGetPtr($_GetIcon_tTBBUTTON) Local $_GetIcon_iTBBUTTON = DllStructGetSize($_GetIcon_tTBBUTTON) Local $_GetIcon_tTRAYDATA If @OSArch = "X86" Then $_GetIcon_tTRAYDATA = DllStructCreate("hwnd hwnd;uint uID;uint uCallbackMessage;dword Reserved[2];hwnd hIcon") Else $_GetIcon_tTRAYDATA = DllStructCreate("int64 hwnd;uint uID;uint uCallbackMessage;dword Reserved[2];int64 hIcon") EndIf Local $_GetIcon_pTRAYDATA = DllStructGetPtr($_GetIcon_tTRAYDATA) Local $_GetIcon_iTRAYDATA = DllStructGetSize($_GetIcon_tTRAYDATA) Local $iPIDExp = WinGetProcess($_hToolbar) If @error Or $iPIDExp = -1 Then Exit 33 $aRet = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", BitOR(0x0008, 0x0010, 0x0400), "int", 0, "int", $iPIDExp) If @error Or $aRet[0] = 0 Then Exit Local $_hProcess = $aRet[0] $aRet = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "ptr", $_hProcess, "ptr", 0, "ulong_ptr", $_GetIcon_iTBBUTTON, "dword", BitOR($MEM_RESERVE, $MEM_COMMIT), "dword", $PAGE_READWRITE) If @error Or $aRet[0] = 0 Then DllCall("kernel32.dll", "int", "CloseHandle", "ptr", $_hProcess) Exit 34 & $aRet[0] EndIf $_GetIcon_pAddress = $aRet[0] If IsHWnd($_hToolbar) = False Then Return -1 $aRet = DllCall("user32.dll", "lparam", "SendMessageW", "hwnd", $_hToolbar, "int", $TB_GETBUTTON, "wparam", $iID, "lparam", $_GetIcon_pAddress) If @error Or $aRet[0] <> 1 Then Return -1 $aRet = DllCall("kernel32.dll", "int", "ReadProcessMemory", "ptr", $_hProcess, "ptr", $_GetIcon_pAddress, "ptr", $_GetIcon_pTBBUTTON, "ulong", $_GetIcon_iTBBUTTON, "ulong*", -1) If @error Or $aRet[5] <> $_GetIcon_iTBBUTTON Then Return -1 $aRet = DllCall("kernel32.dll", "int", "ReadProcessMemory", "ptr", $_hProcess, "ptr", Ptr(DllStructGetData($_GetIcon_tTBBUTTON, 6)), "ptr", $_GetIcon_pTRAYDATA, "ulong", $_GetIcon_iTRAYDATA, "ulong*", -1) If @error Or $aRet[5] <> $_GetIcon_iTRAYDATA Then Return -1 $_hOwnerWin = HWnd(DllStructGetData($_GetIcon_tTRAYDATA, 1)) If @error Or $_hOwnerWin = 0 Then Return -1 Local $iPID = WinGetProcess($_hOwnerWin) If @error Or $iPID = -1 Then Return -1 Local $tNOTIFYICONDATA = DllStructCreate("dword;hwnd;uint;uint;uint;ptr;wchar[128];dword;dword;wchar[256];uint;wchar[64];dword;int;short;short;byte[8];ptr") Local $pNOTIFYICONDATA = DllStructGetPtr($tNOTIFYICONDATA) DllStructSetData($tNOTIFYICONDATA, 1, DllStructGetSize($tNOTIFYICONDATA)) DllStructSetData($tNOTIFYICONDATA, 2, $_hOwnerWin) DllStructSetData($tNOTIFYICONDATA, 3, DllStructGetData($_GetIcon_tTRAYDATA, 2)) DllStructSetData($tNOTIFYICONDATA, 4, 0x8) ; NIF_STATE (0x00000008) If $iHide Then DllStructSetData($tNOTIFYICONDATA, 8, 0x1) ; dwState = NIS_HIDDEN (0x00000001) Else DllStructSetData($tNOTIFYICONDATA, 8, 0x0) EndIf DllStructSetData($tNOTIFYICONDATA, 9, 0x1) ; dwStateMask $aRet = DllCall("user32.dll", "int", "SendMessageW", "hwnd", $_hToolbar, "uint", 1028, "wparam", DllStructGetData($_GetIcon_tTBBUTTON, 2), "lparam", $iHide) $aRet = DllCall("shell32.dll", "int", "Shell_NotifyIconW", "dword", 0x1, "ptr", $pNOTIFYICONDATA) ; NIM_MODIFY (0x00000001) If Not IsHWnd($_hWnd_NotifyIconOverflowWindow) Then DllCall("user32.dll", "int", "SendMessageW", "hwnd", $_hTrayWnd, "uint", 0x001A, "wparam", 0, "lparam", 0) ; WM_SETTINGCHANGE 0x001A ; for Update on XP DllCall("kernel32.dll", "int", "VirtualFreeEx", "ptr", $_hProcess, "ptr", $_GetIcon_pAddress, "ulong_ptr", 0, "dword", $MEM_RELEASE) DllCall("kernel32.dll", "int", "CloseHandle", "ptr", $_hProcess) EndFunc ;==>_SysTray_HideIcon1 point
-
WELCOME To TheSaint's TOOLBOX DOWNLOAD SECTIONS can be reached quickly - scroll up from HERE (Post #2). However, if this is your first visit, then please pagedown past the News section below, and read the Disclaimer, Download Info, etc first. There are four titled download sections, in the following order - 1) AutoIt Tools, 2) Other Tools, 3) Utilities, 4) Games. Each section is arranged alphabetically by program name. ** Programs marked like this are in my new smaller package format. If you want to install them easily, with shortcuts, uninstall ability, etc then you will need to use my 'Universal Installer' program (now also available). However, they are only regular zip files that just contain an additional instruction file for that program. This new package format, is a new option in my 'Installer Creator v2.5' program (just updated). See latest NEWS. +============================================================+ || - MY IMPORTANT TOOLBOX ANNOUNCEMENTS & LATEST NEWS SECTION - || +============================================================+ * #104 #101 #100 #84 #81 #80 #78 #77 #76 #75 #74 #73 #72 #71 #70 #58 #57 #56 #55 #54 #53 #52 #49 #48 #47 #46 #45 #44 #43 #42 #41 #32 #31 #30 #29 #28 #27 #26 #24 #21 #20 #19 #18 #17 #16 #15 #14 #13 #9 #8 #7 * Above is my posts in order from latest to first (Latest are also in bold red below) The news index below, is only for those seeking further program information. +============================================================+ || Abbreviation Database - #72 #81 +===============================================+ || Admin File Management - #7 #71 +===============================================+ || Admin Rights - #7 #71 +===============================================+ || AutoIt Version Switcher - #17 #18 #32 #74 +===============================================+ || AVGBackup New - #73 +===============================================+ || AVGBackup Updater - #73 +===============================================+ || CDIni Database - #47 #77 #78 #84 +===============================================+ || Context Options - #13 +===============================================+ || Create Zip Within - #42 +===============================================+ || Declare All Variables - #16 #20 +===============================================+ || Dialog Maker - #9 +===============================================+ || DiscTray Control - #53 +===============================================+ || Folder From File - #27 +===============================================+ || Get CDPlayer Ini - #54 +===============================================+ || GUI Control Styler - #44 #45 #56 +===============================================+ || GUIBuilder - #74 +===============================================+ || Icon Browser - #13 #75 +===============================================+ || Installer Creator - #19 #21 #26 #45 #55 #75 #76 #101 +===============================================+ || Make It Pretty - #28 +===============================================+ || Msgbox Viewer - #8 +===============================================+ || Name Fix - #48 +===============================================+ || New Folders - #13 #24 #27 #48 +===============================================+ || Open Projects - #14 #41 #80 +===============================================+ || Path Duplicator - #45 +===============================================+ || Projects Backup - #8 #29 +===============================================+ || RGBColor Selector - #52 +===============================================+ || Search Assistant - #30 #43 +===============================================+ || SendTo Organiser - #27 +===============================================+ || SetAs Wallpaper - #80 #104 +===============================================+ || Shortcuts For All - #7 +===============================================+ || Shutdown Options - #48 +===============================================+ || Simple CDPlayer - #78 +===============================================+ || Tall Tales - #49 #57 #58 #70 +===============================================+ || Time Calculator - #45 +===============================================+ || Toolbar For Any - #15 +===============================================+ || Universal Installer - #45 #55 +===============================================+ || Update SciTE Values - #46 +===============================================+ || NEWS - #31 #55 #75 #100 +===============================================+ If you wish to discuss any of my programs in detail, and they have a separate Info (Topic) page, then please do that there. However, any generic comments, thanks, etc are welcome here. For various reasons, I've deemed it wiser to collect (Index) all my programs at this post - the simplest reason to give, is that most of my instructions, explanations, etc are pretty much identical, and so placing all that in one spot saves space - if I couple that with a date, then you can maybe jump to what you want and ignore my long ramble (if up-to-date with my latest info). Please don't pester me about some of the source code, read the NOTICE below and it will all be explained! PLEASE BE PATIENT, STILL UPDATING! You will eventually find all my AutoIt tools here and a link to their main pages (separate posts) for information about them and comments others and myself have made. DISCLAIMER! (last updated 16-09-2008) NOTICE! For the moment, I'm not including source code for any of my new programs that haven't been available at the Forum before. This is only an interim thing and done for a couple of reasons - 1) I want others to have a really good go at my programs, before others start modifying or incorporating them into their own and posting them (less feedback when that happens). 2) I really really want some feedback (as I've said above in the disclaimer). 3) With appropriate feedback, I can make changes that benefit all ... and maybe even discover some embarassments that I can remove ... before you get to see me naked (so to speak). I DO INTEND TO SUPPLY THE SOURCE CODE FOR ALL MY TOOLS - the more feedback (especially) I get and the more downloads, will make that sooner rather than later! NOTE! Some of the programs below are frontends only for a program made by someone else. DOWNLOAD & FILE INFORMATION * More information about my Installer and extracting can now be found here * Some of the Info links also lead to a download. (15-12-2008) ENJOY! 1. AUTOIT TOOLS Autoit Version Switcher v1.5 ** (updated 09-02-2009) AutoIt_Version_Switcher_Link.txt (197 kb) (Number of previous downloads: 80 odd + 85) Info (see Post #17 below) *(fixed) 9-10-2008 (see Post #18 #32 #74) Compile Options Info (also see ) Declare All Variables v1.2 Declare_All_Variables_Link.txt (0.99 Mb) (My latest program) (Number of previous downloads: 16) Info (also see Post #16 below) *(fixed) 12-10-2008 (see Post #20 below) Dialog Maker v1.8 Dialog_Maker_Link.txt (800 kb) Info (see Post #9 below) GuiBuilder v0.8 (my update to Cyberslug's program) ** (updated 09-02-2009) GuiBuilder_Link.txt (223 kb) (Support for newer AutoIt versions) (Number of previous downloads: 18) Info (For IMPORTANT Information see #74) GUI Control Styler v1.1 ** GUI_Control_Styler_Link.txt (220 kb) (Number of previous downloads: 30) Info (see Post #44 and #45 #56) (includes Screenshots) *(updated 22-12-2008) Icon Browser v1.2 Icon_Browser_Link.txt (902 kb) (Number of previous downloads: 208 + 168) (my update of the AutoIt example) Info (also see Post #13 #75) Installer Creator v2.7 ** (updated) 18-07-2009 Installer Creator Link.txt (454 kb) (Support for newer AutoIt versions) (Number of previous downloads: 323 + 203 + 221) See it's >own topic for latest update. Info (also see Post #19 and #21 and #45 #55 #75 #76 #101) Make It Pretty v1.5 Make_It_Pretty_Link.txt (891 kb) Info (also see Post #28 below) Msgbox Viewer v1.5 Msgbox_Viewer_Link.txt (855 kb) (Number of previous downloads: 286) Info (also see Post #8 below) Open Projects v1.8 ** (updated) 26-02-2009 Open_Projects_Link.txt (218 kb) (Number of previous downloads: 42 + 58) (Frontend for TrueCrypt drives for AutoIt project security) Info (see Post #14 below) (also Post #41 #80) Projects Backup v6.9 Projects_Backup_Link.txt (867 kb) (Number of previous downloads: 210 + 209 + 48) Info (also see Post #8 below) *(fixed) 22-10-2008 (see Post #29 below) RGBColor Selector v2.1 ** (added 20-12-2008) RGBColor_Selector_Link.txt (136 kb) (Number of previous downloads: 260 + 248) Info (also Info) (also see Post #52) Script Templates Info ToolBar For Any v2.2 ToolBar_For_Any_Link.txt (890 kb) Info (also see Post #15 below) Universal Installer v1.0 * (updated 16-12-2008) Universal_Installer_Link.txt (871 kb) (Number of previous downloads: 13) Info (also see Post #45 & #48 #55) Update SciTE Values v1.3 ** Update_SciTE_Values_Link.txt (216 kb) Info (see Post #46) (includes Screenshot) 2. OTHER TOOLS Admin File Management v1.1 (repackaged 23-01-2009) ** Admin_File_Management_Link.txt (198 kb) (Number of previous downloads: 562 + 175) Info (also see Post #7 below & #71) Admin Rights v4.3 (repackaged 23-01-2009) ** Admin_Rights_Link.txt (192 kb) (Number of previous downloads: 289 + 354 + 198) Info (also see Post #7 below & #71) Case Toggle Info (also see ) Change Case Info (also see ) Clipboard Joiner Info (also see ) Context Options v2.7 Context_Options_Link.txt (797 kb) (Number of previous downloads: 251) Info (also see Post #13 below) Create Zip Within v1.0 Create_Zip_Within_Link.txt (802 kb) Info (see Post #42 below) Date Shortcuts Info (also see ) Folder From File v1.6 Folder_From_File_Link.txt (894 kb) Info (see Post #27 below) Get Directory Listing Info (also see ) Name Fix v2.3 ** Name_Fix_Link.txt (199 kb) Info (see Post #48) (includes Screenshot) New Folders v3.6 ** (updated 16-12-2008) New_Folders_Link.txt (248 kb) (Number of previous downloads: 193 + 31 + 79) Info (also see Post #13 and #24 & #48) Path Duplicator v1.1 ** Path_Duplicator_Link.txt (214 kb) Info (see Post #45) (includes Screenshot) SendTo Organiser v1.2 SendTo_Organiser_Link.txt (880 kb) Info (see Post #27 below) Shortcuts For All v2.1 Shortcuts_For_All_Link.txt (789 kb) (Number of previous downloads: 303) Info (also see Post #7 below) StartUp Runner Info (also see ) TextFiles Joiner Info (also see ) Time Calculator v1.5 ** Time_Calculator_Link.txt (123 kb) (Number of previous downloads: 268 + 79) Info (also see Post #45) (includes Screenshot) Virtual Drive Info (also see ) 3. UTILITIES Abbreviation Database v2.9 (updated 04-03-2009) ** Abbreviation_Database_Link.txt (257 kb) (Number of previous downloads: 22) Info (see #72 #81) (includes Screenshots) Alert Timer Info (also see ) Author Updates & Database Viewer Info (also see ) AutoRunner Info (also see ) AVGBackup New v1.3 (new 27-01-2009) ** AVGBackup_New_Link.txt (193 kb) Info (important you read Post #73) AVGBackup Updater v1.4 (new 27-01-2009) ** AVGBackup_Updater_Link.txt (191 kb) Info (important you read Post #73) Camera Transfer Info (also see ) CDIni Database v3.6 (updated 09-03-2009) ** CDIni_Database_Link.txt (347 kb) (Number of previous downloads: 5 + 26 + 5 + 7) (New Features, Bugfixes, etc) Info (also see Post #47 & #48 #77 #78 #84) DiscTray Control v3.2 ** DiscTray_Control_Link.txt (212 kb) Info (also see Post #53) DvdA2Wav Info (also see ) Encrypted Text Reader Info (also see ) Enter Serial Info (also see ) Export To Nero Info (also see ) Fix Taskbar Info (also see ) Get CDPlayer Ini v1.2 ** Get_CDPlayer_Ini_Link.txt (215 kb) Info (see Post #54) (includes Screenshot) Iconoid Check Info (also see ) If Not Pressed Info (also see ) Internet Connection Info (also see ) Irfan Slideshow Info (also see ) Kill At Startup Info (also see ) Lplex GUI Info (also see ) M3UPath Editor Info (also see ) MediaRenamer Info (also see ) Nero Data Burn Info (also see ) Numerals To Numbers Info (also see ) Photo Renamer Info (also see ) Program Runner Info (also see ) Rename Long Filename Info (also see ) Resolution Start Info (also see ) Save Separate Tracks Info (also see ) Search Assistant v1.4 *(updated 30-11-2008) Search_Assistant_Link.txt (818 kb) (Number of previous downloads: 25) Info (also see Post #30 below)(see Post #43 below) SetAs Wallpaper v4.3 ** (Updated 15-12-2009) (Requires IrfanView for Jpegs) SetAs Wallpaper Link.txt (240 kb) (Number of previous downloads: 66) Info (see #80 #104) Shutdown Options v6.4 ** Shutdown_Options_Link.txt (910 kb) Info (also see Post #48) Simple CDPlayer v1.3 ** (NEW 18-02-2009) Simple_CDPlayer_Link.txt (216 kb) (Number of previous downloads: 282) Info (also see Post #78) Text Shuffle Info (also see ) Track To Graphic Info (also see ) Web Unzipper + Web Zipper Info (also see ) Wipe Recent Info (also see ) Wipe History Info (also see ) 4. GAMES Question Master (aka Code Breaker) Info (also see ) Tall Tales v1.5 (NEW) ** Tall_Tales_Link.txt (230 kb) Info (see Post #49 & #57 #58 #70) The Fantasy Realm (work in progress) Info1 point
-
PCInfo 1.1
Synapsee reacted to ToKicoBrothers for a topic
Know PCInfo? Here's second version (1.1): ;~ Name: PCInfo 1.1 ;~ Author: ToKicoBrothers ;~ tokico.pt@gmail.com ;~ Description: This script gives you information about your PC. #include <GUIConstants.au3> $totaldrivespace = Round (DriveSpaceTotal ( "C:/" ) / 1024, 2) $freedrivespace = Round (DriveSpaceFree ( "C:/" ) / 1024, 2) $drivespace = $freedrivespace & " GB / " & $totaldrivespace & " GB" $driveserialno = DriveGetSerial ( "C:/" ) $drivefilesys = DriveGetFileSystem ("C:/") $memorystats = MemGetStats () $desktopsize = @DesktopWidth & "x" & @DesktopHeight $ramtotalspace = Round($memorystats[1] / 1024, 1) $ramavaliablespace = Round($memorystats[2] / 1024, 1) $ramspace = $ramavaliablespace & "MB / " & $ramtotalspace & "MB" $pagefiletotalspace = Round($memorystats[3] / 1024, 0) $pagefileavaliablespace = Round($memorystats[4] / 1024, 0) $pagefilespace = $pagefileavaliablespace & "MB / " & $pagefiletotalspace & "MB" $virtualavaliable = Round($memorystats[6] / 1024, 0) $processorspeed = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor", "~MHz") & " MHz" $processorname = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor", "processornamestring") $ieversion = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version") $processorvendor = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor", "VendorIdentifier") #Region ### START Koda GUI section ### $Form1 = GUICreate("PCInfo 1.1", 482, 346, 276, 134) $disk = GUICtrlCreateGroup("Drive", 8, 8, 465, 65) $Label1 = GUICtrlCreateLabel("Drive Space", 88, 24, 63, 17) $Input1 = GUICtrlCreateInput($drivespace, 64, 40, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label2 = GUICtrlCreateLabel("Drive File System", 208, 24, 85, 17) $Input2 = GUICtrlCreateInput($drivefilesys, 224, 40, 57, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label3 = GUICtrlCreateLabel("Drive Serial Number", 320, 24, 94, 17) $Input3 = GUICtrlCreateInput($driveserialno, 320, 40, 89, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlCreateGroup("", -99, -99, 1, 1) $memory = GUICtrlCreateGroup("Memory", 8, 80, 465, 81) $Progress1 = GUICtrlCreateProgress(18, 103, 117, 16) GUICtrlSetData(-1, 25) $Label4 = GUICtrlCreateLabel("Memory Usage: " & $memorystats[0] & "%", 24, 128, 101, 17) $Label6 = GUICtrlCreateLabel("RAM Space", 181, 104, 105, 17) $Input4 = GUICtrlCreateInput($ramspace, 155, 129, 105, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label5 = GUICtrlCreateLabel("Page File", 301, 104, 48, 17) $Input5 = GUICtrlCreateInput($pagefilespace, 275, 129, 105, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label7 = GUICtrlCreateLabel("Virtual Available", 384, 104, 79, 17) $Input6 = GUICtrlCreateInput($virtualavaliable, 395, 129, 57, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlSetData(-1, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $computer = GUICtrlCreateGroup("Computer", 8, 168, 313, 169) $Label8 = GUICtrlCreateLabel("Desktop Size", 19, 192, 67, 17) $Input7 = GUICtrlCreateInput($desktopsize, 16, 208, 73, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label9 = GUICtrlCreateLabel("Operative System", 115, 192, 87, 17) $Input8 = GUICtrlCreateInput(@OSVersion, 96, 208, 137, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label10 = GUICtrlCreateLabel("Processor Arch.", 240, 192, 79, 17) $Input9 = GUICtrlCreateInput(@ProcessorArch, 260, 208, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label13 = GUICtrlCreateLabel("Processor Speed", 227, 288, 85, 17) $Input12 = GUICtrlCreateInput($processorspeed, 232, 304, 73, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label14 = GUICtrlCreateLabel("Processor Vendor", 27, 288, 88, 17) $Input13 = GUICtrlCreateInput($processorvendor, 16, 304, 113, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Input14 = GUICtrlCreateInput($processorname, 64, 264, 201, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label15 = GUICtrlCreateLabel("Processor Name", 123, 240, 82, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $versions = GUICtrlCreateGroup("Versions", 328, 168, 145, 81) $Label11 = GUICtrlCreateLabel("AutoIt", 336, 192, 32, 17) $Input10 = GUICtrlCreateInput(@AutoItVersion, 392, 189, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Label12 = GUICtrlCreateLabel("IE", 336, 216, 14, 17) $Input11 = GUICtrlCreateInput($ieversion, 360, 213, 97, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label16 = GUICtrlCreateLabel("PCInfo 1.1", 336, 280, 129, 31) GUICtrlSetFont(-1, 18, 400, 0, "NimbusSanTBla") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 GUICtrlSetData ($Progress1, $memorystats[0]) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm open to comments, suggestions and bugs! PCInfo_1.1.au31 point