-
Posts
3,478 -
Joined
-
Last visited
-
Days Won
9
Everything posted by MrCreatoR
-
You trying to open explorer and make it transparent? This one a little bit more complicated, you need to wait for the window with the specified path, and check for new window, something like this... _Explorer_Open(@ScriptDir, 100) Func _Explorer_Open($sPath, $iTrans, $iState = @SW_MAXIMIZE) Local $iOld_WWD, $aWinList_Old, $aWinList_New $iOld_WWD = Opt('WinWaitDelay', 0) $aWinList_Old = WinList('[CLASS:CabinetWClass]') ShellExecute('EXPLORER.EXE', $sPath, '', '', $iState) WinWait('[CLASS:CabinetWClass;REGEXPTITLE:.*?' & StringRegExpReplace($sPath, '^.*\\', '') & ']') $aWinList_New = WinList('[CLASS:CabinetWClass]') For $i = 1 To UBound($aWinList_New) - 1 For $j = 1 To UBound($aWinList_Old) - 1 If $aWinList_New[$i][1] = $aWinList_Old[$j][1] Then ContinueLoop 2 EndIf Next WinSetTrans($aWinList_New[$i][0], '', $iTrans) ExitLoop Next Opt('WinWaitDelay', $iOld_WWD) EndFunc
-
Sure... _FileOpenDialog('Title', @ScriptDir, 'All (*.*)', 0, '', 0, 200) Func _FileOpenDialog($sTitle, $sInitDir, $sFilter, $iOpts = 0, $sDefName = '', $hWnd = 0, $iTrans = 255) Local $sSrc = _ "$_ = Opt('WinWaitDelay', 0) + WinSetTrans(WinWait('[CLASS:#32770;TITLE:" & $sTitle & "]', 'ShellView', 3), '', " & $iTrans & ")" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $sSrc & '"', '', @SW_HIDE) Return FileOpenDialog($sTitle, $sInitDir, $sFilter, $iOpts, $sDefName, $hWnd) EndFunc
-
Lazy method: _FileSelectFolder('Title', '', 0, @ScriptDir, 0, 200) Func _FileSelectFolder($sTitle, $sRoot, $iFlag = 0, $sInitDir = '', $hWnd = 0, $iTrans = 255) Local $sSrc = _ "$_ = Opt('WinWaitDelay', 0) + WinSetTrans(WinWait('[CLASS:#32770;TITLE:" & $sTitle & "]', 'ShellView', 3), '', " & $iTrans & ")" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $sSrc & '"', '', @SW_HIDE) Return FileSelectFolder($sTitle, $sRoot, $iFlag, $sInitDir, $hWnd) EndFunc
-
Au3Localizer - Localize AutoIt Scripts
MrCreatoR replied to MrCreatoR's topic in AutoIt Example Scripts
Major Update! -
Oh i see now, so in the Beta the $SS_CENTERIMAGE style is forced. I only pointed out that this can solve the issue for the user, but did not suggested it as a permanent solution. Sorry for that, i hope you will find a correct solution for the problem without braking other functionality .
-
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate('Form1', 300, 200, -1, -1, $WS_SIZEBOX) $PIC = GUICtrlCreatePic(@AutoItExe & '\..\Examples\GUI\msoobe.jpg', 0, 0, 300, 300) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Created image does not accept the resizing. Also if we use GUICtrlSetPos, it will move the image relative to it's current position. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate('Form1', 300, 200, -1, -1, $WS_SIZEBOX) $aPos1 = WinGetClientSize($Form1) $iPic = GUICtrlCreatePic(@AutoItExe & '\..\Examples\GUI\msoobe.jpg', 0, 0, $aPos1[0], $aPos1[1]) ;GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE $aPos = WinGetClientSize($Form1) If $aPos[0] <> $aPos1[0] Or $aPos[1] <> $aPos1[1] Then GUICtrlSetPos($iPic, 0, 0, $aPos[0], $aPos[1]) $aPos1 = $aPos EndIf WEnd In 3.3.15.1 it was working fine.
-
_Translate - Simple translation UDF for AutoIt
MrCreatoR replied to TheDcoder's topic in AutoIt Example Scripts
Now i understand, thanks for clarification. It was interesting for me to see how it takes the strings from script, i mean the logic behind detecting translatable strings and distinguish them from other strings that should not be translated. -
_Translate - Simple translation UDF for AutoIt
MrCreatoR replied to TheDcoder's topic in AutoIt Example Scripts
I don't understand, then what i should do to see the results of eci.exe? I thought that this tool can help in getting strings table quicker. Your readme files sais: So this is what i am trying to do. But no success, i don't get translatable strings. -
_Translate - Simple translation UDF for AutoIt
MrCreatoR replied to TheDcoder's topic in AutoIt Example Scripts
No. Well, i used your Extract.au3 from the archive, it runs the eci.exe only from there. -
_Translate - Simple translation UDF for AutoIt
MrCreatoR replied to TheDcoder's topic in AutoIt Example Scripts
Not working for me, eci.exe returns empty string. I use Win 10 Home x64. -
Added copy and exit to _ArrayDisplay
MrCreatoR replied to wolflake's topic in AutoIt Example Scripts
Then we do it like this: If Not $iNoRow Then __ArrayDisplay_SortItems($idListView, 0) EndIf Well, the logics says that ascending should be from up to down, so i think that the arrow as well should indicate the same. -
Added copy and exit to _ArrayDisplay
MrCreatoR replied to wolflake's topic in AutoIt Example Scripts
And if we add __ArrayDisplay_SortItems($idListView, 0) after __ArrayDisplay_RegisterSortCallBack($idListView, 2, True, "__ArrayDisplay_SortCallBack") we get this arrow displayed at the beginning (right after the array is displayed). Btw, is this arrow should be in opposite direction or i am wrong? -
Added copy and exit to _ArrayDisplay
MrCreatoR replied to wolflake's topic in AutoIt Example Scripts
In what AutoIt version? I have it in 3.3.14.5 (final release). -
Old version of DDE usage... $sURL = _OpenGetURL('Firefox') ConsoleWrite($sURL & @CRLF) Func _OpenGetURL($sServer, $sURL = "", $iWin = -1, $iRetType = 0, $iWait = 10000) Local $aRet, $uIdInst = DllStructCreate("int") Local $hServer[1], $hTopic[1], $hItem[1], $hConv[1], $hData[1], $sData[1] Local $sTopic = "WWW_OpenURL", $sItem = '"' & $sURL & '",,0x' & Hex($iWin) If $sURL = '' Then $sTopic = "WWW_GetWindowInfo" $sItem = "0x" & Hex($iWin) EndIf Local $hDll = DllOpen("user32.dll") If $hDll = -1 Then Return SetError(1, 0, "") ; Error to open Dll $aRet = DllCall($hDll, "int", "DdeInitialize", "ptr", DllStructGetPtr($uIdInst), "ptr", 0, "int", 0, "int", 0) If $aRet[0] Then Return SetError(2, $aRet[0], "") ; Error Initializing DDE $hServer = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sServer, "int", 1004) If $hServer[0] Then $hTopic = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sTopic, "int", 1004) If $hTopic[0] Then $hItem = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sItem, "int", 1004) If $hItem[0] Then $hConv = DllCall($hDll, "int", "DdeConnect", "int", DllStructGetData($uIdInst, 1), "int", $hServer[0], "int", $hTopic[0], "int", 0) If $hConv[0] Then $hData = DllCall($hDll, "int", "DdeClientTransaction", "ptr", 0, "int", 0, "int", $hConv[0], "int", $hItem[0], "int", 1, "int", 0x20B0, "int", $iWait, "ptr", 0) If $hData[0] Then $sData = DllCall($hDll, "str", "DdeAccessData", "int", $hData[0], "ptr", 0) EndIf EndIf EndIf EndIf $iErr = DllCall($hDll, "int", "DdeGetLastError", "int", DllStructGetData($uIdInst, 1)) If $hData[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hData[0]) If $hConv[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hConv[0]) If $hItem[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hItem[0]) If $hTopic[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hTopic[0]) If $hServer[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hServer[0]) If $iErr[0] Then Return SetError(3, $iErr[0], "") ; Other DDE Errors DllCall($hDll, "int", "DdeUninitialize", "int", DllStructGetData($uIdInst, 1)) DllClose($hDll) If StringRight($sData[0], 3) = ',""' Then $sData[0] = StringTrimRight($sData[0], 3) If $sURL = '' Then $sURL = StringRegExpReplace($sData[0], '^"([^"]*?)".*', '"\1"') If $iRetType = 1 Then Local $sRetTitle = StringReplace(StringTrimLeft($sData[0], StringLen($sURL) + 1), '\"', '"') Local $aRetArr[3] = [$sRetTitle, $sURL, StringReplace($sData[0], '\"', '"') ] Return $aRetArr EndIf Return $sURL EndFunc
-
Step through and rewrite Json
MrCreatoR replied to wisem2540's topic in AutoIt General Help and Support
Which one? I have tried few, but on the fragment from the first post they are not working. -
Step through and rewrite Json
MrCreatoR replied to wisem2540's topic in AutoIt General Help and Support
Something like this? $sJSON = ClipGet() ;This is the json string $aRet = StringRegExp($sJSON, '(?s)("[^"]+": {.*?})', 3) $sFind = 'Fox 2' For $sStr In $aRet If StringRegExp($sStr, '"name": ".*' & $sFind & '.*",') Then $sRep = StringRegExpReplace($sStr, '("x-update-channel-icon": )false', '\1true') $sRep = StringRegExpReplace($sRep, '("x-update-channel-name": )false', '\1true') $sJSON = StringReplace($sJSON, $sStr, $sRep) EndIf Next ConsoleWrite($sJSON & @CRLF) -
StringRegExp - Verbatim sequence
MrCreatoR replied to HurleyShanabarger's topic in AutoIt General Help and Support
The idea is to allow to escape not all chars. I disagree (in this case yes, but sometimes no). -
StringRegExp - Verbatim sequence
MrCreatoR replied to HurleyShanabarger's topic in AutoIt General Help and Support
Why? You are using it wrong, this param is to specify particular chars to escape... $p = _StringRegExpEscapeChars($sUserPattern_1, "\\\(\)") -
StringRegExp - Verbatim sequence
MrCreatoR replied to HurleyShanabarger's topic in AutoIt General Help and Support
The best solution is to escape specials chars: Dim $sText_1 = "C:\Test (example)\Everything" Dim $sUserPattern_1 = "Test (example)\Every" ConsoleWrite(StringRegExp($sText_1, "^.+?" & _StringRegExpEscapeChars($sUserPattern_1) & ".+?$") & @TAB & "No problem here" & @CRLF) Dim $sText_2 = "C:\Test (example)\Fallout" Dim $sUserPattern_2 = "Test (example)\Fall" ConsoleWrite(StringRegExp($sText_2, "^.+?" & _StringRegExpEscapeChars($sUserPattern_2) & ".+?$") & @TAB & "No problem here" & @CRLF) Func _StringRegExpEscapeChars($sString, $sChars = '') If StringStripWS($sChars, 8) = '' Then $sChars = '\]\[<>\^\\.+*?$(){}=!|:' EndIf Return StringRegExpReplace($sString, '([' & $sChars & '])', '\\\1') EndFunc -
Ctrl C doesn't work, help me please(
MrCreatoR replied to KTiger's topic in AutoIt General Help and Support
The problem perhaps is with your keyboard layout set by default, as i see it (from your screenshot), you have Russian system, so probably the default keyboard layout is Russian, to fix it use this (set English as default at start, and reset to the previous one at the end): #include-once #include <WinAPIEx.au3> Global $iKbrdLayout, $aKbrdLayouts OnAutoItExitRegister('__HotKeySendFix_OnExit') __HotKeySendFix_OnStart() Run("notepad.exe") sleep(1000) Send("OK") sleep(1000) Send("^a") send("^c") send("^v") Func __HotKeySendFix_OnStart() $iKbrdLayout = 0x0409 ;English $aKbrdLayouts = _WinAPI_GetKeyboardLayoutList() _WinAPI_LoadKeyboardLayout($iKbrdLayout, $KLF_ACTIVATE) EndFunc Func __HotKeySendFix_OnExit() For $i = 1 To Ubound($aKbrdLayouts) - 1 If Hex($iKbrdLayout) = Hex('0x' & StringRight($aKbrdLayouts[$i], 4)) Then Return EndIf Next _WinAPI_UnloadKeyboardLayout($iKbrdLayout) EndFunc -
New version(s)... Sorry for delay, but this is the second update since last version, i just forgot to publish it here.
-
#include <GuiMenu.au3> ; Create GUI. $hGUI = GUICreate("Autoit GUI", 200, 100) ; Create menu and item. Local $menu = GUICtrlCreateMenu("&Click here") GUICtrlCreateMenuItem("none", $menu) $hMenu = _GUICtrlMenu_GetMenu($hGUI) _GUICtrlMenu_SetMenuStyle($hMenu, $MNS_MODELESS) ; Crate label to control progress. Local $label = GUICtrlCreateLabel("Working: ", 60, 30, 160) ; Set start time point script. Local $startPoint = 0 ; Show GUI. GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 ; Set new time to label. GUICtrlSetData($label, "Working: " & $startPoint & "%") ; add point $startPoint += 1 ; When point is above 100 reset If $startPoint >= 100 Then $startPoint = 0 ; Listen signal from GUI. Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd
- 14 replies
-
- menu pause
- menus stop
-
(and 1 more)
Tagged with:
-
Great, i will test it soon, thanks for sharing!
- 18 replies
-
- idispatch
- irunningobjecttable
-
(and 3 more)
Tagged with:
-
I didn't tested it yet, but can we pass arrays, objects that way?
- 18 replies
-
- idispatch
- irunningobjecttable
-
(and 3 more)
Tagged with:
-
Remember SciTE Find & Replace and Undo history
MrCreatoR replied to MrCreatoR's topic in AutoIt Technical Discussion
Is this implemented in the core of the SciLexer? or it can be done via Lua scripts?