التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تغير اللغه من خلال البرنامج
#1
كاتب الموضوع : AhmedEssawy

كود :
Option Explicit

'This Project requires 4 Buttons
'Textbox to test changes to input language

'API's to adjust the keyboardlayout
Private Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Private Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
Private Declare Function GetLastError Lib "kernel32" () As Long
Const KLF_ACTIVATE = &H1
'Languages
Const Lang_AR_SAU As String = "00000401" 'Arabic
Const Lang_EN_USA As String = "00000409" 'English
Const Lang_FR_FRA As String = "0000040C" 'French
'Switch input language to French
Private Sub Command3_Click()
Form1.Caption = SetKbLayout(Lang_FR_FRA)
End Sub
'Switch input language to English
Private Sub Command2_Click()
Form1.Caption = SetKbLayout(Lang_EN_USA)
End Sub
'Switch input language to Arabic
Private Sub Command1_Click()
Form1.Caption = SetKbLayout(Lang_AR_SAU)
End Sub
'Test invalid langauge !
Private Sub Command4_Click()
'Invalid language
Form1.Caption = SetKbLayout("00000D0D")
End Sub

'Will return True if succeeds !
Public Function SetKbLayout(strLocaleId As String) As Boolean

'Changes the KeyboardLayout
'Returns TRUE when the KeyboardLayout was adjusted properly, FALSE otherwise
'If the KeyboardLayout isn't installed, this function will install it for you
On Error Resume Next
Dim strLocId As String 'used to retrieve current KeyboardLayout
'create a buffer
strLocId = String(9, 0)
'retrieve the current KeyboardLayout
GetKeyboardLayoutName strLocId
'Check whether the current KeyboardLayout and the
'new one are the same
If strLocId = (strLocaleId & Chr(0)) Then
'If they're the same, we return immediately
SetKbLayout = True
Exit Function
Else
'create buffer
strLocId = String(9, 0)

'load and activate the layout for the current thread
strLocId = LoadKeyboardLayout((strLocaleId & Chr(0)), KLF_ACTIVATE)
End If

'Test success
GetKeyboardLayoutName strLocId

If strLocId = (strLocaleId) Then SetKbLayout = True
End Function

Private Sub Form_Load()
'Set buttons caption for you !
Command1.Caption = "Arabic"
Command2.Caption = "English"
Command3.Caption = "French"
Command4.Caption = "Invalid lang"

End Sub
}}}
تم الشكر بواسطة:


الردود في هذا الموضوع
تغير اللغه من خلال البرنامج - بواسطة Raggi Tech - 17-10-12, 12:38 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيف ارسل ايميل دوري من خلال Outlook shalapyx 3 4,936 26-06-19, 03:15 AM
آخر رد: Amir_Alzubidy
  إيقاف عمل البرنامج بتاريخ و بوقت Ahmad Jawad 5 5,660 27-09-17, 11:04 PM
آخر رد: ahmadpal
  كود اظهار البرنامج بالنقر على الايقونة masdel 0 3,520 07-01-15, 03:36 PM
آخر رد: masdel
  طريقة لجعل الفورم او البرنامج في مقدمة البرامج Ahmad Jawad 0 2,848 28-10-12, 11:39 AM
آخر رد: Ahmad Jawad
  افتح ملفّ الوورد والأكسل والباوربوينت من خلال برنامجك RaggiTech 0 3,275 17-10-12, 03:41 PM
آخر رد: RaggiTech
  الغاء زر الاغلاق- اخفاء البرنامج من ادراة المهام- الغاء تكرارتشغيل برنامجك بنفس الوقت RaggiTech 0 2,864 17-10-12, 03:33 PM
آخر رد: RaggiTech
  حل مشكلة تغير حجم النموذج RaggiTech 0 2,320 17-10-12, 03:05 PM
آخر رد: RaggiTech
  لفتح البرنامج بطريقة جميلة RaggiTech 0 2,675 17-10-12, 02:36 PM
آخر رد: RaggiTech
  للعمل من خلال Dos وارسال واستقبال البيانات RaggiTech 0 2,279 17-10-12, 12:58 AM
آخر رد: RaggiTech
  كيفية قلب الشاشة من خلال الكود RaggiTech 0 2,465 17-10-12, 12:53 AM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم