If I am using wingettext I receive chinese fonts.
When I copy these chinese signs and fill them in here, they are correctly displayed.
Anyone got an idea?
Clipboard and language are correctly set to German,
chinese fonts in wingettext
chinese fonts in wingettext
Last edited by Jochen on 28 Jul 2017, 00:52, edited 1 time in total.
Re: chinese fonts in getwintext
Sounds like a unicode issue, are you running the Ansi version? MsgBox % A_IsUnicode should display 0 if that is the case.
Try upgrading/switching to the Unicode version if not already. If you are running the unicode version be sure your script is save correctly as UTF-8
Try upgrading/switching to the Unicode version if not already. If you are running the unicode version be sure your script is save correctly as UTF-8
Re: chinese fonts in getwintext
Thanks for your answer, ahk7.
MsgBox brings "1", so it is not ANSI if I understood you right.
Save was UTF-8 with signature; I changed it to only UTF-8, but had no effect.
I am using Notepad2 for editing and running the scripts.
MsgBox brings "1", so it is not ANSI if I understood you right.
Save was UTF-8 with signature; I changed it to only UTF-8, but had no effect.
I am using Notepad2 for editing and running the scripts.
Re: chinese fonts in wingettext
Do you get the wrong results for all windows or only for some? I noticed this behaviour with some versions of PSPad.
Which AHK / OS versions do you run?
Which AHK / OS versions do you run?
Re: chinese fonts in wingettext
hi just me,
- only for some windows (partially I already noticed a chinese font in a 16Bit Windows Program title)
- AHK 1.1.25.01 (regarding Windows - Programs and functions)
- Win7Pro 32 bit
- only for some windows (partially I already noticed a chinese font in a 16Bit Windows Program title)
- AHK 1.1.25.01 (regarding Windows - Programs and functions)
- Win7Pro 32 bit
Re: chinese fonts in wingettext
Did you try an ANSI version of AutoHotkey?
You could try this in a Unicode version of AutoHotkey, in case it works:
You could try this in a Unicode version of AutoHotkey, in case it works:
Code: Select all
q::
WinGet, hWnd, ID, A
vChars := DllCall("GetWindowTextLength", Ptr,hWnd)+1
VarSetCapacity(vWinTitle, vChars*2, 0)
DllCall("GetWindowTextA", Ptr,hWnd, Ptr,&vWinTitle, Int,vChars)
vWinTitle := StrGet(&vWinTitle, "CP0")
MsgBox, % vWinTitle
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: chinese fonts in wingettext
The script is working and I receive a MSG.
What does it mean now?....
What does it mean now?....
Re: chinese fonts in wingettext
The script attempts to get the window title, so if the MsgBox doesn't show the window title, then it suggests the script doesn't work.
You could also try AccViewer:
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
You could also try AccViewer:
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: chinese fonts in wingettext
I guess this is a misunderstanding; I am receiving the MsgBox with the window title.
Got any idea?
Got any idea?
Re: chinese fonts in wingettext
GetWindowTextLength function (Windows)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Btw did you have any luck with AccViewer? It's a window spy for getting information from windows/controls/GUI elements.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
So on that basis, it may be a technique that can retrieve text from your external window.Retrieves the length, in characters, of the specified window's title bar text (if the window has a title bar). If the specified window is a control, the function retrieves the length of the text within the control. However, GetWindowTextLength cannot retrieve the length of the text of an edit control in another application.
Btw did you have any luck with AccViewer? It's a window spy for getting information from windows/controls/GUI elements.
Code: Select all
q:: ;get text from Notepad's Find dialog
ControlGet, hWnd, Hwnd,, Static1, A
vChars := DllCall("GetWindowTextLength", Ptr,hWnd)+1
VarSetCapacity(vWinTitle, vChars*2, 0)
DllCall("GetWindowTextA", Ptr,hWnd, Ptr,&vWinTitle, Int,vChars)
vWinTitle := StrGet(&vWinTitle, "CP0")
MsgBox, % vWinTitle
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: chinese fonts in wingettext
The subfolder C:\Program Files\AutoHotkey\Lib does not exist.
Shall I create it to copy acc.ahk and anchor.ahk?
Shall I create it to copy acc.ahk and anchor.ahk?
Re: chinese fonts in wingettext
If your AutoHotkey exe is in C:\Program Files\AutoHotkey, then I suppose so.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: Bing [Bot] and 306 guests