Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/01/2025 in all areas

  1. Uploaded a new beta for au3check, which will now also allow mixed encoding for include files, which was also an issue. This should now allow for use of au3check in VSCode without any wrapper showing a valid filename in Problems. Let me know when there are still issues with its use in VSCode.
    3 points
  2. The regular distribution is with the Autoit3 installer which is controlled by Jon and no plans for any new releases as far as I know, so yes my plan for now is to distribute the updated one via the SciTE installer as that one is the only one I control. One could either use that field or simply copy my version to replace the original distribution to make things work. No need to investigate as Ctrl+F5 runs AutoIt3Wrapper which currently uses the au3check version in the AutoIt3 directory. This is one of those things I will adapt in AutoIt3Wrapper to make it work. Still need to look at this to consider the smart approach for this, but honestly maybe we should not use AutoIt3Wrapper at all anymore for au3check (Ctrl+F5) & Tidy (Ctrl+T) and simply execute the programs directly as defined in the settings.
    1 point
  3. Also uploaded a new Beta for Tidy v23.402.1150.4 which should also be able to work with mixed encoding for include files. My plan is to remove the workaround-logic from AutoIt3Wrapper to avoid the copying of scriptfiles for processing. When this all is working fine, the plan is to release a new Version for SciTE4AutoIt3 that includes all these changes. I am still on the fence whether that should include the new AutoComplete logic for SciTE. Main goal is to get this all working in VSCode, so I might also include the Beta au3check version, so there will be a separate one in the SciTE directory, and you can choose which one to use in VSCode.
    1 point
  4. WarMan

    OCR from a small area

    in _GetText() You used Return 4 times before cleaning resources Func _GetText($iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $iNegative = 0, $iBorder = 0, $dScale = 1, $iBrightness = 0, $iContrast = 0, $sLanguageTagToUse = Default, $bUseOcrLine = False) Local $hHBitmap, $hBitmap, $hGDIPlusBitmap, $hImage, $hImageCtxt, $sOCRTextResult, $iBmpW, $iBmpH, $iBorderColor _GDIPlus_Startup() $hHBitmap = _ScreenCapture_Capture("", $iLeft, $iTop, $iRight, $iBottom, False) If @error Then _GDIPlus_Shutdown() Return SetError(1, 0, False) EndIf Local $tSIZE = _WinAPI_GetBitmapDimension($hHBitmap) $iBmpW = $dScale * DllStructGetData($tSIZE, 'X') $iBmpH = $dScale * DllStructGetData($tSIZE, 'Y') ;Default ;$iFlags=0,$iIlluminant=0,$iGammaR=10000,$iGammaG=10000,$iGammaB=10000,$iBlack=0,$iWhite=10000,$iContrast=0,$iBrightness=0,$iColorfulness=0,$iTint=0 Local $iIlluminant = 0, $iGammaR = 10000, $iGammaG = 10000, $iGammaB = 10000, $iBlack = 0, $iWhite = 10000, $iColorfulness = 0, $iTint = 0 Local $tAdj = 0 $tAdj = _WinAPI_CreateColorAdjustment($iNegative, $iIlluminant, $iGammaR, $iGammaG, $iGammaB, $iBlack, $iWhite, $iContrast, $iBrightness, $iColorfulness, $iTint) $hBitmap = _WinAPI_AdjustBitmap($hHBitmap, $iBmpW, $iBmpH, $HALFTONE, $tAdj) If @error Then _GDIPlus_Shutdown() Return SetError(2, 0, False) EndIf $hGDIPlusBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) ; Add Border If $iBorder > 0 Then $iBorderColor = _GDIPlus_BitmapGetPixel($hGDIPlusBitmap, 1, 1) ;get pixel color from 1,1 $hImage = _GDIPlus_BitmapCreateFromScan0($iBmpW + (2 * $iBorder), $iBmpH + (2 * $iBorder)) ;create an empty bitmap If @error Then _GDIPlus_BitmapDispose($hGDIPlusBitmap) _GDIPlus_Shutdown() Return SetError(3, 0, False) EndIf $hImageCtxt = _GDIPlus_ImageGetGraphicsContext($hImage) ;get the graphics context of the bitmap _GDIPlus_GraphicsSetSmoothingMode($hImageCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsClear($hImageCtxt, $iBorderColor) ;clear bitmap with color white _GDIPlus_GraphicsDrawImage($hImageCtxt, $hGDIPlusBitmap, $iBorder, $iBorder) _GDIPlus_ImageDispose($hGDIPlusBitmap) Else $hImage = $hGDIPlusBitmap EndIf $sOCRTextResult = _UWPOCR_GetText($hImage, $sLanguageTagToUse, $bUseOcrLine) Local $iError = @error ; Cleanup resources _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hGDIPlusBitmap) _GDIPlus_GraphicsDispose($hImageCtxt) _GDIPlus_Shutdown() Return SetError($iError = 0 ? 0 : 4, 0, $iError = 0 ? $sOCRTextResult : False) EndFunc ;==>_GetText
    1 point
  5. Alright, seems I have found a decent way to get to the title bar of the right window handle. I updated the code above accordingly along with the remove of the WinActivate. Tested with multiple windows/programs and ALL have responded correctly. One note I could make is that some programs (like Adobe Reader) take awhile to load, you need to wait until they are completed before making it OnTop as it will not respond to the messages. Let me know if you find anything else.
    1 point
  6. Don't worry about it. As I said, I think I have found the problem with the lost of hook (see previous post). I tested quite extensively, and (without the WinActivate) the hook resists fine.
    1 point
  7. Ok it seems to be a weird thing again. By removing the line WinActivate($hWnd) at the end of the ToggleSetOnTop function solves the problem. No idea yet on why ! Found another problem though, some programs (like calculator) don't have the right ancestor. Now I need to figure out how to get the right handle of the selected window.
    1 point
  8. Here's a script that does it with the Ctrl + Win + T hotkey. #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_Res_ProductName=WinTogleOnTop.au3 #AutoIt3Wrapper_Res_Description=Togle Window OnTop with 'Ctrl + Win + T' #AutoIt3Wrapper_Res_Fileversion=0.0.0.1 #AutoIt3Wrapper_Icon=WinTogleOnTop.ICO #include <WindowsConstants.au3> #include <WinAPISys.au3> TraySetIcon("WinTogleOnTop.ico") Opt("TrayAutoPause", 0) Global $g_ActWnd HotKeySet("#^t", "Cmd_WinTogleOnTop") ; Ctrl + Win + T" & @CRLF ;********************************** While Sleep(50) _GetActiveWindow() WEnd ;********************************** ;---------------------------------------------------------------------------------------- Func _GetActiveWindow() Local $AnyWindow = WinGetHandle("[ACTIVE]") If $g_ActWnd <> $AnyWindow Then $g_ActWnd = $AnyWindow ;ConsoleWrite("$g_ActWnd=" & $g_ActWnd & "; " & WinGetTitle($g_ActWnd) & @CRLF) EndIf EndFunc ;==>_GetActiveWindow ;---------------------------------------------------------------------------------------- Func Cmd_WinTogleOnTop() Local $iStyle = _WinAPI_GetWindowLong($g_ActWnd, $GWL_EXSTYLE) Local $iStyleTopMost = BitOR($iStyle, $WS_EX_TOPMOST) Local $aWPos = WinGetPos($g_ActWnd) If $iStyle = $iStyleTopMost Then WinSetOnTop($g_ActWnd, "", 0) ToolTip(" ", $aWPos[0], $aWPos[1], "Normal", 1) Else WinSetOnTop($g_ActWnd, "", 1) ToolTip(" ", $aWPos[0], $aWPos[1], "On top", 3) EndIf Sleep(1000) ToolTip("") EndFunc ;==>Cmd_WinTogleOnTop ;----------------------------------------------------------------------------------------
    1 point
×
×
  • Create New...