Jump to content

AZJIO

Active Members
  • Posts

    1,703
  • Joined

  • Last visited

  • Days Won

    7

AZJIO last won the day on July 10 2024

AZJIO had the most liked content!

4 Followers

About AZJIO

  • Birthday 01/01/2014

Profile Information

  • Location
    Russian

Recent Profile Visitors

2,112 profile views

AZJIO's Achievements

  1. CodeLocalizationAU3 Download: yandex, upload.ee Description: Localization of the AutoIt3 source code, translation of lines into the native language or vice versa. It was originally done for PureBasic, but by changing the character-by-character string analyzer a bit, it now works for AutoIt3. Supports command line for connecting to SciTE, Notepad++, AkelPad. Open the file via the command line or by dragging and dropping the file into the program window or using the "Open" button. Translate the lines that appear in the window on the left using QTranslate and paste the result into the right window. Check that each line has quotation marks at the beginning and at the end. Press the arrow button, the result will be in the clipboard. The "Reopen" button (red) is intended if the source code has been changed in the editor or if the line capture filter in the program settings has been changed. The "Re-read list" button (the check box button) is used if lines that should not be translated are deleted.
  2. Binary - use the second example. But I didn't take the 0x prefix into account when processing. This function cannot be applied simply by inserting it into the code, because it returns a pointer.
  3. WinGetClassList EnableExplicit Structure winparam hwnd.i title.s text.s result.s EndStructure Procedure EnumWinProc(hwnd.l, *ptr.winparam) Protected title${256} ; буфер GetWindowText_(hwnd, @title$, 256) If Asc(title$) And title$ = *ptr\title PokeL(@*ptr\hwnd, hwnd) ProcedureReturn 0 EndIf ProcedureReturn 1 EndProcedure Procedure EnumChildProc(hwnd.l, *ptr.winparam) Protected class${256}, text${256} GetClassName_(hwnd, @class$, 256) If Asc(class$) If Asc(*ptr\text) GetWindowText_(hwnd, @text$, 256) If text$ = *ptr\text *ptr\result + class$ + #LF$ EndIf Else *ptr\result + class$ + #LF$ EndIf EndIf ProcedureReturn 1 EndProcedure Procedure.s WinGetClassList(title$, text$ = "") Protected ptr.winparam ptr\title = title$ ptr\text = text$ EnumWindows_(@EnumWinProc(), @ptr) If ptr\hwnd EnumChildWindows_(ptr\hwnd, @EnumChildProc(), @ptr) ptr\result = RTrim(ptr\result, #LF$) ProcedureReturn ptr\result EndIf EndProcedure Debug WinGetClassList("Untitled — Notepad")
  4. @ghost911 Use version 6.0.4, this is the latest version that creates a compact executable file and is supported on WindowsXP. Version 6.11 the minimum size of the compiled executable file starts at 250 kb.
  5. imitation GUICtrlSetResizing()
  6. _TempFile -> TmpFile FileCreateShortcut -> CreateLink
  7. If you are interested in the SpiderBasic programming language, then look at my other projects in my signature on that forum. Sources included. You can see screenshots here
  8. Using SpiderBasic I built AutoIt3.apk. You can read more about the source here. screenshots: menu, settings, search
  9. Updated (09/26/2023)
  10. http://forum.oszone.net/post-1907424.html#post1907424 http://azjio.narod.ru/autoit3_docs/userfunctions/_NumberNumToName.htm https://www.autoitscript.com/forum/topic/142799-converting-numbers
  11. DLL Local $ErrorOutput = DllStructCreate("wchar[128]") Local $Output = DllStructCreate("wchar[1024]") Local $DeviceName ; Local Dim $aResult[5] Local $hDLL = DllOpen("PB.Ex_MTP_x64.dll") ; Local $hDLL = DllOpen("PB.Ex_MTP_x86.dll") If @error Then MsgBox(0, "", "@error") EndIf DllCall($hDLL, "int", "ExamineMTP", "ptr", DllStructGetPtr($ErrorOutput)) If @error Then MsgBox(0, "ExamineMTP", "@error") EndIf ; While 1 $aResult = DllCall($hDLL, "int", "NextMTPEntry", "ptr", DllStructGetPtr($ErrorOutput)) If @error Then MsgBox(0, "NextMTPEntry", "@error") EndIf ; If $aResult[0] Then DllCall($hDLL, "int", "MTPEntryName", "ptr", DllStructGetPtr($Output), "ptr", DllStructGetPtr($ErrorOutput)) $DeviceName = DllStructGetData($Output, 1) MsgBox(0, "", $DeviceName) ; EndIf ; Wend DllCall($hDLL, "int", "OpenMTP", "int", "1", "WSTR", $DeviceName, "ptr", DllStructGetPtr($ErrorOutput)) If @error Then MsgBox(0, "OpenMTP", "@error") EndIf DllCall($hDLL, "int", "GetMTPManufacturer", "int", "1", "ptr", DllStructGetPtr($Output), "ptr", DllStructGetPtr($ErrorOutput)) If @error Then MsgBox(0, "GetMTPManufacturer", "@error") EndIf MsgBox(0, "GetMTPManufacturer", DllStructGetData($Output, 1)) DllCall($hDLL, "int", "CloseMTP", "int", "1", "ptr", DllStructGetPtr($ErrorOutput)) DllClose($hDLL) $ErrorOutput = 0 $Output = 0 There are examples in PureBasic, but I'm too lazy to redo it.
  12. I tried to make functions for capturing text from Scintilla #include <WinAPI.au3> Global Const $SCI_GETLENGTH = 2006 Global Const $SCI_GETCHARACTERPOINTER = 2520 Global Const $SCI_GETRANGEPOINTER = 2643 Global Const $SCI_GETCODEPAGE = 2137 Global Const $SCI_GETCURRENTPOS = 2008 Global Const $SCI_GETANCHOR = 2009 Global Const $SC_CP_UTF8 = 65001 Global Const $PROCESS_ALL_ACCESS = 2035711 ; Global Const $SMTO_ABORTIFHUNG = 2 ; В оригинале на PureBasic для получения SCI_GETRANGEPOINTER используется WinAPI функция SendMessageTimeout(), ; хотя непонятно зачем, если получение указателя не является затратной по времени функцией Func GetScintillaText() Local $ReturnValue Local $tagSTRING Local $tBuffer Local $length Local $iPID, $hProcess, $iOffset ; вынести получение дескриптора за пределы функции $ScintillaHandle = ControlGetHandle('[CLASS:SciTEWindow]', "", "[CLASSNN:Scintilla1]") ; [CLASS:Notepad++] If $ScintillaHandle Then $length = _SendMessage($ScintillaHandle, $SCI_GETLENGTH, 0, 0) If $length Then $length += 2 $tagSTRING = "char strdata[" & $length & "]" ; $tagSTRING = "wchar strdata[" & $length & "]" ; $tagSTRING = "struct;wchar strdata[" & $length & "];endstruct" $tBuffer = DllStructCreate($tagSTRING) If Not $tBuffer Then ; получаем позицию данных в процессе Scintilla, чтобы прочитать данные по указателю в памяти $iOffset = _SendMessage($ScintillaHandle, $SCI_GETCHARACTERPOINTER, 0, 0) $CodePage = _SendMessage($ScintillaHandle, $SCI_GETCODEPAGE, 0, 0) If $iOffset Then _WinAPI_GetWindowThreadProcessId ($ScintillaHandle, $iPID) $hProcess = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, 0, $iPID) If $hProcess Then _WinAPI_ReadProcessMemory($hProcess, $iOffset, DllStructGetPtr($tBuffer), $length, 0) _WinAPI_CloseHandle($hProcess) $ReturnValue = DllStructGetData($tBuffer, "strdata") If $CodePage = $SC_CP_UTF8 Then ; Чтобы не тратить память на бинарную строку преобразование с помощью _WinAPI_MultiByteToWideChar $ReturnValue = _WinAPI_MultiByteToWideChar($ReturnValue, 65001, 0, True) ; $ReturnValue = StringToBinary($ReturnValue) ; $ReturnValue = BinaryToString($ReturnValue, 4) EndIf EndIf EndIf EndIf EndIf EndIf Return $ReturnValue EndFunc ; Func GetScintillaRangeText($cursor, $length) Func GetScintillaRangeText() Local $ReturnValue Local $tagSTRING Local $tBuffer Local $iPID, $hProcess, $iOffset Local $cursor, $anchor ; вынести получение дескриптора за пределы функции $ScintillaHandle = ControlGetHandle('[CLASS:SciTEWindow]', "", "[CLASSNN:Scintilla1]") ; [CLASS:Notepad++] If $ScintillaHandle Then ; вынести за скобки, чтобы функция могла захватывать диапазон не обязательно выделенный ; в кодировке UTF-8 есть однобайтовые и двубайтовые символы, поэтому позиция в байтах заданная ручками не всегда объективна, ; так как может встать на середину двухбайтового символа и результат неверный. А захват выделенного не имеет этой проблемы. ; Мы задаём в символах, а функция работает в байтах. ; Чтобы задать в символах можно попробовать получить в широких символах, а после преобразования ($CodePage) обрезать по числу символов. $cursor = _SendMessage($ScintillaHandle, $SCI_GETCURRENTPOS, 0, 0) $anchor = _SendMessage($ScintillaHandle, $SCI_GETANCHOR, 0, 0) If $anchor = $cursor Then Return "" EndIf If $anchor < $cursor Then $length = $cursor - $anchor $cursor = $anchor Else $length = $anchor - $cursor EndIf If $length Then $tagSTRING = "char strdata[" & $length & "]" ; $tagSTRING = "wchar strdata[" & $length & "]" ; $tagSTRING = "struct;wchar strdata[" & $length & "];endstruct" $tBuffer = DllStructCreate($tagSTRING) If Not $tBuffer Then ; получаем позицию данных со сдвигом к курсору в процессе Scintilla, чтобы прочитать данные по указателю в памяти $iOffset = _SendMessage($ScintillaHandle, $SCI_GETRANGEPOINTER, $cursor, 0) $CodePage = _SendMessage($ScintillaHandle, $SCI_GETCODEPAGE, 0, 0) If $iOffset Then _WinAPI_GetWindowThreadProcessId ($ScintillaHandle, $iPID) $hProcess = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, 0, $iPID) If $hProcess Then _WinAPI_ReadProcessMemory($hProcess, $iOffset, DllStructGetPtr($tBuffer), $length, 0) _WinAPI_CloseHandle($hProcess) $ReturnValue = DllStructGetData($tBuffer, "strdata") If $CodePage = $SC_CP_UTF8 Then ; Чтобы не тратить память на бинарную строку преобразование с помощью _WinAPI_MultiByteToWideChar $ReturnValue = _WinAPI_MultiByteToWideChar($ReturnValue, 65001, 0, True) ; $ReturnValue = StringToBinary($ReturnValue) ; $ReturnValue = BinaryToString($ReturnValue, 4) EndIf EndIf EndIf EndIf EndIf EndIf Return $ReturnValue EndFunc MsgBox(0, 'Весь текст', "|" & GetScintillaText() & "|") ; MsgBox(0, 'Сообщение', "|" & GetScintillaRangeText(7, 4) & "|") ; MsgBox(0, 'Сообщение', "|" & GetScintillaRangeText(8, 4) & "|") MsgBox(0, 'Выделенное', "|" & GetScintillaRangeText() & "|")
  13. Update Command line "TitlePart ClassWindow CurrentWord TestFlag" supported for 3rd party Scintilla editors. Now you can use the same executable for PureBasic, SciTE, Notepad++. In the description of the program, I added configuration files for SciTE and Notepad++ Added context menu with 5 items (Copy, Autohide, Next color, ini, Exit) Improved regular expressions, this increased the speed by almost 2 times. Calling the program again terminates the previous instance of the program. Bugfix: now precise positioning, expands collapsed code snippets.
  14. Update Regular expressions are now in the ini file
×
×
  • Create New...