Leaderboard
Popular Content
Showing content with the highest reputation on 11/26/2023 in all areas
-
Aren't you tired to ask stupid questions? Go through a basic AutoIt tutorial to get the basics because right now you are unable to understand basic programming.2 points
-
GuiBuilderPlus [updated March 24, 2024]
yahaosoft reacted to kurtykurtyboy for a topic
GuiBuilderPlus GuiBuilderPlus is a small, easy to use GUI designer for AutoIt. Originally created long ago as AutoBuilder by the user CyberSlug, enhanced as GuiBuilder by TheSaint, and further enhanced and expanded as GuiBuilderNxt by jaberwacky, GuiBuilderPlus is a continuation of their great work, with a focus on increased stability and usability followed by new features. ------ Yes, I have decided to bring back our old friend the GuiBuilder. This utility has a long history, which you can read about in TheSaint's Gui Creators topic, starting all the back back with CyberSlug's AutoBuilder. Even though I've hacked the original code to pieces in order to document and better understand what is going on, the essence of GuiBuilder still lives on! I am using the awesome updates from GuiBuilderNxt by jaberwacky as a starting point since he already did a lot of the hard work of parsing and updating the original code, plus I really like the layout that came about from that update. Unfortunately development seems to have stopped in 2016. Not sure how much interest there is in this, but suggestions and bug reports are welcome. See Full Changelog: Download the latest version: v1.3.0 (2024-03-24) GuiBuilderPlus v1.3.0 - 2024-03-24.zip FIXED: Wrong line endings when copying from code preview window FIXED: Issue changing properties when Obect Explorer window is not open FIXED: Issue when selecting controls under certain other conditions FIXED: SaveAs keyboard shortcut FIXED: Undo/Redo for Global property ADDED: Auto-size property for Labels, Buttons, and Inputs GitHub Repository: https://github.com/KurtisLiggett/GuiBuilderPlus1 point -
Display PDF content in GUI
argumentum reacted to CZamirekko for a topic
I solved one problem, the PDF file content listing is now functional. x64 =y must not be set at the beginning of the file, when I changed it to x64 =n the PDF content appeared. With this declaration, the code works: #AutoIt3Wrapper_UseX64=n1 point -
You could also use the FileSaveDialog at the beginning of the script so the user can select the Show file or create a new one, basic example: ;----------------------------------------------- #include <File.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> ;----------------------------------------------- Global $g_sMasterShow = "D:\Master_Backup\Shows\Master_Show.shw" Global $g_sWorkingDir = "D:\Master_Backup" Global $g_sShwFileDir = $g_sWorkingDir & "\Shows" Global $g_sShwFileName = @YEAR&"-"&@MON&"-"&@MDAY&"_SHOW.shw" Global $g_sShwFilePath, $g_bShwFilePath = False Global $g_hGUI = GUICreate("Session List Producer", 940, 255) GUISetFont(12, 800, 0, "Calibri") ;----------------------------------------------- Global $g_idAddToList = GUICtrlCreateButton("Add to List", 10, 10, 200, 25) Global $g_idListView = GUICtrlCreateListView("Current Session Files Listing", 220, 10, 500, 235, 0x0008, 0x00000020) _GUICtrlListView_SetColumnWidth($g_idListView, 0, 500) Global $g_idExitMe = GUICtrlCreateButton("Exit", 10, 40, 200, 25) _AddToList() ;----------------------------------------------- GUISetState(@SW_SHOW, $g_hGUI) ;----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $g_idAddToList _AddToList() Case $g_idExitMe Exit EndSwitch WEnd ;----------------------------------------------- Func _AddToList() ; SECTION A ; Check if Show File Path equals false, dialog only appears once ;----------------- If Not $g_bShwFilePath Then $g_sShwFilePath = FileSaveDialog("Select a SHOW File", $g_sShwFileDir, "SHOW(*.shw)",0,$g_sShwFileName) If @error Then Exit MsgBox(4096, "Error", "No file was selected") If Not FileExists($g_sShwFilePath) Then FileCopy($g_sMasterShow, $g_sShwFilePath, 1) $g_sShwFileName = StringTrimLeft($g_sShwFilePath,StringInStr($g_sShwFilePath,"\",0,-1)) EndIf ;~ Show File Path has been set $g_bShwFilePath = True ;----------------- Local $iItem Local $sFileSelectDialog = FileOpenDialog('Select Session Files', $g_sWorkingDir, 'Session Files (*.edl)', 4) If @error Then Return SetError(1, 0, Null) Local $aSplit = StringSplit($sFileSelectDialog,'|', 2) If Not IsArray($aSplit) Then Return SetError(1, 0, Null) If UBound($aSplit) = 1 Then _GUICtrlListView_FindText($g_idListView, $aSplit[0], -1, False) Else For $i = 1 To UBound($aSplit) - 1 If _GUICtrlListView_FindText($g_idListView, $aSplit[0] & "\" & $aSplit[$i], -1, False) = -1 Then GUICtrlCreateListViewItem($aSplit[0] & "\" & $aSplit[$i], $g_idListView) Next EndIf EndFunc ;==>_AddToList1 point
-
this is most definitely NOT the way to do it, and it wouldn't take more than a few calls to _AddToList() to figure out why. calling a function from within itself, as often called "recursion", is used in a different manner, for different reasons. NOT what you are doing. "Goto" is also a poor scripting strategy, and no wonder modern scripting languages (AutoIt included) do not support it altogether. the way to go is using a loop. 1) first, declare all your Local variables at the top of the functions (not whenever you first assign a value to them). 2) then, consider the code starting with this line: $sFileSelectDialog = FileOpenDialog('Select Session Files', $WorkingDir, 'Data Files (*.edl; *.shw)', 4) until the end of the function (excluding the last call to _AddToList(), which should be removed). 3) enclose all this section in a loop, like this: Do {the said section of code} Until {whatever condition you choose to end the function and return to the calling script, or False if you never do} also, don't have a Global variable $SetName declared inside a function _CreateShowFile(). and, as you have already discovered, if the user does not input anything in the inputbox, you'd have an invalid file name to work with. so test for valid input. flogging aside 🙂 , you might want to employ a few best practices . this is not an easy reading, especially for non-native English speakers; but it is worthwhile. i would highly recommend for start, give your variables meaningful names, and put comments wherever adequate. consider this: if in six months time you'd be revisiting that code, would you understand what's going on?1 point
-
You're welcome. NTuser.ini is weird too. The example of my currently logged in PC that has been logged in since 8 November: my NTuser.dat mod date is 8 Nov 2023 and NTuser.ini is 18 Jun 2021. But a user who hasn't logged in since 20 April 2023: NTuser.dat is 16 Nov 2023 and NTuser.ini is 20 Mar 2023 If you really want to calculate the age you'll have to use values stored in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<userSID>\LocalProfileLoadTimeHigh HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<userSID>\LocalProfileLoadTimeLow If you want to try it, combine the hex values above and then convert to decimal (use an actual SID from the registry): #include <AutoItConstants.au3> #include <Array.au3> #include <Date.au3> $sLocalProfileLoadTimeHigh = Hex(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<UserSID>" , "LocalProfileLoadTimeHigh"), 8) $sLocalProfileLoadTimeLow = Hex(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<UserSID>" , "LocalProfileLoadTimeLow") , 8) $iLocalProfileLoadTimeCombined = Dec($sLocalProfileLoadTimeHigh & $sLocalProfileLoadTimeLow, $NUMBER_64BIT) Then you'll need to convert that result to the offset date. A quick and dirty way is to use W32tm.exe (which is built into windows). $iPID = Run("w32tm /ntte " & $iLocalProfileLoadTimeCombined , "", @SW_HIDE , $STDOUT_CHILD) ProcessWaitClose($iPID) $aDateOffset = StringSplit ( StdoutRead($iPID) , " " ) Finally add that offset date to Microsoft's epoch of 01/01/1601 to get the actual date. $iDateOffset = Int($aDateOffset[1], $NUMBER_AUTO) $sLastLogin = _DateAdd("D", $iDateOffset, "1601/01/01") At this point you'll finally have the true last login date (though the help file says initial date must be after 1 Jan 2000, 1 Jan 1601 seems to work). I suppose you could do some quick date math and use delprof2 to delete the specific profile. I forget if it supports deletion by SID but I'll leave that part to you. If it doesn't, I think you can cross reference the SID to the username with the AD UDF. Don't rely on the user's name or the value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<UserSID>\ProfileImagePath since people are in the habit of getting married, divorced or whatever else might change a name. I'm hesitant to even mention this since I don't feel it's quite appropriate but I wrote my own little applet to do this kind of profile directory cleanup in AutoIt, but it's not source available. If you're interested in it, send me a PM and I'll send a link to it's home page.1 point
-
#pragma is a build in resource update feature and AutoIt3Wrapper does the resource update after the creations of the EXE. You should be able to mix and match as I've build checks in Autoit3Wrapper to ignore any that would conflict an #Pragma statement. Your choice what you want/like to use. Jos1 point