colombeen Posted November 27, 2011 Author Share Posted November 27, 2011 @guinness : the GUICtrlSetImage isn't working... i changed the _ResourceSetImageToCtrl to GUICtrlSetImage($appBG, "THE_BG") but it isn't showing in SciTE Link to comment Share on other sites More sharing options...
guinness Posted November 27, 2011 Share Posted November 27, 2011 Sorry, you can just add the filename to GUICtrlCreatePic, you don't need GUICtrlSetImage in this instance. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
colombeen Posted November 27, 2011 Author Share Posted November 27, 2011 Sorry, you can just add the filename to GUICtrlCreatePic, you don't need GUICtrlSetImage in this instance.I tried this but it doesn't work in SciTE :-sno errors etc but also no background Link to comment Share on other sites More sharing options...
colombeen Posted November 29, 2011 Author Share Posted November 29, 2011 This is what I have so far (all you need is a dark background image or change the color to 0x000000) REQUIRED!!! resources.au3 AD.au3 expandcollapse popup#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=icon.ico #AutoIt3Wrapper_Outfile=netwerk.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=Digipolis Netwerk Controle gemaakt door Jarno Colombeen #AutoIt3Wrapper_Res_Description=Digipolis Netwerk Controle tool #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Digipolis Servicedesk #AutoIt3Wrapper_Res_File_Add=bg.jpg, rt_rcdata, THE_BG #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <resources.au3> #include <AD.au3> ; Set variables and etc Dim $labelIP[4] Dim $IPlist[4] ; Create a window for the app GUICreate("Digipolis Netwerk Controle", 280, 200, Default, Default, Default, $WS_EX_TOPMOST) ; Set a background for the window $appBG = GUICtrlCreatePic("", 0, 0, 280, 200) _ResourceSetImageToCtrl($appBG, "THE_BG") GUICtrlSetState($appBG, $GUI_DISABLE) ; Set font properties GUISetFont(8.5, 400, 0, "Arial") ; Fill the window with the labels etc _GUICtrlCreateLabel(@ComputerName, 10, 10, 260, 20, 1, 14, 1) _GUICtrlCreateLabel("Besturingssysteem", 20, 40, 130, 14, 1) _GUICtrlCreateLabel("Gebruikersnaam", 20, 55, 130, 14, 1) _GUICtrlCreateLabel("Account status", 20, 70, 130, 14, 1) _GUICtrlCreateLabel("Paswoord verloopt op", 20, 85, 130, 14, 1) _GUICtrlCreateLabel("Pingen naar Telenet", 20, 100, 130, 14, 1) _GUICtrlCreateLabel("Pingen naar StadGent", 20, 115, 130, 14, 1) _GUICtrlCreateLabel("IP adres(sen)", 20, 130, 130, 14, 1) $labelOS = _GUICtrlCreateLabel(@OSVersion & " " & @OSServicePack, 130, 40, 130, 14, 0, 8.5, 2) $labelUSER = _GUICtrlCreateLabel(@UserName, 130, 55, 130, 14, 0, 8.5, 2) $labelAccount = _GUICtrlCreateLabel("", 130, 70, 130, 14, 0, 8.5, 2) $labelPassword = _GUICtrlCreateLabel("", 130, 85, 130, 14, 0, 8.5, 2) $labelTelenet = _GUICtrlCreateLabel("", 130, 100, 130, 14, 0, 8.5, 2) $labelStadgent = _GUICtrlCreateLabel("", 130, 115, 130, 14, 0, 8.5, 2) $labelIP[0] = _GUICtrlCreateLabel("", 130, 130, 130, 14, 0, 8.5, 2) $labelIP[1] = _GUICtrlCreateLabel("", 130, 145, 130, 14, 0, 8.5, 2) $labelIP[2] = _GUICtrlCreateLabel("", 130, 160, 130, 14, 0, 8.5, 2) $labelIP[3] = _GUICtrlCreateLabel("", 130, 175, 130, 14, 0, 8.5, 2) ; Show the window GUISetState() ; Refresh the data until the window is closed Global $i = 250 While 1 $windowAction = GUIGetMsg() Switch $windowAction Case $GUI_EVENT_CLOSE Exit EndSwitch If $i > 250 Then ; Things to update go here $appStatus = _GUICtrlCreateLabel("Gegevens vernieuwen ...", 20, 175, 130, 14, 0) _checkAccount($labelAccount) _checkPassword($labelPassword) _tryPing("195.130.130.130", $labelTelenet) _tryPing("stadgent", $labelStadgent) _checkIP($labelIP) GUICtrlSetData($appStatus, "") ; End Things to update go here $i = 0 EndIf Sleep(50) $i += 1 WEnd ; Extended function to create the label Func _GUICtrlCreateLabel($varText, $varLeft, $varTop, $varWidth, $varHeight, $varBold = 0, $varSize = 8.5, $varAlign = 0) $tempLabelId = GUICtrlCreateLabel($varText, $varLeft, $varTop, $varWidth, $varHeight) ; Create the label GUICtrlSetColor(Default, 0xFFFFFF) ; Set the color GUICtrlSetBkColor(Default, $GUI_BKCOLOR_TRANSPARENT) ; Set the background transparancy ; Set font weight If $varBold = 1 Then GUICtrlSetFont(Default, $varSize, 600) EndIf ; Set text alignment If $varAlign = 1 Then GUICtrlSetStyle(Default, $SS_CENTER) ElseIf $varAlign = 2 Then GUICtrlSetStyle(Default, $SS_RIGHT) EndIf Return $tempLabelId EndFunc ; _GUICtrlCreateLabel ; Function to ping server and set the status Func _tryPing($varServer, $varLabel) GUICtrlSetData($varLabel, "...") GUICtrlSetColor($varLabel, 0xFFFFFF) $pingTest = 0 $pingTest = Ping($varServer) If $pingTest Then GUICtrlSetData($varLabel, "Gelukt") Else GUICtrlSetData($varLabel, "Mislukt") EndIf EndFunc ; _tryPing ; Function to check the IP-address Func _checkIP($varLabel) $nextLabel = 0 $IPlist[0] = @IPAddress1 $IPlist[1] = @IPAddress2 $IPlist[2] = @IPAddress3 $IPlist[3] = @IPAddress4 For $i = 0 To 3 Step +1 GUICtrlSetData($varLabel[$i], "") $IParray = StringSplit($IPlist[$i], ".") If Not ($IParray[1] = "169") And Not ($IPlist[$i] = "0.0.0.0") And Not ($IPlist[$i] = "127.0.0.1") Then GUICtrlSetData($varLabel[$nextLabel], $IPlist[$i]) $nextLabel += 1 EndIf Next EndFunc ; _checkIP Func _checkAccount($varLabel) GUICtrlSetData($varLabel, "...") GUICtrlSetColor($varLabel, 0xFFFFFF) $pingTest = 0 $pingTest = Ping(StringReplace(@LogonServer, "", "")) If $pingTest Then $ADConn = _AD_Open("","","", StringReplace(@LogonServer, "", "") & "." & @LogonDNSDomain) If _AD_IsObjectLocked() = 1 Then GUICtrlSetData($varLabel, "Geblokkeerd") ElseIf _AD_IsObjectDisabled() = 1 Then GUICtrlSetData($varLabel, "Uitgeschakeld") Else GUICtrlSetData($varLabel, "Actief") EndIf _AD_Close() Else GUICtrlSetData($varLabel, "Onbekend") EndIf EndFunc Func _checkPassword($varLabel) GUICtrlSetData($varLabel, "...") $pingTest = 0 $pingTest = Ping(StringReplace(@LogonServer, "", "")) If $pingTest Then $ADConn = _AD_Open("","","", StringReplace(@LogonServer, "", "") & "." & @LogonDNSDomain) $tempInfo = _AD_GetPasswordInfo() $passExpires = StringSplit($tempInfo[9], " ") GUICtrlSetData($varLabel, $passExpires[1]) _AD_Close() Else GUICtrlSetData($varLabel, "Onbekend") EndIf EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now