MSFN Forum: Adding a input language - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adding a input language unattended adding input language Q Rate Topic: -----

#1 User is offline   Sheriff 

  • Group: Members
  • Posts: 6
  • Joined: 16-April 07

Posted 16 April 2007 - 06:11 AM

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.

thanks
Sheriff

This post has been edited by Sheriff: 16 April 2007 - 06:12 AM



#2 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 16 April 2007 - 10:00 AM

View PostSheriff, on Apr 16 2007, 02:11 PM, said:

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.

thanks
Sheriff

Vbs script to do what you want.
Save As Intl.vbs

Quote

 CreateObject("Wscript.Shell").Run("intl.cpl")

Cmd Promt to do what you want
Save As Intl.cmd

Quote

Echo Off 
Color F3
Mode 55,5
Start intl.cpl


#3 User is offline   Sheriff 

  • Group: Members
  • Posts: 6
  • Joined: 16-April 07

Posted 16 April 2007 - 10:31 AM

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

#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 16 April 2007 - 11:27 AM

View PostSheriff, on Apr 16 2007, 06:31 PM, said:

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

Yes it is possible

VBS Script
Intl_OpenClose.vbs

Quote

 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,true

Cmd Promt
Intl_OpenClose.cmd

Quote

@Echo Off
Color F3
Mode 55,5
Start intl.cpl
Echo Waiting For One Minute Before Closing Intl.cpl
ping -n 60 127.0.0.1>nul
taskkill.exe /F /Im intl.cpl


#5 User is offline   Sheriff 

  • Group: Members
  • Posts: 6
  • Joined: 16-April 07

Posted 16 April 2007 - 02:24 PM

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

I tried unregistering then registering msutb.dll, but no change :(

any advice?

Thanks in advance,

Sheriff

This post has been edited by Sheriff: 16 April 2007 - 02:25 PM


#6 User is offline   Sheriff 

  • Group: Members
  • Posts: 6
  • Joined: 16-April 07

  Posted 22 April 2007 - 01:45 PM

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 way

Dim Act : Set Act = CreateObject("Wscript.Shell")
Act.Run("intl.cpl")
/'-> Wait Period Time I minute
Act.SendKeys "{TAB}"
Act.SendKeys "{TAB}"
Act.SendKeys "{TAB}"
Act.SendKeys "{TAB}"
Act.SendKeys "{ENTER}"

and the other cmd file

@Echo Off
Color F3
Mode 55,5
Start intl.cpl
Echo Waiting For One Minute Before Closing Intl.cpl

This post has been edited by Sheriff: 22 April 2007 - 01:50 PM


#7 User is offline   Sheriff 

  • Group: Members
  • Posts: 6
  • Joined: 16-April 07

Posted 23 April 2007 - 01:57 PM

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 WshShell
Set 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}")

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy