Jump to content
Sign in to follow this  

InputBox RTL Prompt Text

Recommended Posts

Try $WS_EX_LAYOUTRTL extended style for the input control.




Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post

Link to post
Share on other sites

#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)
Global $hHookInputBox

InputBox("Standard InputBox", "Please enter some text")
_InputBox("RTL InputBox", "Please enter some text")

Func _InputBox($title, $prompt, $default = Default, $passwordchar = Default, $width = Default, $height = Default, $left = Default, $top = Default, $timeout = Default, $hwnd = Default)
    Local $hProcInputBox = DllCallbackRegister("CbtHookProcInputBox", "int", "int;int;int")
    Local $TIDInputBox = _WinAPI_GetCurrentThreadId()
    $hHookInputBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcInputBox), 0, $TIDInputBox)
    Local $iRet = InputBox($title, $prompt, $default, $passwordchar, $width, $height, $left, $top, $timeout, $hwnd)
    Local $ierror = @error
    Return SetError($ierror, "", $iRet)
EndFunc   ;==>_InputBox

Func CbtHookProcInputBox($nCode, $wParam, $lParam, $hHookInputBox)
    Local $RET = 0, $idText, $idInput
    If $nCode < 0 Then
        $RET = _WinAPI_CallNextHookEx($hHookInputBox, $nCode, $wParam, $lParam)
        Return $RET
    Switch $nCode
        Case 5 ;5=HCBT_ACTIVATE
            $idText = _WinAPI_GetDlgItem($wParam, 1002)
            $idInput = _WinAPI_GetDlgItem($wParam, 1001)
            _WinAPI_SetWindowLong($wParam, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($wParam, $GWL_EXSTYLE), $WS_EX_LAYOUTRTL))
            _WinAPI_SetWindowLong($idText, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($idText, $GWL_EXSTYLE), $WS_EX_LAYOUTRTL))
            _WinAPI_SetWindowLong($idInput, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($idInput, $GWL_EXSTYLE), $WS_EX_LAYOUTRTL))
EndFunc   ;==>CbtHookProcInputBox

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...