Jump to content

Can't type another language to GUICtrlCreateInput or GUICtrlCreateEdit


Recommended Posts

I'm Vietnamese. I have "Unikey" - a software to type Vietnamese language to anywhere I can type in window 10.

Example: I type: aa it's show â, type as it's show á,... aas --> ấ, eex --> ễ. dd --> đ.....

I can type Vietnamese language like this to notepad, word, excel, window, folder name, web browser, ... But I can't type like this to Input or Edit in autoit Gui.

How I can type Vietnamese language like this to Input or Edit in autoit Gui. I choosed UTF-8 with Bom but I just can type Vietnamese language in Scite Script Editor, I can't type Vietnamese language to Input or Edit in autoit Gui. Please help...

 

#include <GUIConstantsEx.au3>

$gui=GUICreate('new',420,260,430,200)
$input=GUICtrlCreateInput('',10,10,400,20)
$edit=GUICtrlCreateEdit('',10,40,400,200)
GUISetState()

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
Until False
 

Link to comment
Share on other sites

I believe the problem comes from using Unikey software, which translates recently typed characters into a new character.  AutoIt (with HotKeySet and other means) is probably interfering with Unikey.  I do not think that it is a font issue.

Link to comment
Share on other sites

I dont use hotkeyset in script. I say wrong a little, I choosed UTF-8 with Bom but I can't type Vietnamese language in Scite Script Editor too. I just can type Vietnamese language to notepad and cut it to Scite Script Editor, and it's show Vietnamese corectly. I use like GUICtrlSetData($edit,"Tiếng Việt")  and press F5 it show vietnamese corectly too. But I can't type Vietnamese language append that text.

Link to comment
Share on other sites

Link to comment
Share on other sites

I'm newbie I can't edit this post. I create new.

When I open notepad in start menu and use: Send(" as as") it show " á á" .

when I open notepad by Autoit and use 

Run('notepad.exe')
$hwnd=WinWait('Untitled')
Send(" as as")

It show " as as"

I think problem maybe is Autoit...

So, I still dont know how to type vietnamese language to edit/input. Thanks for all replies :)

Link to comment
Share on other sites

Try to use ControlSend() instead of Send()

according to this remark in AutoIt's helpfile for Send()

 

Quote

When running a script on a remote computer through a program as psexec (www.sysinternals.com) or beyondexec (www.beyondlogic.org) it is necessary, specially when sending strokes to a program launch by the script with a Run() function, to use ControlSend() or other ControlXXX functions to directly communicate with the control. Send() even with Opt("SendAttachMode", 1) will not work.

 

Link to comment
Share on other sites

Also try to use SendKeepActive()

and finally try to split your sent string by StringSplit() and send it to your target window (Notepad) one char by one char like this:

Run('notepad.exe')
$hwnd=WinWait('Untitled')
MySend(" as as")

Func MySend($s)
    $s = StringSplit($s,'')
    For $i = 1 To $s[0]
        Send($s[$i])
    Next
EndFunc

 

Link to comment
Share on other sites

I think you are mixing things up.  Unless I do not understand your issue, you are not sending keys to your GUI, you are typing it, right ?  Sending keys to another process (whatever the way you started it) does not prove anything.

Link to comment
Share on other sites

I'm not mixing things up. I just want type Vietnamese language in input/edit of my gui . And @Nine said: "it is interfering..." so I just check what he said. By open notepad by autoit and StartMenu so it's different between 2 ways, I've just test that after he said and I wrote what I've tested. I think autoit affect to window "notepad" or window "gui" so I can't type vietnemse language. I used controlsend and send each character (insert each sleep(1000) between them), it can't type vietnamese too.

If you want test or check what I say, you  can download run unikey to test or check. It's safe, whole vietnamese people use this: https://www.unikey.org/assets/release/unikey43RC5-200929-win64.zip. You can run it and choose like this image, change tray icon unikey from "E" to "V" to type vietnamese language, example: type : "as" it's show "á", "vieejt nam" it's show "việt nam". It's take your time so much, maybe you don't test or check. But i'm just telling you to understand what is my problem:  "I just want type Vietnamese language in input/edit of my gui"

unikey.png

Link to comment
Share on other sites

OK, Lets just forget about UniKey.  I did not write this software so I cannot tell how it reads the keyboard.  All I am saying is that UniKey is probably not compatible with AutoIt.

If you absolutely need this kind of functionality using AutoIt, I suggest you write your own "UniKey" in AutoIt and embed the code within your GUI.  That will solve your problem.  To start you up see _WinAPI_SetWindowsHookEx example in AutoIt help file.  Put something together, then we will be able to help you effectively. 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...