Sign in to follow this  
Followers 0
GrahamT

Regional Settings In Control Panel

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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 :)

Share this post


Link to post
Share on other sites

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 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 :mellow:

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Try to exporting/importing 2 *.reg files 1 with Thai settings and 1 with English

but i think at least a eaplorer shell restart is needed

make the changes and keep track with this :

RegShot 1.61e

http://www.pcworld.com/downloads/file_desc...id,19540,00.asp

http://www.snapfiles.com/get/regshot.html

maybe here :

HKEY_CURRENT_USER\Control Panel\International

Explorer shell restart >>>>> CAUTION <<<<<<<<< :

C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx (win9x)

http://aumha.org/win4/a/shutcut.htm

http://www.ss64.com/nt/date.html

http://www.codecomments.com/archive305-2005-5-478574.html

Edited by Lapo

Share this post


Link to post
Share on other sites

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 :mellow:

Graham

Share this post


Link to post
Share on other sites

...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... lines

wait for it to show in the process list

do

sleep(100)

until ProcessExists (dictionary program)

wait for it to leave the process list

do

sleep(100)

until not ProcessExists (dictionary program)

Glad you got it working...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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
Sign in to follow this  
Followers 0