GrahamT Posted April 1, 2006 Share Posted April 1, 2006 I have a Thai/English Dictionary program, which will only show the correct characters on the screen if the Regional Settings -> Regional Options is set to Thai. I keep it set to English (United Kingdom) for two reasons, I want to have my spelling checker "correct", and as far as I'm concerned, the year is CE 2006, not BE 2549. How, using AutoIt, can I change the regional options to Thai, then run the software, and then reset the Regional Options when the dictionary program exits? Any help appreciated. Thanks, Graham Link to comment Share on other sites More sharing options...
forger Posted April 1, 2006 Share Posted April 1, 2006 I think that requires a restart in between too. I'm still a newbie here, but I know that ScriptWriter (AutoIT3\SciTE\ScriptWriter\AU3Record.exe but I guess you need SciTE) makes wonders for the first and last part of what you need, the middle part is just to set a WinWaitClose I'm sorry I can't help you any more, better leave it to the experts here, these guys are autoit's lil' einsteins cloned many times with the similarity option turned off Link to comment Share on other sites More sharing options...
GrahamT Posted April 1, 2006 Author Share Posted April 1, 2006 Changing the Regional Options doesn't require a restart, at least not after you've done it once and everything is installed. Thanks for replying anyway. I think that requires a restart in between too.I'm still a newbie here, but I know that ScriptWriter (AutoIT3\SciTE\ScriptWriter\AU3Record.exe but I guess you need SciTE) makes wonders for the first and last part of what you need, the middle part is just to set a WinWaitCloseI'm sorry I can't help you any more, better leave it to the experts here, these guys are autoit's lil' einsteins cloned many times with the similarity option turned off Link to comment Share on other sites More sharing options...
herewasplato Posted April 1, 2006 Share Posted April 1, 2006 If you want to do it like a human would: Run("rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0") WinWait("Regional and Language Options", "Regional Options") WinActivate("Regional and Language Options", "Regional Options") WinWaitActive("Regional and Language Options", "Regional Options")or Run("rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1") WinWait("Regional and Language Options", "Languages") WinActivate("Regional and Language Options", "Languages") WinWaitActive("Regional and Language Options", "Languages") then have the script start the dictionary program have the script loop: do sleep(100) until not ProcessExists (dictionary program) the change your regional settings back easy? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Lapo Posted April 1, 2006 Share Posted April 1, 2006 (edited) Try to exporting/importing 2 *.reg files 1 with Thai settings and 1 with Englishbut i think at least a eaplorer shell restart is neededmake the changes and keep track with this :RegShot 1.61ehttp://www.pcworld.com/downloads/file_desc...id,19540,00.asphttp://www.snapfiles.com/get/regshot.htmlmaybe here :HKEY_CURRENT_USER\Control Panel\InternationalExplorer shell restart >>>>> CAUTION <<<<<<<<< :C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx (win9x)http://aumha.org/win4/a/shutcut.htmhttp://www.ss64.com/nt/date.htmlhttp://www.codecomments.com/archive305-2005-5-478574.html Edited April 1, 2006 by Lapo Link to comment Share on other sites More sharing options...
GrahamT Posted April 2, 2006 Author Share Posted April 2, 2006 Thanks for all your help I couldn't get the Do . . Until loop to work properly, but I got this to work eventually: $Lang1 = "English (United Kingdom)" $Lang2 = "Thai" $prog = "C:\Program Files\LEXiTRON Dictionary\LEXiTRON.exe" $wDir = "C:\Program Files\LEXiTRON Dictionary\" ChangeIt($Lang2) ; change to Thai Run($prog, $wDir) ; Open the Dictionary WinWait("LEXiTRON") ; pause until the program opens WinWaitClose("LEXiTRON") ; and until it closes! ChangeIt($Lang1) ; change back to English ; Function to change the language Func ChangeIt($lang) Run("rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0") WinWait("Regional and Language Options", "Regional Options") WinActivate("Regional and Language Options", "Regional Options") WinWaitActive("Regional and Language Options", "Regional Options") Send($lang & "{Enter}") EndFunc ;==> Not very pretty, and rather slow - and I've tried everything to get the Regional Options Dialog to hide, but it won't. Anyway, at least I can use my dictionary now Graham Link to comment Share on other sites More sharing options...
herewasplato Posted April 2, 2006 Share Posted April 2, 2006 ...I couldn't get the Do . . Until loop to work properly...I like your code better... as long as there are windows, might as well use them.you probably would have needed two do/until loops... one for each of your Win... lineswait for it to show in the process listdosleep(100)until ProcessExists (dictionary program)wait for it to leave the process listdosleep(100)until not ProcessExists (dictionary program)Glad you got it working... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
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