-
Posts
937 -
Joined
-
Last visited
-
Days Won
9
InunoTaishou last won the day on May 30 2017
InunoTaishou had the most liked content!
Recent Profile Visitors
984 profile views
InunoTaishou's Achievements
Universalist (7/7)
206
Reputation
-
Ebola57 reacted to a post in a topic: Simple MouseOver effect on a picture?
-
Saad reacted to a post in a topic: RichEdit toggle wrap/unwrap - how?
-
TheOne23 reacted to a post in a topic: AutoIT Editor Dark Theme
-
KeeperOfTheReaper reacted to a post in a topic: Redraw your desktop with GDI+
-
pixelsearch reacted to a post in a topic: RichEdit toggle wrap/unwrap - how?
-
BigDaddyO reacted to a post in a topic: AutoIt Snippets
-
pixelsearch reacted to a post in a topic: RichEdit Hyperlinks (Friendly)
-
SkysLastChance reacted to a post in a topic: AutoIT Editor Dark Theme
-
DinFuv reacted to a post in a topic: Insert image into a field in a ListView control
-
DinFuv reacted to a post in a topic: RichEdit Hyperlinks (Friendly)
-
Has there been a fix for the console using black characters even if the background color is dark? There's no setting in the script editor colors I can see.
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
Hey, I'm using this again and noticed when you type a comma, equal sign, ampersand, star (*), etc it automatically adds a space after it. Is there any way to disable this? I looked under the script editor settings and don't see anything about it. Edit: Nvm, it was "Enable intelligent autoformatting while writing". The other ones were a little easier compared to this lol Another edit: When I select a word that's not quoted, and hit the quote key (") it automatically wraps the entire word in quotes. How do I disable this? There has been a few instances where I've had variables I wanted to convert to string literals and this is very frustrating. Sorry, keep coming back to this post because I just picked up a new project. How do I change the text color of the output box at the bottom? I have a dark background for the editor and the regular text output is black, very hard to see.
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
INIread into array of variables from dropdown
InunoTaishou replied to kartune's topic in AutoIt GUI Help and Support
Not quite sure if I'm following what you mean exactly but I think I understand what you're trying to do. Update a combobox with values based on the item selected? This might get you on the right track: #include <GUIConstants.au3> Global $aBrandsIni = ["Tools", "Items"] Global $aTools = ["Tool 1", "Tool 2", "Tool 3"] Global $aItems = ["Item 1", "Item 2", "Item 3"] Global $hMain = GUICreate("Dropdown Menus", 240, 40) Global $cboOne = GUICtrlCreateCombo("", 10, 10, 100, 20) Global $cboTwo = GUICtrlCreateCombo("", 120, 10, 100, 20) PopulateCombo($cboOne, $aBrandsIni) GUISetState(@SW_SHOW) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit 0 Case $cboOne ; Store the selected item Local $sSelection = GUICtrlRead($cboOne) ; Figure out which combobox value was selected If ($sSelection = "Tools") Then ; The "Tools" item was selected, update the second combo with the tools items PopulateCombo($cboTwo, $aTools) ElseIf ($sSelection = "Items") Then ; The "Items" item was selected, update the second combo with the items PopulateCombo($cboTwo, $aItems) EndIf EndSwitch WEnd Func PopulateCombo(Const ByRef $cboCombo, Const ByRef $aArray) Local $sItems = "" GUICtrlSetData($cboCombo, "") ; Creating the string used to set the data of the combobox: "Item 1|Item 2|Item 3|" For $i = 0 to UBound($aArray) - 1 $sItems &= $aArray[$i] & "|" Next ; Update the combobox with the new items, remove the trailing '|' GUICtrlSetData($cboCombo, StringTrimRight($sItems, 1)) EndFunc -
I just opened this up and updated after a while, to start a new project. Would you get rid of, or make an option to turn off, the ISN Studio automatically adding a space after some of the key characters, like the equal sign "=" and comma ","? Also, if you try to type #include-once it automatically adds a space before the dash "-" character. This prevents you from actually typing out #include-once Very annoying features/bugs. I actually had to stop using the studio because this was seriously messing with my ability to type code lol....
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
How to change text color on a button with image?
InunoTaishou replied to misioooo's topic in AutoIt GUI Help and Support
It's been a while but I don't think you can change the text of buttons that use a bitmap. You can add text to the bitmap before you set it to the button, like UEZ does in this topic -
Was bored, this would get you started #include <Crypt.au3> #include <GUIConstants.au3> #include <File.au3> #include <WindowsConstants.au3> #include <WinAPIShellEx.au3> #include <GuiEdit.au3> #include <MsgBoxConstants.au3> _Crypt_Startup() ; Declare SHA_256 because AutoIt has it commented out in the Crypt.au3 file by default Global Const $sCryptKey = "~!Th1s f1l3 1s pr0t3t3ed!~" Enum $idProcEdit = 1000 Global $hNewWindowProc = DllCallbackRegister("NewWindowProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr") Global $pNewWindowProc = DllCallbackGetPtr($hNewWindowProc) Global $hMain = GUICreate("Encrypt Reader Pro", 800, 600) Global $hMenu = GUICtrlCreateMenu("&File") Global $idOpen = GUICtrlCreateMenuItem("Open", $hMenu) Global $idCloseFile = GUICtrlCreateMenuItem("Close", $hMenu) Global $idSave = GUICtrlCreateMenuItem("Save", $hMenu) Global $idSaveAs = GUICtrlCreateMenuItem("Save As...", $hMenu) Global $edtEditor = GUICtrlCreateEdit("", 0, 0, 800, 580) Global $hEditor = GUICtrlGetHandle($edtEditor) Global $sFileName = "" GUISetState(@SW_SHOW, $hMain) _WinAPI_SetWindowSubclass($hEditor, $pNewWindowProc, $idProcEdit) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE CloseEditor() Case $idOpen Open(FileOpenDialog("Open File", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Crypt Files (*.crpt)")) Case $idCloseFile GUICtrlSetData($edtEditor, "") Case $idSave Save($sFileName) Case $idSaveAs Local $sTmp = FileSaveDialog("Save File As", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Crypt Files (*.crpt)") If (Not @error) Then If (FileExists($sTmp)) Then If (MsgBox($MB_YESNO, "Overwrite?", "That file already exists. Would you like to overwrite it?") = $IDYES) Then $sFileName = $sTmp ContinueLoop EndIf Else $sFileName = $sTmp EndIf Save($sFileName) EndIf EndSwitch WEnd Func CloseEditor() _WinAPI_RemoveWindowSubclass($hEditor, $pNewWindowProc, $idProcEdit) Exit 0 EndFunc Func Open(Const $sOpenFile) If (FileExists($sOpenFile)) Then Local $hFile = FileOpen($sOpenFile) Local $sData = FileRead($hFile) If ($sData) Then GUICtrlSetData($edtEditor, BinaryToString(_Crypt_DecryptData($sData, $sCryptKey, $CALG_AES_256))) EndIf EndIf EndFunc Func Save(Const $sSaveFile) If ($sSaveFile) Then Local $hFile = FileOpen($sSaveFile, $FO_OVERWRITE) Local $sData = GUICtrlRead($edtEditor) If ($sData) Then FileWrite($hFile, _Crypt_EncryptData($sData, $sCryptKey, $CALG_AES_256)) FileClose($hFile) EndIf EndIf EndFunc Func NewWindowProc($hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData) #forceref $hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData Switch ($uIdSubclass) Case $idProcEdit Switch ($iMsg) Case $WM_CHAR ; Ctrl+A If ($wParam = 1) Then Return _GUICtrlEdit_SetSel($hWnd, 0, -1) ; Ctrl+S ElseIf ($wParam = 19) Then If (not $sFileName) Then Local $sTmp = FileSaveDialog("Save File As", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Crypt Files (*.crpt)") If (Not @error) Then If (FileExists($sTmp)) Then If (MsgBox($MB_YESNO, "Overwrite?", "That file already exists. Would you like to overwrite it?") = $IDYES) Then $sFileName = $sTmp EndIf Else $sFileName = $sTmp EndIf EndIf EndIf Return Save($sFileName) EndIf Case $WM_COPY ConsoleWrite("User tried to copy me!" & @LF) ; Return 0, we don't want the copy to go through! Return 0 Case $WM_KEYUP EndSwitch EndSwitch Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc
-
Call GUI button from external AU3
InunoTaishou replied to DigDeep's topic in AutoIt GUI Help and Support
I would highly recommend not doing exactly what you're doing, very very bad formatting of your code and anyone that sees it may get very confused (you might even confuse yourself in the future). A better idea be to create all the controls but hide the ones you don't want shown. But the way to do what you want is to create the $Button2 and $Label2 variables global first. $Form2 = GUICreate("Form2", 530, 580, 734, 184) $Label1 = GUICtrlCreateLabel("Lable 1", 80, 40, 353, 50, $SS_CENTER) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Go to Lable 2", 224, 192, 75, 25) Global $Button2 = 0, $Label2 = 0 Also, you can't click the buttons in your example because the label is on top of the button. So you can't click it -
Yup, didn't say it was the best way to check integrity, just a quicker way. Just warning if someone was trying to use this to monitor dozens of files that may be hundreds of mbs each. Since autoit cannot multi thread and create a process to hash each one, hashing each one of them, sequentially, is going to take a while (I tried a long time ago on about 100 files that were a few gbs each and it took, I think, around 40 minutes to do them all, can't remember the exact time since it was so long ago).
-
Hashing is a very good way to check the integrity of a file but something that should be noted is hashing large files will make this slow. The Hash function hashes the first 524,288 characters (roughly 4mb if my math is correct); doesn't seem like a lot but then it's going to run that string through the actual hashing algorithm. A quicker way would be just to check the Date Modified, Date Created attributes, and size of the file.
-
Well here's a very very simple one, that shows the concept. #include <GUIConstants.au3> #include <WindowsConstants.au3> Global $hMain = GUICreate("Main Window", 400, 600) Global $hChild = GUICreate("Child Window", 200, 600) GUIRegisterMsg($WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGING) GUISetState(@SW_SHOW, $hMain) GUISetState(@SW_SHOW, $hChild) WinMove($hMain, "", 0, 0) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_WINDOWPOSCHANGING($hWnd, $iMsg, $wParam, $lParam) Local $tWindowPos = DllStructCreate("uint;uint;int;int;int;int;uint", $lParam) Local $iLeft = DllStructGetData($tWindowPos, 3) Local $iTop = DllStructGetData($tWindowPos, 4) Local $iWidth = DllStructGetData($tWindowPos, 5) Local $iHeight = DllStructGetData($tWindowPos, 6) Local Static $iLastX = 0 Local Static $iLastY = 0 Switch ($hWnd) Case $hChild DllStructSetData($tWindowPos, 3, $iLastX) DllStructSetData($tWindowPos, 4, $iLastY) Case $hMain WinMove($hChild, "", $iLeft + $iWidth, $iTop) $iLastX = $iLeft + $iWidth $iLastY = $iTop EndSwitch EndFunc
-
It's way too late for me to write out the example but you can look at using GUIRegisterMsg($WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGING) Func WM_WINDOWPOSCHANGING($hWndFrom, $iMsg, $wParam, $lParam) Local $stWinPos = DllStructCreate("uint;uint;int;int;int;int;uint", $lParam) Local $iLeft = DllStructGetData($stWinPos, 3) Local $iTop = DllStructGetData($stWinPos, 4) Local $iWidth = DllStructGetData($stWinPos, 5) Local $iHeight = DllStructGetData($stWinPos, 6) EndFunc This will let you know when a GUI is being moved to adjust the other GUI, or not allow the move (using DLLStructSetData will set the position of the window and interrupt the actual move).
-
Change both sleep time at once
InunoTaishou replied to naru's topic in AutoIt General Help and Support
Don't worry about it, a mod will close the second topic. Or we can just stop posting in it -
Change both sleep time at once
InunoTaishou replied to naru's topic in AutoIt General Help and Support
Answered OP's question in a different thread earlier