EKY32 Posted December 14, 2014 Posted December 14, 2014 Hello, is it possible to get the prompt text direction RTL in the InputBox? Thank you. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
UEZ Posted December 14, 2014 Posted December 14, 2014 Try $WS_EX_LAYOUTRTL extended style for the input control. Br,UEZ 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
EKY32 Posted December 15, 2014 Author Posted December 15, 2014 Hello, sorry UEZ, I mean the Input Box not the input control. InputBox("Question", "This text should be RTL", "Planet Earth") [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
Solution funkey Posted December 16, 2014 Solution Posted December 16, 2014 expandcollapse popup#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 _WinAPI_UnhookWindowsHookEx($hHookInputBox) DllCallbackFree($hProcInputBox) 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 EndIf 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)) EndSwitch Return EndFunc ;==>CbtHookProcInputBox EKY32 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
EKY32 Posted December 16, 2014 Author Posted December 16, 2014 You are amazing people! [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now