Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/14/2020 in all areas

  1. ...why not an external file ( .ini or .lng ) where the user can provide a translation, saving you from guessing a language you are not very familiar with. ( my 2 cents )
    2 points
  2. Predict Text UDF Working It sub classes the edit control and matches the current word through the Database & sets selection in accordance. Functions Predicts Text from an User-Defined Database. Sets the Predicted Text when Enter is pressed. * Pressing Backspace deletes the current selection. Support Editing, Overwriting, Updating, Deleting the List. Has the Feature to add New words the user types in the control, to the List. Supports Sensitive and In-Sensitive Prediction. Supports Auto-completion and Auto-Suggestion. Edit and Input controls supported >Support RichEdit Controls. Automatically limit the New Words. Supports Phrase (Post-Space) Prediction Future Updates ​Support Auto-suggestion. [Coming soon]Done Note That if you set a Password Char for the Edit Box the Prediction will automatically get Unregistered. * Enter is supported Only in Edit Controls. For Input Control the user can use GuiSetAccelerators [Thanks to M23].Check Example 3 ; #CURRENT# ===================================================================================================================== ;_RegisterPrediction ;_UpdatePredictList ;_UnRegisterPrediction ;_RegisterListingSpaceWords ;_RegisterListingNewWords ;_GetSelectedText ;_GetListCount ;_GetCurrentWord ;_GetCaretOffset ; SetSuggestion_Dimensions ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ;_New_WndProc ; AddToArray ; MakeArray ;_Edit_SubClass ;_AutoExit ;_PredictText ;_GetSpaceText ;_SetSelection ;_CtrlSetStyle ;_CtrlGetStyle ;_RemoveBit ; GetLineHeight ; Suggest_Show ; Suggest_PopuplateItems ; Suggest_SetPos ; =============================================================================================================================== Screen Shots Example 1 - Multiple Edits and Basic Functionality Example 2 - Adding New Words Example 3 - Password Char & Input Controls Example 4 - Supports Post-Space Prediction Example 5 - AutoSuggestion Please Notify for any other Updates and Bugs. ChangeLog V1.0 -First Release V1.1 -Now Supports New Words added by Pressing Enter -Supports Input Controls for Enter Key [Thanks to M23] V1.2 -Now Supports Prediction after Space -New Words are now Automatically Limited V1.3 -Converted to Iterative -Now is more faster V1.4 -Rewritten the UDF with Regular expressions. -Added support for Auto-Suggestion -Bug for incorrect insertion when inbetween typing is now cleared V1.5 -Fixed the bug for which MouseMove wasn't detected. V1.6 -Fixed: Scroll Bar unaccessible. -Fixed: Suggestion doesn't hide when space is typed in non-space text suggestion. V1.7 -Changed: Searching is now done with regular expressions. Lot of speed is increased. PredictText V1.7 v1.7 PredictText(UDF).7z Previous Downloads: 890 Regards Phoenix XL
    1 point
  3. Here a another (better ?) way than copy/paste : #include "..\WebDriver\wd_core.au3" #include "..\WebDriver\wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "..\WebDriver\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.daysoftheyear.com/?timezone_offset=nan") _WD_LoadWait($sSession) Sleep(3000) Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/header/div/div[1]/div/div[2]/h3/a") $sText = _WD_ElementAction($sSession, $sElement, 'text') Run("notepad.exe") Local $hWnd = WinWaitActive ("[CLASS:Notepad]") Local $hCtrl = ControlGetHandle ($hWnd, "", "Edit1") ControlSetText ($hWnd, "", $hCtrl, $sText)
    1 point
  4. Are you going to do home working while you are in the hospital? Maybe you can use variables as triggers: Local $trigger1 = False Adlibregister("_leftclick",10000) While 1 ;Here look for the windows ; if the window appears, unregister the function, put $trigger to True, close the window, register again the function and turn $trigger to False again Wend Func _leftclick() if $trigger1 = False Then ;click whenever you need endif Endfunc Quick and untested idea. Greets from Barcelona
    1 point
  5. Before coding I think you need to make some decisions: Do you just want to support left-to-right languages or right-to-left languages as well? How do you handle languages that need more space in a GUI than others (e.g. "food intolerance" needs more space in German: "Nahrungsmittelunverträglichkeit"). Do you want to use smaller fonts, line breaks ... to not have this literals truncated? How do you handle untranslated literals? What's the default language to use in this case? ... Many years ago (~ 2008) I have written an UDF to allow multi language error messages. it reads language dependant literals from a file, replaces placeholders with variable data and returns the string to the script. Unfortunately it doesn't handle any of the mentioned problems.
    1 point
  6. Don't make your coding difficult! ; supported languages Global Enum $LANG_EN, $LANG_RU, $LANG_DE, $LANG_FR ; give strings a readable codename instead of an error-prone index Global Enum $MSG_Close, $MSG_StdChkBox, $MSG_Quit, $MSG_ChkedBox, MSG_UnChkedBox ; array of string by language, string Global $Dictionary = [ _ [ _ ; EN "Close", _ "Standard Checkbox", _ "Quit", _ "The checkbox is checked.", _ "The checkbox is not checked." _ ], _ [ _ ; RU "близко", _ "Стандартный флажок", _ "Уволиться", _ "Флажок отмечен.", _ "Флажок не отмечен." _ ], _ [ _ ; DE "Schließen", _ "Standard-Kontrollkästchen", _ "Verlassen", _ "Das Kontrollkästchen ist aktiviert.", _ "Das Kontrollkästchen ist nicht aktiviert." _ ], _ [ _ ; FR "Fermer", _ "Case à cocher standard", _ "Quitter", _ "La case est cochée.", _ "La case n'est pas cochée." _ ] _ ] ; language in force Global $Lang ;=========================================================================== ; example use ;--------------------------------------------------------------------------- ; randomly select a language and display some strings For $i = 1 To 3 $Lang = Random($LANG_EN, $LANG_FR, 1) Use_Example() Next Func Use_Example() For $i = 1 To 3 MsgBox(0, "", $Dictionary[$Lang][Random(0, UBound($Dictionary, 2) - 1, 1)]) Next EndFunc
    1 point
  7. UEZ

    GDI + Zooming?

    This is an old script which I coded a while ago. #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Screencapture.au3> #include <WindowsConstants.au3> Global $sx, $z = 10, $sy, $mc2, $f, $scroll_x, $scroll_y Global Const $gdip_x = 0, $gdip_y = 0, $zmin = 5, $zmax = 15, $bg_c = "404040" Global Const $gdip_w = 800, $gdip_h = 600 Global $bW = $gdip_w, $bH = $gdip_h Global Const $hGUI = GUICreate("GDI+ Test", $gdip_w, $gdip_h) GUISetState() Global Const $dll = DllOpen("user32.dll") _GDIPlus_Startup() Global Const $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global Const $hBuffer_Bmp = _GDIPlus_BitmapCreateFromGraphics($gdip_w, $gdip_h, $hGraphic) Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBuffer_Bmp) _GDIPlus_GraphicsSetPixelOffsetMode($hContext, 2) ;~ _GDIPlus_GraphicsSetCompositingQuality($hContext, 2) _GDIPlus_GraphicsSetInterpolationMode($hContext, 5) Global $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $gdip_w / 2, $gdip_h / 2) Global Const $hHBitmap = _ScreenCapture_Capture("", 0, 0, $gdip_w, $gdip_h) Global Const $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) Draw2Graphic($hBmp) Zoom(2) GUIRegisterMsg($WM_MOUSEWHEEL, "_Mousewheel") Do $mc2 = MouseGetPos() While _IsPressed("01", $dll) $mc3 = MouseGetPos() If $mc2[0] <> $mc3[0] Or $mc2[1] <> $mc3[1] Then $scroll_x = ($sx + ($mc3[0] - $mc2[0]) / ($z ^ 2 / 32)) $scroll_y = ($sy + ($mc3[1] - $mc2[1]) / ($z ^ 2 / 32)) Draw2Graphic($hBmp) Zoom(2) EndIf Sleep(10) WEnd $sx = $scroll_x $sy = $scroll_y Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_MatrixDispose($hMatrix) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_BitmapDispose($hBuffer_Bmp) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_Shutdown() GUIDelete() DllClose($dll) Exit Func Draw2Graphic($hImage) Local $w, $h _GDIPlus_GraphicsClear($hContext, "0xFF" & $bg_c) If $bW <= $gdip_w And $bH <= $gdip_h Then $f = 1 _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, $gdip_w / 2 - $bW / 2 - $scroll_x, $gdip_h / 2 - $bH / 2 - $scroll_y, $bW, $bH) Else If $bW >= $bH Then $f = $bW / $gdip_w Else $f = $bH / $gdip_h EndIf $w = Floor($bW / $f) $h = Floor($bH / $f) If $w > $gdip_w Then $f = $bW / $gdip_w ElseIf $h > $gdip_h Then $f = $bH / $gdip_h EndIf _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, $gdip_w / 2 - $w / 2 - $scroll_x, $gdip_h / 2 - $h / 2 - $scroll_y, $w, $h) EndIf EndFunc ;==>Draw2Graphic Func Zoom($zoom_dir) Switch $zoom_dir Case -1 _GDIPlus_MatrixDispose($hMatrix) $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $gdip_w / 2, $gdip_h / 2) _GDIPlus_MatrixScale($hMatrix, 1 / $f, 1 / $f) $scroll_x = 0 $scroll_y = 0 Case 0 If $z > $zmin Then _GDIPlus_MatrixScale($hMatrix, 0.95, 0.95) $z -= 0.05 EndIf Case 1 If $z <= $zmax Then _GDIPlus_MatrixScale($hMatrix, 1.05, 1.05) $z += 0.05 EndIf Case 2 _GDIPlus_MatrixScale($hMatrix, 1, 1) EndSwitch _GDIPlus_GraphicsSetTransform($hContext, $hMatrix) _GDIPlus_GraphicsClear($hContext, "0xFF" & $bg_c) ;~ _GDIPlus_GraphicsDrawImage($hContext, $hBmp, -$bW / 2 + $scroll_x, -$bH / 2 + $scroll_y) _GDIPlus_GraphicsDrawImageRect($hContext, $hBmp, -$bW / 2 + $scroll_x, -$bH / 2 + $scroll_y, $gdip_w, $gdip_h) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBuffer_Bmp, $gdip_x, $gdip_y, $gdip_w, $gdip_h) EndFunc ;==>Zoom Func _Mousewheel($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0xFF880000 ;mouse wheel up Zoom(0) Return 0 Case 0x00780000 Zoom(1) Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_Mousewheel Zoom with mouse wheel, move picture around by pressing the lmb and moving mouse.
    1 point
  8. Thank You Very Much You Just Saved My Life I Have Signed Up To Say Thank You But I Think I Love Autoit So I will use my account to.
    1 point
  9. 1 point
  10. StringReplace($string, @CRLF, "") StringReplace($string, @CR, "") StringReplace($string, @LF, "") StringStripCR($string) It depends on what you need replaced.
    1 point
  11. here is what you need. Add to your code at the right place!! #include <Array.au3> $handle = ControlGetHandle("Active Screen", "", "Static1") If @error Then MsgBox(0,"ERROR","No Handle found") Exit EndIf $lpRect = DllStructCreate("int;int;int;int") $ret = DllCall("user32.dll","int","GetWindowRect","hwnd",$handle,"ptr",DllStructGetPtr($lpRect)) If @error Then MsgBox(0,"","DllCall error") Exit EndIf Dim $coords[4] $coords[0] = DllStructGetData($lpRect,1) $coords[1] = DllStructGetData($lpRect,2) $coords[2] = DllStructGetData($lpRect,3) $coords[3] = DllStructGetData($lpRect,4) _ArrayDisplay($coords,"Coordinates")
    1 point
×
×
  • Create New...