Author |
Topic |
|
defpt
18 Posts |
Posted - 03/15/2013 : 09:25:26
|
Script such as: acDisplayText(acGetWindowTitle(nil, gsx, gsy), "Arial", 50, 0, 0, 0, 1000, 200, 200)
run with Firefox in german website, Such as: 1、http://de.wikipedia.org/wiki/Wikipedia:Hauptseite 2、http://www.et.tu-dresden.de/etit/
The results are as follows: 1、Wikipedia – Die freie Enzyklop?die - Mozilla Firefox 2、Fakult?t Elektrotechnik und Informationstechnik - Mozilla Firefox
This function does not recognize the character ä ö ü ß..... So the function acFindwindow() can not find the window which containing these characters.
|
|
Rob
USA
2615 Posts |
|
Chris
28 Posts |
Posted - 03/21/2013 : 03:30:31
|
I think it can be temporarily fixed by changing the window's title to non-Unicode characters. I guess it by using send WM_SETTEXT message. However, since the S+ Lua cannot read Unicode, Lua cannot get the window handle, thus cannot change by itself.
If you want I can create a script that search for all windows title and you can select and change the title manually. A better one is if the script starts the app and change the title automatically each time you run the script, thus S+ can recognize the window.
Or maybe change acFindwindow to accept wild cards? However it cannot be used if all characters of the title are in Unicode...maybe, just MHO. |
|
|
Rob
USA
2615 Posts |
Posted - 03/21/2013 : 06:30:53
|
The biggest challenge to this problem is that I'm simply not versed in internationalization development. Plus, since my system, language, and daily usage are not affected, the language issue is likely going to stick around for a while.
If anyone is familiar with C++ and Unicode in an international environment, I'd happily accept any code which could help get things working!
If someone can provide working source code for a native Win32 C++ app which uses the boost libraries (specifically property tree [reading/writing an XML file] and regex) and Lua which can pass Unicode strings between the C++ code, to/from boost property tree and regex and to/from Lua successfully, back and forth between all four code bases, there's nothing more I would love than to have S+ treat all languages as first-class, instead of English. |
|
|
Chris
28 Posts |
Posted - 03/21/2013 : 09:01:28
|
I never use any Unicode before, so I cannot help. However, I've just created a script that could help Unicode users temporarily...I hope. It is created using AutoIt scripting language.
Change Window Title
Syntax: CwinT.exe "App.exe" "Title1" "Title2"
App.exe = Path and filename of the app user wants to start Title1 = Title user wants to change Title2 = Title user wants to change Title1 into
Info: The app.exe can be left blank, to change existing window title without running any new app. So, the syntax will be: CWinT.exe "" "Title1" "Title2"
For convenience, user could create a shortcut that upon executing the shortcut will automatically change the title. For example, in shortcut properties window.. Target: "D:\CWinT.exe" "notepad.exe" "Untitled - Notepad" "NEW TITLE" Noticed that the Notepad window title will changed into "NEW TITLE"
The code:
;~ #NoTrayIcon ;uncomment to remove tray icon
;~ #include <Array.au3> ;uncomment for testing to see the array in a table
If $CmdLineRaw = "" then MsgBox(4096, "Syntax", '"ToRun.exe" "Title of the window to change" "Change into"') ;check param
$Params = StringSplit($CmdLineRaw, '"') ;split the parameters into array
;~ _ArrayDisplay($days, "Class List of Active Window");uncomment for testing to see the array in a table
If $Params[0] <> 7 then ;Check if the syntax is correct
MsgBox(4096, "Syntax Error", 'Syntax is incorrect')
Exit
EndIf
If $Params[2] <> "" then Run($Params[2]) ;run the app
$wHnd=WinWait($Params[4] , "" , 10) ;wait for window title to exist. Timeout 10 seconds
If not $wHnd Then ;check whether the title exists or not after timeout
MsgBox(4096, "Timeout", 'Window with title: "' &$Params[4]&'" does not exist')
Exit
EndIf
WinSetTitle ( $Params[4], "", $Params[6] ) ;Change the window title
Exit
Download link: http://www.filedropper.com/changewindowtitle_3 The zip contains the script, compiled script (CWinT.exe), and ReadMe.txt Hope it's useful for someone.
One more thing, users could easily get the title of a window using this app: http://www.pendriveapps.com/winspy-find-window-properties/ Just drag it into the window title. |
Edited by - Chris on 03/21/2013 09:13:57 |
|
|
|
Topic |
|
|
|