Ako ti je korisnik bas onako kako si ga opisao onda ti je najjednostavnije da mu stavis Serbian kao default.
Ako bas hoces iz koda da menjas iskopiraj sledeci kod u novi modul:
Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Autor: Darko Matesic
' Datum: 20. Novembar 2004.
' Email:
[email protected]
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Compare Database
Option Explicit
Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
Declare Function ActivateKeyboardLayout Lib "user32" (ByVal hkl As Long, ByVal flags As Long) As Long
Declare Function UnloadKeyboardLayout Lib "user32" (ByVal hkl As Long) As Long
Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Const HKL_ENGLISH_US = "00000409"
Const HKL_ENGLISH_UK = "00000809"
Const HKL_CROATIAN = "0000041A"
Const HKL_SERBIAN_CYRILIC = "00000C1A"
Const HKL_SERBIAN_LATIN = "0000081A"
Public Enum acKeyboardLanguage
hklEnglishUS
hklEnhlishUK
hklCroatian
hklSerbianCyrilic
hklSerbianLatin
End Enum
Function SetKeyboardLanguage(KeyboardLanguage As acKeyboardLanguage) As Boolean
Dim hkl As Long
SetKeyboardLanguage = False
Select Case KeyboardLanguage
Case hklEnglishUS:
hkl = LoadKeyboardLayout(HKL_ENGLISH_US, 0)
Case hklEnhlishUK
hkl = LoadKeyboardLayout(HKL_ENGLISH_UK, 0)
Case hklCroatian
hkl = LoadKeyboardLayout(HKL_CROATIAN, 0)
Case hklSerbianCyrilic
hkl = LoadKeyboardLayout(HKL_SERBIAN_CYRILIC, 0)
Case hklSerbianLatin
hkl = LoadKeyboardLayout(HKL_SERBIAN_LATIN, 0)
End Select
If hkl <> 0 Then SetKeyboardLanguage = (ActivateKeyboardLayout(hkl, 0) <> 0)
End Function
Pri ucitavanju forme uradi sledece:
Code:
Call SetKeyboardLanguage(hklSerbianLatin)
Kod mene na XP-u radi a da li ce raditi na win9x ne znam (po dokumentaciji za koriscene API-je bi trebalo).
Ovo radi i ako pokusas da ucitas Serbian Cyrilic a imas instaliran samo Serbian Latin tj. on ga promeni i dok radi program aktivan je a kada izadjes vrati se na staro.