Sheriff Posted April 16, 2007 Share Posted April 16, 2007 (edited) Hello every body, i am writing an application and one of its functions should add an inputting device. lets say, you have english installed, and the application will add French to the system.I tried some registry tweaks and it worked, but i should restart to get in service, unlike if i do it manually through the intl.cpl, language, details, add new keyboard. If i make it manually i can see the language bar automatically, but if i make it from the registry i must restart and i dont see the language bar.Can any body help me, to invoke the intl.cpl to add a keyboard and the lang bar.thanksSheriff Edited April 16, 2007 by Sheriff Link to comment Share on other sites More sharing options...
gunsmokingman Posted April 16, 2007 Share Posted April 16, 2007 Hello every body, i am writing an application and one of its functions should add an inputting device. lets say, you have english installed, and the application will add French to the system.I tried some registry tweaks and it worked, but i should restart to get in service, unlike if i do it manually through the intl.cpl, language, details, add new keyboard. If i make it manually i can see the language bar automatically, but if i make it from the registry i must restart and i dont see the language bar.Can any body help me, to invoke the intl.cpl to add a keyboard and the lang bar.thanksSheriffVbs script to do what you want.Save As Intl.vbs CreateObject("Wscript.Shell").Run("intl.cpl")Cmd Promt to do what you wantSave As Intl.cmdEcho Off Color F3Mode 55,5Start intl.cpl Link to comment Share on other sites More sharing options...
Sheriff Posted April 16, 2007 Author Share Posted April 16, 2007 Thank you alot, it really worked although i dont understand what did it do.The last problem is that the intl.cpl is opened and i have to close it manually, is it possible to close it also with the script?Thanks for your help Link to comment Share on other sites More sharing options...
gunsmokingman Posted April 16, 2007 Share Posted April 16, 2007 Thank you alot, it really worked although i dont understand what did it do.The last problem is that the intl.cpl is opened and i have to close it manually, is it possible to close it also with the script?Thanks for your helpYes it is possibleVBS Script Intl_OpenClose.vbs Dim Act : Set Act = CreateObject("Wscript.Shell") Act.Run("intl.cpl")/'-> Wait Period Time I minute Wscript.Sleep 60000 Act.Run("taskkill.exe /F /Im intl.cpl"),0,trueCmd PromtIntl_OpenClose.cmd@Echo OffColor F3Mode 55,5Start intl.cplEcho Waiting For One Minute Before Closing Intl.cplping -n 60 127.0.0.1>nultaskkill.exe /F /Im intl.cpl Link to comment Share on other sites More sharing options...
Sheriff Posted April 16, 2007 Author Share Posted April 16, 2007 (edited) Hello, Thank you for your previous reply. I am facing a strange problem that cause the script some times to work and some times not. I tested it now but it didn't work,i checked the Language Bar setting, but the check boxes are all disabled, although the settings in the registry are correct.I enable the lang bar using this code[HKEY_CURRENT_USER\Software\Microsoft\CTF\LangBar]"ShowStatus"=dword:00000004"Transparency"=dword:000000ff"Label"=dword:00000001"ExtraIconsOnMinimized"=dword:00000000I tried unregistering then registering msutb.dll, but no change any advice?Thanks in advance,Sheriff Edited April 16, 2007 by Sheriff Link to comment Share on other sites More sharing options...
Sheriff Posted April 22, 2007 Author Share Posted April 22, 2007 (edited) Hello Gunsomkingsman, I found the mistake. The code you wrote was wonderful, but there was one mistake in closing the intl.cpl window. The used concept was waiting 1 min to close it using the taskmanager, but it should close it by stimulating 4 times tab key then 1 time enter key.Stimulating a keypress is simple in vb using sendkeys, but how to do it in vbscript, should be that wayDim Act : Set Act = CreateObject("Wscript.Shell")Act.Run("intl.cpl")/'-> Wait Period Time I minuteAct.SendKeys "{TAB}"Act.SendKeys "{TAB}"Act.SendKeys "{TAB}"Act.SendKeys "{TAB}"Act.SendKeys "{ENTER}"and the other cmd file@Echo OffColor F3Mode 55,5Start intl.cplEcho Waiting For One Minute Before Closing Intl.cpl Edited April 22, 2007 by Sheriff Link to comment Share on other sites More sharing options...
Sheriff Posted April 23, 2007 Author Share Posted April 23, 2007 I need somebody to help me with this vbs, here i am running the regional setting and then the program wait 7 sec then click tab 4 times then enter. I want the program not to wait 7 sec, but to wait till the regional setting runs (Do while loop) but how?Dim WshShellSet WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run "control.exe intl.cpl,SW_SHOWNORMAL,False"WScript.Sleep(7000)WshShell.SendKeys ("{tab}")WshShell.SendKeys ("{tab}") WshShell.SendKeys ("{tab}")WshShell.SendKeys ("{tab}")WshShell.SendKeys ("{enter}") 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