Jump to content

Multilingual (language) for program


Recommended Posts

Hello my teachers and my brothers,
I have just written a program and i want this program has Multilingual language.
Code:
 

#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GUIConstants.au3>

Global $gaDropFiles[1]

$hGUI = GUICreate("Test - Untitled *", 602, 484,- 1,- 1, -1, $WS_EX_ACCEPTFILES)
$Menue_Main = GUICtrlCreateMenu("File")
GUICtrlCreateMenuItem("New", $Menue_Main)
GUICtrlCreateMenuItem("Open...", $Menue_Main)
GUICtrlCreateMenuItem("Save", $Menue_Main)
GUICtrlCreateMenuItem("Save as...", $Menue_Main)
GUICtrlCreateMenuItem("Exit", $Menue_Main)
$2 = GUICtrlCreateMenu("Help")
GUICtrlCreateMenuItem("Web site FAQ...", $2)
GUICtrlCreateMenuItem("About...", $2)
$3 = GUICtrlCreateMenu("Language")
GUICtrlCreateMenuItem("English", $3)
GUICtrlCreateMenuItem("French", $3)
GUICtrlCreateMenuItem("Russian", $3)
GUICtrlCreateMenuItem("Example...", $3)
$hToolLabel = GUICtrlCreateLabel( "Tool Location", 20, 14, 88, 14)
$hToolFileInput = GUICtrlCreateInput( "", 19, 33, 474, 19)
$hToolFileButton = GUICtrlCreateButton( "Browse", 510, 31, 73, 23)
$hFileLabel = GUICtrlCreateLabel( "File Location", 21, 67, 190, 13)
$hFileInput = GUICtrlCreateInput( "", 21, 83, 358, 20)
$hPasswordLabel = GUICtrlCreateLabel( "Password", 392, 66, 82, 13)
$hPasswordInput = GUICtrlCreateInput( "", 392, 83, 101, 19,$ES_PASSWORD)
$hFileButton = GUICtrlCreateButton( "Browse", 509, 81, 74, 23)
$hURLLabel = GUICtrlCreateLabel( "URL (optional)", 21, 120, 162, 15)
$hURLCombo = GUICtrlCreateCombo( "", 23, 137, 469, 21)
GUICtrlSetData( -1, "http://www.google.com|https://www.facebook.com")
$hProgramLabel = GUICtrlCreateLabel( "Program Title", 25, 173, 150, 13)
$hProgramInput = GUICtrlCreateInput( "", 24, 193, 470, 20)
$hWebLabel = GUICtrlCreateLabel( "Program Web URL (optional)", 25, 229, 141, 14)
$hWebInput = GUICtrlCreateInput( "", 25, 247, 470, 21)
$hListFileLabel = GUICtrlCreateLabel( "Program File To Run", 25, 283, 121, 14)
$hListFile = GUICtrlCreateList( "", 26, 302, 469, 102)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$hAddButton = GUICtrlCreateButton( "Add", 511, 302, 76, 41)
$hRemoveButton = GUICtrlCreateButton( "Remove", 511, 359, 75, 40)
$hRunButton = GUICtrlCreateButton( "Run File", 196, 413, 210, 40)

GUISetState()
GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC")
While 1
$hMsg = GUIGetMsg()
Switch $hMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_DROPPED
For $i = 0 To UBound($gaDropFiles) - 1
AddToList($hListFile, $gaDropFiles[$i])
Next
Case $hToolFileButton
BrowsetoolFile()
Case $hFileButton
BrowseFile()
Case $hAddButton
Local $szFileDir = FileOpenDialog("Select Program Files to Run", "", "Program files (*.exe;*.msi)|All files (*.*)", 7)
If Not @error Then
Local $aSplit = StringSplit($szFileDir, "|")
If Not @error Then
For $i = 2 To $aSplit[0]
AddToList($hListFile, StringRight($aSplit[1], 1) == "\" ? $aSplit[1] & $aSplit[$i] : $aSplit[1] & "\" & $aSplit[$i])
Next
Else
AddToList($hListFile, $szFileDir)
EndIf
EndIf
If @error Then
MsgBox($MB_ICONERROR, "", "No file(s) were selected.")
EndIf
Case $hRemoveButton
RemoveSelectedFromList($hListFile)
Case $hRunButton
EndSwitch
Sleep(50)
WEnd

Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam)
Local $nSize, $pFileName
Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255)
For $i = 0 To $nAmt[0] - 1
$nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0)
$nSize = $nSize[0] + 1
$pFileName = DllStructCreate("char[" & $nSize & "]")
DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize)
ReDim $gaDropFiles[$i + 1]
$gaDropFiles[$i] = DllStructGetData($pFileName, 1)
$pFileName = 0
Next
EndFunc ;==>WM_DROPFILES_FUNC

Func AddToList($iList, $szContent)
If (GUICtrlSendMsg($iList, $LB_FINDSTRING, -1, $szContent) == -1) Then Return GUICtrlSendMsg($iList, $LB_ADDSTRING, 0, $szContent)
Return 0
EndFunc ;==>AddToList

Func RemoveSelectedFromList($hListFile)
Return GUICtrlSendMsg($hListFile, $LB_DELETESTRING, GUICtrlSendMsg($hListFile, $LB_GETCARETINDEX, 0, 0), 0)
EndFunc ;==>RemoveSelectedFromList

Func GetItemText($hListFile, $iIndex)
Local $tText = DllStructCreate("wchar Text[" & GUICtrlSendMsg($hListFile, $LB_GETTEXTLEN, $iIndex, 0) + 1 & "]")
_SendMessage(GUICtrlGetHandle($hListFile), $LB_GETTEXT, $iIndex, $tText, 0, "wparam", "struct*")
Return DllStructGetData($tText, "Text")
EndFunc ;==>GetItemText

Func _SendMessage($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iReturn = 0, $wParamType = "wparam", $lParamType = "lparam", $sReturnType = "lresult")
Local $aResult = DllCall("user32.dll", $sReturnType, "SendMessageW", "hwnd", $hWnd, "uint", $iMsg, $wParamType, $wParam, $lParamType, $lParam)
If @error Then Return SetError(@error, @extended, "")
If $iReturn >= 0 And $iReturn <= 4 Then Return $aResult[$iReturn]
Return $aResult
EndFunc ;==>_SendMessage

Func BrowsetoolFile()
Local $sFileOpenDialog = FileOpenDialog("Locate Tool.exe", "", "Program files (*.exe)")
If @error Then
MsgBox($MB_ICONERROR, "", "No file(s) were selected.")
Else
GUICtrlSetData($hToolFileInput, $sFileOpenDialog)
EndIf
EndFunc

Func BrowseFile()
Local $sFileOpenDialog = FileOpenDialog("Locate your file", "", "files (*.exe)")
If @error Then
MsgBox($MB_ICONERROR, "", "No file(s) were selected.")
Else
GUICtrlSetData($hFileInput, $sFileOpenDialog)
EndIf
EndFunc

Can you show me and teach me: How to create Multilingual???
Of course, if you can have example for me, it is easy for learn with a pupil like me.
thank you so much
Have a nice day

Link to comment
Share on other sites

Look in my signature for the keyword Language.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...