Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/09/2013 in all areas

  1. The number you're getting is base 10, the number you're comparing it to is base 16 (Hex). You can directly compare them, as they are converted when compared to be the same base. BTW, black is 0x000000, not 0xFFFFFF that is bright white.
    2 points
  2. Wombat, I understand and empathize with your motives - I recently landed a new customer by showing I have at least a baseline knowledge in a language they use (GOSU). Just be careful not to oversell yourself; you don't want to present a top notch program if you don't understand what makes it so. Whatever you end up presenting, make sure you understand the mechanics (i.e. how a GUI is built, how a search for files works, etc.), rather than presenting a wall of code you cannot explain. Good luck.
    2 points
  3. AZJIO

    Create list of files

    Create list of files (En+Ru) Create_list_files.7z (330kb, sources + EXE, v0.5, En+Ru) Utility designed to create a list of files specified directory. The list may be a combination of available parameters (name, path, size, hash, date, any text). The utility itself has no effect on the files, just create a list. The contents of the list defines the pattern. Combination of elements can be in any order with multiple repetitions of the same elements. Use "tab" as a separator to be able to edit the list in the table editor, such as Microsoft Excel. When sorting takes into account elements that are not in the template. Getting the hash is much slower than getting any other parameters, and directly proportional to the size of the files.
    1 point
  4. careca, I drop multiple files on a GUI like this: ; Global Declaration Global $aDrop_List ; React to items dropped on the GUI Func On_WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) ; Credit to ProgAndy for DLL calls #forceref $hWnd, $iMsg, $lParam Local $iSize, $pFileName ; Get number of files dropped Local $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 0) ; Reset array to correct size Global $aDrop_List[$aRet[0] + 1] = [$aRet[0]] ; And add item names For $i = 0 To $aRet[0] - 1 $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $iSize = $aRet[0] + 1 $pFileName = DllStructCreate("wchar[" & $iSize & "]") DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $iSize) $aDrop_List[$i + 1] = DllStructGetData($pFileName, 1) $pFileName = 0 Next ; Send the count to trigger the drop function in the main loop GUICtrlSendToDummy($cDrop_Dummy, $aDrop_List[0]) EndFunc ;==>On_WM_DROPFILES ; And $aDrop_List has a [0] count array of the files dropped I hope it might be of use. M23
    1 point
  5. Hi, I am a new user at autoitscript and really wants to thank all the people here for their support.
    1 point
  6. Here another method: ConsoleWrite(Check("abcde812") & @LF) ConsoleWrite(Check("abcde8112") & @LF) ConsoleWrite(Check("abcd-e8112-11") & @LF) ConsoleWrite(Check("---43") & @LF) Func Check($sString, $iDigits = 4, $iHyphens = 2) Local $a = StringRegExp($sString, "[\d]", 3) Local $b = StringRegExp($sString, "[-]", 3) Return BitAND((UBound($a) >= $iDigits), (UBound($b) >= $iHyphens)) EndFunc Br, UEZ
    1 point
  7. michaelslamet, You do not need any additional styles - you just need to make the column width wider than the ListView to get horizontal scrollbars: #include <GUIConstantsEx.au3> #include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $cListView = GUICtrlCreateListView('Files', 10, 10, 380, 230) _GUICtrlListView_SetColumnWidth($cListView, 0, 500) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlCreateListViewItem("This is a very long ListView item and therefore should require scrollbars to see it all", $cListView) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndYou might think of using my StringSize UDF to calculate the length of the each ListView item and make sure you set the column width to be slightly greater than the longest. M23
    1 point
  8. michaelslamet, Something like this should do the trick: Global $aTest[4] = ["abcde812", "abcde8112", "abcd-e8112-11", "---43"] $iDigits = 4 $iHyphens = 2 For $i = 0 To 3 $sTest = $aTest[$i] $fValid = True ; Count digits StringRegExpReplace($sTest, "[0-9]", "") If @extended < $iDigits Then $fValid = False EndIf ; Count hyphens StringReplace($sTest, "-", "", 0, 2) If @extended < $iHyphens Then $fValid = False EndIf If $fValid Then MsgBox(0, $sTest, "Valid!") Else MsgBox(0, $sTest, "Not valid") EndIf Next All clear? M23
    1 point
  9. RonnieK, Stop acting the martyr - it is patently obvious that you have not even looked at the Help file for that command or you would not have tried to use: Control Send ("+{TAB 11}") as it bears no resemblance at all to the syntax required for ControlSend - you do not need many posts at all to realise that. Did you even read what JLogan3o13 said above? Let me repeat it for you: "Take a look at ControlSend in the help file. It is much more reliable than Send, and doesn't rely on the window being active" So I suggest you stop acting all injured and go read about ControlSend. if you have questions about the necessary syntax for the command or about how you find the parameter values, then do please ask again. M23
    1 point
  10. I'm not sure you need all that GUI goodness to do what you're describing (you can certainly build the GUI around it, once you learn the mechanics). I would suggest using Melba's' RecFileListToArray: http://www.autoitscript.com/forum/index.php?showtopic=126198. Something like this should get you started: #include <Array.au3> #include <RecFileListToArray.au3> $var = InputBox("Search Engine", "Please enter the name of the file you're looking for") $dir = FileSelectFolder("Search Engine", "C:\") Local $aArray = _RecFileListToArray($dir, $var & "*", 1, 1, 1, 2) _ArrayDisplay($aArray)
    1 point
  11. Ok, i think this might help, searches for all "au3" files in the script dir, check it out, you need an include: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\Pictures\StormCopper_Icon.ico #AutoIt3Wrapper_Outfile=StormCopperTSE.exe #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <RecFileListToArray.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) #Region ### START Koda GUI section ### Form=C:\Users\Wombat\StormCopper Work\stormcopper search engine.kxf $Form1_1 = GUICreate("Trumpf500 Search Engin", 312, 149, 753, 520, -1, BitOR($WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE)) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1_1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1_1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1_1Restore") $Label1 = GUICtrlCreateLabel("Trumpf500 Search Engine", 8, 8, 213, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x3399FF) GUICtrlSetOnEvent(-1, "Label1Click") $Input1 = GUICtrlCreateInput("*.au3", 8, 40, 209, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Button2 = GUICtrlCreateButton("Button2", 32, 72, 161, 57, $BS_ICON) GUICtrlSetImage(-1, "C:\Users\Wombat\Pictures\search.ico", -1) GUICtrlSetOnEvent(-1, "Button2Click") $Button1 = GUICtrlCreateButton("Close", 248, 8, 59, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Button1Click() Exit EndFunc Func Button2Click() $ReadInput1 = GUICtrlRead($Input1) $aList = _RecFileListToArray(@ScriptDir, $ReadInput1, 1, 1, 1, 2) If IsArray($aList) Then _ArrayDisplay($aList, "$FileList") EndIf EndFunc Func Form1_1Close() Exit EndFunc Func Form1_1Maximize() EndFunc Func Form1_1Minimize() EndFunc Func Form1_1Restore() EndFunc Func Input1Change() EndFunc Func Label1Click() EndFunc
    1 point
  12. This function will find the appropriate typelib file and extract enumerated constants from it and assign them to AutoIt constants in your script. This is useful for scripts that use COM to interface with the likes of InternetExplorer.Application, Word.Application or Excel.Application (good for translating VBA samples or Office Macros into AutoIt). Beware that it can take a bit to run (20 seconds or more sometimes) so you may want to generate an external include file instead of running this each time. See the next reply for a VBScript to generate an include file for VBS, Javascript or AutoIt. See second code block below for a script to generate an include file for VBS, Javascript or AutoIt (VBScript sample converted by JerryD). Thanks to Sven for fixing a COM bug to make this work and for pointing out how to do the real-time constant assignment. Dale Edit: This code relies upon the redistributable file TlbInf32.dll which ships with Visual Studio and modern versions of Microsoft Office. For help on using this library, see here: Help Files for Tlbinf32.dll. Tlbinf32.dll can be found in many places on the web, here is one.. If you download the dll, make certaint that you also register it -- e.g. regsvr32 tlbinf32.dll #cs Func AssignCOMEnums($sApp [, $bShow]) ABSTRACT: Retrieve the Enumerated Constants for an Applcation Class and assign their values to AutoIt3 global variables Example: AssignCOMEnums("Excel.application", 1) REQUIRED: $sApp - string containing the class name. Ex. "Excel.application" OPTIONAL: $bShow - if set to 1, ConsoleWrite will display the resulting constants and their associated values #ce Func AssignCOMEnums($sApp, $bShow = 0) Dim $oTLA, $oTLI, $CstEnum, $CstObj, $CstString, $sApp, $oApp, $bShow $oApp = ObjCreate($sApp) $oTLA = ObjCreate("TLI.TLIApplication") $oTLI = $oTLA.InterfaceInfoFromObject($oApp).Parent For $CstEnum in $oTLI.Constants If "_" <> StringLeft($CstEnum.Name, 1) Then For $CstObj In $CstEnum.Members Assign("$" & $CstObj.Name, $CstObj.Value, 2) If $bShow Then ConsoleWrite("$" & $CstObj.Name & " = " & Eval("$" & $CstObj.Name) & @CR) Next EndIf Next EndFuncoÝ÷ Ù'+m¢§z¶­y©âÉnuçâçè­PR%«ÚIÊâ¦Ú+ëh"Ö®¶­sb6æ6ÇVFRfÇCµ7G&æræS2fwC°¤÷Bb33´×W7DFV6Æ&Uf'2b33²Â¤vÆö&Âb33cµFFÆRÂb33cµ&W` ¤b7G&æu&vB67&DæÖRÂBÒb33²æWRb33²FVà¢b33cµ&WbÒfÆTvWEfW'6öâ67&DgVÆÅF¤VÇ6P¢b33cµ&WbÒb33³ããb33°¤VæD` ¢b33cµFFÆRÒb33µô76vä4ôÔVçV×5FW7BFW7Bb33²fײb33cµ&W` ¤7&VFTæ6ÇVFTfÆRb33´çFW&æWDWÆ÷&W"äÆ6Föâb33²ÂgV÷C¶S2gV÷C²Âb33´çFW&æWDWÆ÷&W"æS2b33²ÂG'VR ¤gVæ27&VFTæ6ÇVFTfÆRb33c·5&ötBÂb33c·67$BÂb33c·4÷WDfÆRÂb33c¶%6÷tÖÖVFFR¢FÒb33c·7G$6öç7G0¢b33c·7G$6öç7G2Ò&WGW&åFÆ$VçV×4g&öÕ&ötBb33c·5&ötBÂb33c·67$B¢bb33c·7G$6öç7G2Òb33²b33²FVâW@¢fÆUw&FRb33c·4÷WDfÆRÂb33c·7G$6öç7G2¢bb33c¶%6÷tÖÖVFFRFVà¢'VâgV÷C¶æ÷FWBgV÷C²fײb33c·4÷WDfÆR¢VæD`¤VæDgVæ2³ÓÒfwC´7&VFTæ6ÇVFTfÆR ¤gVæ2&WGW&åFÆ$VçV×4g&öÕ&ötBb33c·5&ötBÂb33c·67$B¢FÒb33cµDÄÂb33cµDÄÂb33c´77DVçVÒÂb33c´77Dö&¢Âb33c´77E7G&ærÒb33²b33²Âb33c´6ô6Ç2Âb33c·d77BÂb33c·dVæFÂÂb33c·d6×BÂb33c·e&P¢b33c´6ô6Ç2Òö&¤7&VFRb33c·5&ötB¢bäõB4ö&¢b33c´6ô6Ç2FVà¢×6t&÷Âb33cµFFÆRÂgV÷C´6÷VÆFâb33·B7&VFRö&¦V7Bb33c´6ô6Ç2g&öÒb33c·5&ötBgV÷C²fײb33c·5&ötBfײb33²b33²¢&WGW&âb33²b33°¢VæD`¢b33cµDÄÒö&¤7&VFRgV÷CµDÄåDÄÆ6FöâgV÷C²¢b4ö&¢b33cµDÄFVà¢b33cµDÄÒb33cµDÄäçFW&f6Tæfôg&öÔö&¦V7Bb33c´6ô6Ç2å&Vç@¢vWDÆæu&×2b33c·67$BÂb33c·d77BÂb33c·dVæFÂÂb33c·d6×BÂb33c·e&R¢b33c´77E7G&ærÒ'VÆDçG&òb33c·5&ötBÂb33cµDÄä6öçFæætfÆRÂb33c·d6×B¢f÷"b33c´77DVçVÒâb33cµDÄä6öç7FçG0¢bgV÷CµògV÷C²fÇC²fwC²7G&ætÆVgBb33c´77DVçVÒäæÖRÂFVà¢b33c´77E7G&ærÒb33c´77E7G&ærfײ5$Äbfײb33c·d6×Bfײb33c´77DVçVÒäæÖRfײ5$Ä`¢f÷"b33c´77Dö&¢âb33c´77DVçVÒäÖVÖ&W'0¢b33c´77E7G&ærÒb33c´77E7G&ærfײb33c·d77BfײgV÷C²gV÷C²fײb33c·e&Rfײb33c´77Dö&¢äæÖRfײgV÷C²ÒgV÷C²fײb33c´77Dö&¢åfÇVRfײb33c·dVæFÂfײ5$Ä`¢æW@¢VæD`¢æW@¢&WGW&âb33c´77E7G&æp¢VÇ6P¢×6t&÷Âb33cµFFÆRÂgV÷C´6âb33·B7&VFRö&¦V7Bb33cµDÄgV÷C²¢&WGW&âb33²b33°¢VæD`¤VæDgVæ2³ÓÒfwCµ&WGW&åFÆ$VçV×4g&öÕ&öt@ ¤gVæ2vWDÆæu&×2b33c·67$BÂ'&Vbb33c·d77BÂ'&Vbb33c·dVæFÂÂ'&Vbb33c·d6×BÂ'&Vbb33c·e&R¢Æö6Âb33c·466U6VÆV7BÒ7G&ætÆ÷vW"b33c·67$B¢6VÆV7@¢66Rb33c·466U6VÆV7BÒgV÷C·f'2gV÷C³²ÂgV÷C·f'67&BgV÷C³ ¢b33c·d77BÒgV÷C´6öç7BgV÷C°¢b33c·dVæFÂÒgV÷C²gV÷C°¢b33c·d6×BÒgV÷C²b33²gV÷C°¢b33c·e&RÒgV÷C²gV÷C°¢66Rb33c·466U6VÆV7BÒgV÷C¶§2gV÷C³²ÂgV÷C¶§67&BgV÷C³ ¢b33c·d77BÒgV÷C·f"gV÷C°¢b33c·dVæFÂÒgV÷C³²gV÷C°¢b33c·d6×BÒgV÷C²òògV÷C°¢b33c·e&RÒgV÷C²gV÷C°¢66Rb33c·466U6VÆV7BÒgV÷C¶S2gV÷C³²ÂgV÷C¶WFöC2gV÷C³ ¢b33c·d77BÒgV÷C´6öç7BgV÷C°¢b33c·dVæFÂÒgV÷C²gV÷C°¢b33c·d6×BÒgV÷C³²gV÷C°¢b33c·e&RÒgV÷C²b33c²gV÷C°¢66RVÇ6P¢b33c·d77BÒgV÷C²gV÷C°¢b33c·dVæFÂÒgV÷C²gV÷C°¢b33c·d6×BÒgV÷C²gV÷C°¢b33c·e&RÒgV÷C²gV÷C°¢VæE6VÆV7@¤VæDgVæ2³ÓÒfwC¶vWDÆæu&×2 ¤gVæ2'VÆDçG&òb33c·5&ötBÂb33c·7'bÂb33c·d6×B¢&WGW&âb33c·d6×Bfײõ7G&æu&WVBcÂgV÷C²¢gV÷C²fײ5$Äbfײb33c·d6×BfײgV÷C´VçVÖW&FVB6öç7FçG2f÷"6ô6Æ72gV÷C²gV÷C²gV÷C²fײb33c·5&ötBfײgV÷C²gV÷C²gV÷C²gV÷C²fײ5$Äbð¢fײb33c·d6×BfײgV÷C´WG&7FVBg&öÒgV÷C²gV÷C²gV÷C²fײb33c·7'bfײgV÷C²gV÷C²gV÷C²gV÷C²fײ5$Äbfײb33c·d6×Bfײõ7G&æu&WVBcÂgV÷C²¢gV÷C²fײ5$Äb¤VæDgVæ2³ÓÒfwC´'VÆDçG&
    1 point
×
×
  • Create New...