
joseedwin
Active Members-
Posts
20 -
Joined
-
Last visited
Everything posted by joseedwin
-
Traymenuex Udf. Add Icon Or Bmp To Trayitem
joseedwin replied to Uten's topic in AutoIt Example Scripts
Please, any help is great appreciated. i need help with the tray menu icons, they wont display correctly. see attached images, the extracted icons are not transparent, and they are not sized correctly. part of my code is underneath the image. $extract[0] = _LoadImage($sirsi_icon, $IMAGE_ICON) $extract[1] = _IconExtractFromFile($iepath, 0) $extract[2] = _IconExtractFromFile($ffpath, 0) $extract[3] = _IconExtractFromFile("\\svr2\commapps\Office2003\FILES\PFILES\MSOFFICE\OFFICE11\OSA.EXE", 0) $extract[4] = _IconExtractFromFile($wordpath, 0) $extract[5] = _IconExtractFromFile($remote_icon, 0) ;~ $extract[6] = _IconExtractFromFile("shell32.dll", 2) $extract[7] = _IconExtractFromFile("shell32.dll", 166) $extract[8] = _LoadImage($classreg_icon, $IMAGE_ICON) ;~ $extract[9] = _IconExtractFromFile("\\wkcadesk1\cadesk\Program Files\Pharos\Bin\PsDomain.dll", 0) $extract[9] = _LoadImage(@ScriptDir & "\pharos.ico", $IMAGE_ICON) $extract[10] = _IconExtractFromFile("shell32.dll", 146) $extract[11] = _IconExtractFromFile("shell32.dll", 144) $extract[12] = _IconExtractFromFile(@systemdir & "\cleanmgr.exe", 0) _TrayMenuAddIcon($extract[2],0) _TrayMenuAddIcon($extract[1],1) _TrayMenuAddIcon($extract[3],2) _TrayMenuAddIcon($extract[0],3) _TrayMenuAddIcon($extract[4],0,$settingsitem2) _TrayMenuAddIcon($extract[1],0,$settingsitem1) _TrayMenuAddIcon($extract[9],1,$settingsitem1) _TrayMenuAddIcon($extract[2],0,$settingsitem) _TrayMenuAddIcon($extract[9],1,$settingsitem) _TrayMenuAddIcon($extract[5],4) -
thank you so much, that did it for me. I really appreciated, thank you, thank you!!
-
Hey Everyone, i have searched throughout the forums and i have found nothing that could help me create a gui, set it to not steal focus and display it on top. can anyone help me out? thank you.
-
so i held down F11 for a few seconds and then i went into google's language tools to translate it into English and this is what it came back with: [edit] i made a mistake of translating Chinese to English. [edit] ず announcing よ gnp つ も ず the vehicle-borne formula renewals Immigration ん anthem み concentrate り gnp depict ぴ Immigration ほ れ bulgaria realized ば directions indefinitely guarding ゔ じ ろ も ら む Immigration か あ Yangtze Int'l realized hainan presents を Leros ぺ べ づ feel よ が the vehicle-borne program ぼ ん indefinitely ゆ ょ concentrate ゅ courageously で ら indefinitely popularized を unprecedented directions Economy ゃ 13:30 Yangtze び Leros べ ょ guarding directions め extinguishing づ Overseas じ れ anthem formula concentrate% ま ぬ unprecedented も よ Yangtze program か あ Int'l ろ pilot enterprises え Plaisant bulgaria onions the vehicle-borne hainan わ Plaisant Overseas Yangtze onions を depict Plaisant Int'l が positively ぺ Grassroots ま Snake え ゔ extinguishing ろ ずぎよひつもずぉぱさゐんだみてりひにぴゐほれすたばげのゑゔじろもらむゐかあそごたとくをなぺべづどよがぉぞぼんのゆょてゅいでらのぷをぶげゎゃぃそびなべょゑげめしづっじれだぱてぐまぬぶもよそぞかあごろきえせすけぉとわせっそけをにせごがうぺこまおえゔしろほばよたょのくでけぁいほずぺぃぇじょぷぼじさざへじふどるぁぬくとせはきぬゔたりぬづづどをぇょるいしまゑあべ
-
i removed unneccessary code. ;================================================================ ;======================= iNACTIVITy ============================= ;================================================================ #NoTrayIcon #include-once #include <Constants.au3> #include <GUIConstants.au3> #include <Date.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) Opt("WinTitleMatchMode", 4) If UBound(ProcessList(@ScriptName)) > 2 Then Exit EndIf Global $start Dim $oldpos[2] Dim $pos[2] Dim $s_keys[117] = [116, _ "01", "02", "04", "05", "06", "08", "09", "0C", "0D", "10", _ "11", "12", "13", "14", "1B", "20", "21", "22", "23", "24", _ "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", _ "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", _ "41", "42", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", _ "4D", "4E", "4F", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", _ "5A", "5B", "5C", "60", "61", "62", "63", "64", "65", "66", _ "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", _ "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", _ "7B", "7C", "7D", "7E", "7F", "80H", "81H", "82H", "83H", "84H", _ "85H", "86H", "87H", "90", "91", "A0", "A1", "A2", "A3", "A4", "A5"] $dll = DllOpen("user32.dll") $start = TimerInit() $pos = MouseGetPos() While 1 ;inactivity checks For $y = 1 To $s_keys[0] If _IsPressed ($s_keys[$y], $dll) Then $start = TimerInit() ConsoleWrite(@CRLF & "Timer restarted with key " & $s_keys[$y] & " @ " & _NowTime() & @CRLF) EndIf Next $oldpos[0] = $pos[0] $oldpos[1] = $pos[1] $pos2 = MouseGetPos() $Mouse3 = $oldpos[0] + $oldpos[1] $Mouse4 = $pos2[0] + $pos2[1] If $Mouse3 <> $Mouse4 Then $start = TimerInit() ConsoleWrite(@CRLF & "Timer restarted with mouse @ " & _NowTime() & @CRLF) EndIf $pos3 = MouseGetPos() $pos[0] = $pos3[0] $pos[1] = $pos3[1] If TimerDiff($start) > 900000 Then ;'inactivity timer above [15 min inactivity], below we are WARNING ConsoleWrite(@CRLF & "Inactive for 15 minutes" & @CRLF);could be changed to whatever, eg. msgbox, shutdown ;$start = TimerInit();uncomment if you need to restart timer EndIf Sleep(800) WEnd
-
i am total nub, but i made this script and i have running on my pcs. it checks if it has been inactive for 5 minutes, if so, it will shutdown. thought i might help. like i said before, i am new to programming,my coding sux. ;================================================================ ;======================= iNACTIVITy ============================ ;'_shutdown author : AutoItKing ;'_GuiRoundCorners author: unknown ;================================================================ #include-once #include <Constants.au3> #include <GUIConstants.au3> #include <Date.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) AutoItWinSetTitle("") Opt("WinTitleMatchMode", 4) AutoItSetOption("TrayIconDebug", 0) AutoItSetOption("TrayAutoPause", 0) AutoItSetOption("TrayMenuMode", 1) If UBound(ProcessList(@ScriptName)) > 2 Then Exit EndIf TraySetIcon("shell32.dll", 20) HotKeySet("!{F1}", "password") TraySetToolTip(@UserName & ": Inactivity Program") TraySetState() Global $USE_TOOLTIP = True Global $start Global $gmin, $lbl Global $warninggui, $gui Global $WinAct, $warningclose, $trans Dim $start Dim $dll Dim $ADDTIME = "" Dim $TIME_WAS_ADDED Dim $TIMER Dim $displayed = 0 Dim $displayed5 = 0 Dim $displayed2 = 0 Dim $displayed1 = 0 Dim $tipshowed Dim $oldpos[2] Dim $pos[2] ;'for x,y $pos = MouseGetPos() Dim $s_keys[117] = [116, _ "01", "02", "04", "05", "06", "08", "09", "0C", "0D", "10", _ "11", "12", "13", "14", "1B", "20", "21", "22", "23", "24", _ "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", _ "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", _ "41", "42", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", _ "4D", "4E", "4F", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", _ "5A", "5B", "5C", "60", "61", "62", "63", "64", "65", "66", _ "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", _ "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", _ "7B", "7C", "7D", "7E", "7F", "80H", "81H", "82H", "83H", "84H", _ "85H", "86H", "87H", "90", "91", "A0", "A1", "A2", "A3", "A4", "A5"] $dll = DllOpen("user32.dll") $start = TimerInit() While 1 If FileExists(@ScriptDir & "\msg" & @ComputerName & ".txt") Then $sentmessage = FileRead(@ScriptDir & "\msg" & @ComputerName & ".txt") ConsoleWrite(@CRLF & "reading msg" & @CRLF) readmessage(@ComputerName, $sentmessage) EndIf If FileExists(@ScriptDir & "\end" & @ComputerName & ".txt") Then FileDelete(@ScriptDir & "\end" & @ComputerName & ".txt") _ShutDown(2) EndIf If FileExists(@ScriptDir & "\link1_" & @ComputerName & ".txt") Then Run("explorer.exe http://www.stdl.org/library_policies.asp#conduc") FileDelete(@ScriptDir & "\link1_" & @ComputerName & ".txt") EndIf ;inactivity checks For $y = 1 To $s_keys[0] If _IsPressed ($s_keys[$y], $dll) Then $start = TimerInit() ConsoleWrite(@CRLF & "Timer restarted with key " & $s_keys[$y] & " @ " & $start & @CRLF) EndIf Next $oldpos[0] = $pos[0] $oldpos[1] = $pos[1] $pos2 = MouseGetPos() $Mouse3 = $oldpos[0] + $oldpos[1] $Mouse4 = $pos2[0] + $pos2[1] If $Mouse3 <> $Mouse4 Then $start = TimerInit() ConsoleWrite(@CRLF & "Timer restarted with mouse @ " & $start & @CRLF) EndIf $pos3 = MouseGetPos() $pos[0] = $pos3[0] $pos[1] = $pos3[1] If TimerDiff($start) > 300000 Then ;'inactivity timer above [5 min inactivity], below we are WARNING $w = 250 $h = 180 $dw = (@DesktopWidth - $w) / 2 $dh = (@DesktopHeight - $h) / 2 $msg = "Inactivity Detected" ;' inactivity gui $warninggui = GUICreate(@UserName, $w, $h, $dw, $dh, BitOR($WS_POPUP, $WS_BORDER), $GUI_DISABLE) ;$WS_POPUPWINDOW instead of 0 to remove window and descrease height GUISetBkColor(0xFFFFE7); 'light yellow GUICtrlCreateLabel(@UserName, 25, 1, 120, 20) GUICtrlSetFont(-1, 11, 80, 0, "Times New Roman") GUICtrlSetColor(-1, 0xFD0F03) ; 'Red GUICtrlCreateIcon("shell32.dll", 27, 5, 1, 15, 15) GUICtrlCreateLabel($msg, 0, 55, 250, -1, $SS_CENTER) GUICtrlSetColor(-1, 0x000000) ; 'Black GUICtrlSetFont(-1, 13, 600, 0, "Helvetica") GUISetState(@SW_SHOW, $warninggui) $pos1 = MouseGetPos() $Mouse1 = $pos1[0] + $pos1[1] $Label_4 = GUICtrlCreateLabel("0%", 20, 80, 20, 20) GUICtrlSetFont(-1, 7, '', '', "Verdana") $Label_4_1 = GUICtrlCreateLabel("100%", 210, 80, -1, 20) GUICtrlSetFont(-1, 7, '', '', "Verdana") $Progressbar1 = GUICtrlCreateProgress(25, 100, 200, 7, $PBS_SMOOTH) $Label_6 = GUICtrlCreateLabel("Move mouse to stop count down" & @CRLF & "", 35, 120, 180, 60, $SS_CENTER) GUICtrlSetColor(-1, 0x000000) ; 'Black GUICtrlSetFont(-1, 10, 400, 0, "Helvetica") $s = 0 $ss = 0 For $i = $s To 100 Step 2 GUICtrlSetData($Progressbar1, $i) ;~ $pos2 = MouseGetPos() $Mouse2 = $pos2[0] + $pos2[1] If $Mouse1 <> $Mouse2 Then GUIDelete($warninggui) ExitLoop $pos1 = MouseGetPos() $start = TimerInit() EndIf For $y = 1 To $s_keys[0] If _IsPressed ($s_keys[$y], $dll) Then GUIDelete($warninggui) ExitLoop $start = TimerInit() EndIf Next ;~ key stroke will activate timer again If FileExists(@ScriptDir & "\end" & @ComputerName & ".txt") Then $endpos = MouseGetPos() GUIDelete($warninggui) FileDelete(@ScriptDir & "\end" & @ComputerName & ".txt") _ShutDown(2) ExitLoop EndIf Sleep(800) Next $start = TimerInit() If $i > 100 Then GUIDelete($warninggui) FileDelete(@ScriptDir & "\end" & @ComputerName & ".txt") _ShutDown(2) ExitLoop EndIf EndIf Sleep(800) WEnd Func readmessage($compnum, $sentmessage) $msg = $sentmessage $WinAct = GUICreate("Warning", 350, 80, @DesktopWidth - 360, @DesktopHeight - 105, BitOR($WS_EX_DLGMODALFRAME, $WS_POPUPWINDOW), $WS_EX_TOPMOST + $GUI_DISABLE) GUISetBkColor(0xFAFF9F, $WinAct) $Label1 = GUICtrlCreateEdit($msg, 10, 8, 330, 50, BitOR($ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL, $ES_MULTILINE, $SS_LEFT)) GUICtrlSetFont(-1, 10, 300, 0, "Verdana") GUICtrlSetColor(-1, 0x000080) GUICtrlSetBkColor(-1, 0xFAFF9F) $stringleng2 = StringLen($msg) + 10 $stringleng = Round($stringleng2 * 65) $msgclosebutton = GUICtrlCreateLabel("Closes Automatically.", 0, 65, 335, 25, $SS_RIGHT) GUICtrlSetFont(-1, 7, 400, 0, "Arial") GUICtrlSetColor(-1, 0xCDCDCD) WinSetTrans( 'Warning', '', 0) _GuiRoundCorners($WinAct, 1, 1, 20, 20) GUISetState() $trans = 1 Do Sleep(5) WinSetTrans( 'Warning', '', $trans) $trans = $trans + 4 Until $trans >= 255 Sleep($stringleng) _close() FileDelete(@ScriptDir & "\msg" & @ComputerName & ".txt") EndFunc ;==>readmessage Func endscript() EndFunc ;==>endscript Func _close() Do Sleep(5) WinSetTrans( 'Warning', '', $trans) $trans = $trans - 1 Until $trans = 0 GUIDelete($WinAct) EndFunc ;==>_close Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners Func _ShutDown($sd_method, $sd_leaveopen = "Program Manager", $sd_leaveopen2 = "Program Manager", $sd_leaveopen3 = "Program Manager") $i = 1 If $sd_method = 1 Then $sd_windows = WinList() While 1 If $sd_windows[$i][0] <> "" And BitAND( WinGetState($sd_windows[$i][1]), 2) And $sd_windows[$i][0] <> "Program Manager" Then WinClose($sd_windows[$i][0]) EndIf $i = $i + 1 If $i = $sd_windows[0][0] Then Shutdown(0) ExitLoop EndIf WEnd EndIf $i = 1 If $sd_method = 2 Then $sd_windows = WinList() While 1 If $sd_windows[$i][0] <> "" And BitAND( WinGetState($sd_windows[$i][1]), 2) And $sd_windows[$i][0] <> "Program Manager" Then WinClose($sd_windows[$i][0]) EndIf $i = $i + 1 If $i = $sd_windows[0][0] Then Shutdown(1) ExitLoop EndIf WEnd EndIf $i = 1 If $sd_method = 3 Then $sd_windows = WinList() While 1 If $sd_windows[$i][0] <> "" And BitAND( WinGetState($sd_windows[$i][1]), 2) And $sd_windows[$i][0] <> "Program Manager" Then WinClose($sd_windows[$i][0]) EndIf $i = $i + 1 If $i = $sd_windows[0][0] Then ExitLoop EndIf WEnd EndIf $i = 1 If $sd_method = 4 Then $sd_windows = WinList() While 1 If $sd_windows[$i][0] <> "" And BitAND( WinGetState($sd_windows[$i][1]), 2) And $sd_windows[$i][0] <> "Program Manager" And $sd_windows[$i][0] <> $sd_leaveopen And $sd_windows[$i][0] <> $sd_leaveopen2 And $sd_windows[$i][0] <> $sd_leaveopen3 Then WinClose($sd_windows[$i][0]) EndIf $i = $i + 1 If $i = $sd_windows[0][0] Then ExitLoop EndIf WEnd EndIf EndFunc ;==>_ShutDown Func password() Send("#d") $promptadmin = InputBox("Enter Admin password", "what is the password?", '', "*", 200, 100, -1, -1, 25) If @error = 0 Then $pass = "mypass";could be changed If $promptadmin = $pass Then Exit Else EndIf Else EndIf EndFunc ;==>password
-
if the content of the listview is listing a notepad/txt file just use GuiCtrlRead and use Run to open the text file.
-
Create Tray "Menu" on the fly
joseedwin replied to Xenophane's topic in AutoIt General Help and Support
is there a way to update the traymenu once displayed? i have a list/shortcut tray menu option, add shortcut and run shortcut. but i am hoping to update the tray menu after adding a shortcut. can it be done? or does it have to reload the program?, because that's what i am seeing. thanks in advanced! -
Help for IniReadSection's limit
joseedwin replied to clearguy's topic in AutoIt General Help and Support
Thank you, your answer is more than comforting... -
Help for IniReadSection's limit
joseedwin replied to clearguy's topic in AutoIt General Help and Support
i had a question about the INI size limit. lets say i have a 34KB INI file, and i only search for certain INI Section Names, will it limit. for example, i am only wanting the monthly sections, and i have the section names as 07 - 01 - 2006 and so on for the whole month, will it limit, will it crash, will it only take long to process the search? thanks in advanced for your suggestions and help... -
#include <GUIConstants.au3> #NoTrayIcon $FREE = DriveSpaceFree("C:\") $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") $colMemory = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem") $colCPU = $objWMIService.ExecQuery ("Select * from CIM_Processor") $audiocardquery = $objWMIService.ExecQuery ("Select * from Win32_SoundDevice") ;~ $colVideoinfo = $objWMIService.ExecQuery ("Select * from Win32_VideoController") Dim $pcinfo, $pcinfo2, $clockspeed,$audiocardinfo,$audiocardinfo2,$devices Dim $ffcase = 0 Dim $labelinc = 0 Dim $spy1 = 0 For $object In $audiocardquery $devices = String($object.PNPDeviceID) $firstaudiocard = $objWMIService.ExecQuery ("Select * from Win32_SoundDevice.DeviceID=" & $devices) $audiocardinfo = String($object.Name) $audiocardinfo2 = String($object.Status) ConsoleWrite(@CRLF & $audiocardinfo & @CRLF) Next ;~ For $object In $firstaudiocard ;~ $audiocardinfo = String($object.Caption) ;~ Next ;~ ConsoleWrite(@CRLF & $audiocardinfo & @CRLF) For $object In $colSettings $wininfo = String($object.Caption) $winsp = String($object.CSDVersion) ;~ $clockspeed = String(Int(Number($object.CurrentClockSpeed))) / 1000 Next For $object In $colCPU $pcinfo = String($object.Name) $clockspeed = String(Int(Number($object.CurrentClockSpeed))) / 1000 Next For $object In $colMemory $primaryowner = String($object.PrimaryOwnerName) $pcinfo2 = String(Int(Number($object.TotalPhysicalMemory) / (1024))) & " KB" & " (" & String(Int(Number($object.TotalPhysicalMemory) / (1024 * 1024)) + 1) & " MB)" Next $Form1 = GUICreate("System Information", 622, 441, 192, 125) GUISetIcon("shell32.dll", 169) ; will change icon $Group1 = GUICtrlCreateGroup("System Information", 16, 5, 585, 120) GUICtrlCreateLabel("Free Disk Space:", 24, 48, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) $cpu = StringFormat("%.2f", $clockspeed) GUICtrlCreateLabel("Processor Type:", 240, 48, 80, 17, $SS_LEFT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Physical Memory:", 24, 72, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Primary Owner:", 24, 96, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) $RFREE = StringFormat("%.2f", $FREE) GUICtrlCreateLabel($RFREE & " MB [C:\]", 120, 48, 120, 17) GUICtrlCreateLabel($pcinfo & " , " & $cpu & " Ghz", 320, 48, 250, 17) GUICtrlCreateLabel($pcinfo2, 120, 72, 250, 17) GUICtrlCreateLabel($primaryowner, 120, 96, 250, 17) GUICtrlCreateLabel("Audio Card:", 240, 70, -1, -1, $SS_LEFT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel($audiocardinfo & " Status: " & $audiocardinfo2, 320, 70, -1, -1) GUISetState(@SW_SHOW) while 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit EndSelect sleep(300) WEnd
-
try this: $audiocardquery = $objWMIService.ExecQuery ("Select * from Win32_SoundDevice") Dim $audiocardinfo,$devices For $object In $audiocardquery $devices = String($object.DeviceID) $firstaudiocard = $objWMIService.ExecQuery ("Select * from Win32_SoundDevice.DeviceID=" & $devices) $audiocardinfo = String($object.Name) $audiocardinfo2 = String($object.Status) ConsoleWrite(@CRLF & $audiocardinfo & @CRLF) Next GUICtrlCreateLabel("Audio Card:", 240, 70, -1, -1, $SS_LEFT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel($audiocardinfo & " Status: " & $audiocardinfo2, 320, 70, -1, -1)
-
i created something like this for a pc repair program displaying the system's info, maybe this could help. #include <GUIConstants.au3> #include <IE.au3> #NoTrayIcon $FREE = DriveSpaceFree("C:\") $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") $colMemory = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem") $colCPU = $objWMIService.ExecQuery ("Select * from CIM_Processor") ;~ $colVideoinfo = $objWMIService.ExecQuery ("Select * from Win32_VideoController") Dim $pcinfo, $pcinfo2, $clockspeed Dim $ffcase = 0 Dim $labelinc = 0 Dim $spy1 = 0 For $object In $colSettings $wininfo = String($object.Caption) $winsp = String($object.CSDVersion) ;~ $clockspeed = String(Int(Number($object.CurrentClockSpeed))) / 1000 Next For $object In $colCPU $pcinfo = String($object.Name) $clockspeed = String(Int(Number($object.CurrentClockSpeed))) / 1000 Next For $object In $colMemory $primaryowner = String($object.PrimaryOwnerName) $pcinfo2 = String(Int(Number($object.TotalPhysicalMemory) / (1024))) & " KB" & " (" & String(Int(Number($object.TotalPhysicalMemory) / (1024 * 1024)) + 1) & " MB)" Next $Form1 = GUICreate("System Information", 622, 441, 192, 125) GUISetIcon("shell32.dll", 169) ; will change icon $Group1 = GUICtrlCreateGroup("System Information", 16, 5, 585, 120) GUICtrlCreateLabel("Operating System:", 24, 24, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Free Disk Space:", 24, 48, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) $cpu = StringFormat("%.2f", $clockspeed) GUICtrlCreateLabel("Processor Type:", 240, 48, 80, 17, $SS_LEFT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Physical Memory:", 24, 72, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Primary Owner:", 24, 96, 87, 17, $SS_RIGHT) GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) $RFREE = StringFormat("%.2f", $FREE) GUICtrlCreateLabel($RFREE & " MB [C:\]", 120, 48, 120, 17) GUICtrlCreateLabel($pcinfo & " , " & $cpu & " Ghz", 320, 48, 250, 17) GUICtrlCreateLabel($pcinfo2, 120, 72, 250, 17) GUICtrlCreateLabel($primaryowner, 120, 96, 250, 17) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit EndSelect sleep(300) WEnd
-
Use Access MDF file without access installed?
joseedwin replied to ACalcutt's topic in AutoIt General Help and Support
this is really nice, thanks for sharing it. i was able to use it, but i had a problem if the table/query had a space in the name it would create an error. underscore would not work unless i rename the table and or query. -
Gui Disabling Close Button
joseedwin replied to joseedwin's topic in AutoIt General Help and Support
Thanks PsaltyDS, your approach did help, but i wanted to display the icon as well. My fault for not mentioning this before. Thanks Holger, your suggestion worked perfectly. Thank you guys! -
i am trying to disable the top right X on a gui i created. i was able to search the forums but i only found disabling minimize and maximize, can someone point me in the right direction to disable the close button. Thank you.
-
PixelSearch SplashScreen (PixelChecksum)
joseedwin replied to herewasplato's topic in AutoIt Example Scripts
text removed by JoseEdwin... sorry green. -
Hey everyone, i appreciate any help given. i wrote a login helper program to always use the default profile using trillian. i am trying to disable a control in the Trillian Preferences window but the button is not beign disable. Not sure if the trademark character will prevent me from getting the window title and or making the script not work at all. Any suggestions?
-
Hey everyone, i am new to programing using Autoit, but i am having lots of fun. Here is my first input to button with color. i created a label with a bkcolor and set an event, i hope that helps. #include <GUIConstants.au3> GUICreate("Label disguised as a button"); will create a dialog box that when displayed is centered Opt("GUIOnEventMode",1) $mylabel = GUICtrlCreateLabel ("Testing, one two three", 2, 2, 350,35,$BS_DEFPUSHBUTTON+$SS_SUNKEN+$BS_CENTER,$SS_LEFT+$SS_BLACKFRAME) GUICtrlSetColor(-1,0x082BFE);blue GUICtrlSetFont(-1,14,4,"","Arial") GUICtrlSetBkColor(-1,0xF8FA6F); Yellow GUICtrlSetOnEvent($mylabel, "_Hello") GUISetState () ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func _Hello() MsgBox(0,"Event","10 sec timeout, exiting...",10) Exit EndFunc