'====================================================================
' Multi-lingual example, simple modal dialog as main.
'====================================================================
' ported from MASM32 example to OxygenBasic
$ filename "Multi_lingual.exe"
'use rtl32
use rtl64
'% review
use corewin
uses dialogs
'namespace
% DS_CENTER=0x0800
% WM_SETICON=128
==============================================
'MAIN CODE
=============================================
'dim nCmdline as asciiz ptr, hInstance as sys
'&nCmdline = GetCommandLine
hInstance = GetModuleHandle(NULL)
Init_common_controls()
function DialogProc( sys hDlg, uint uMsg, sys wParam, lParam ) as int callback
wstring pbuf = space 260
select case uMsg
case WM_INITDIALOG
hStat0 = GetDlgItem(hDlg,1250)
hStat1 = GetDlgItem(hDlg,1251)
hStat2 = GetDlgItem(hDlg,1252)
hStat3 = GetDlgItem(hDlg,1253)
hStat4 = GetDlgItem(hDlg,1254)
hStat5 = GetDlgItem(hDlg,1255)
hStat6 = GetDlgItem(hDlg,1256)
hStat7 = GetDlgItem(hDlg,1257)
hStat8 = GetDlgItem(hDlg,1258)
hStat9 = GetDlgItem(hDlg,1259)
hStat10 =GetDlgItem(hDlg,1260)
SendMessage (hDlg, WM_SETICON,1, LoadIcon(hInstance,500))
LoadStringW (hInstance,250,pbuf,260)
SetWindowTextW (hStat0,pbuf)
LoadStringW (hInstance,251,pbuf,260)
SetWindowTextW (hStat1,pbuf)
LoadStringW (hInstance,252,pbuf,260)
SetWindowTextW (hStat2,pbuf)
LoadStringW (hInstance,253,pbuf,260)
SetWindowTextW (hStat3,pbuf)
LoadStringW (hInstance,254,pbuf,260)
SetWindowTextW (hStat4,pbuf)
LoadStringW (hInstance,255,pbuf,260)
SetWindowTextW (hStat5,pbuf)
LoadStringW (hInstance,256,pbuf,260)
SetWindowTextW (hStat6,pbuf)
LoadStringW (hInstance,257,pbuf,260)
SetWindowTextW (hStat7,pbuf)
LoadStringW (hInstance,258,pbuf,260)
SetWindowTextW (hStat8,pbuf)
LoadStringW (hInstance,259,pbuf,260)
SetWindowTextW (hStat9,pbuf)
LoadStringW (hInstance,260,pbuf,260)
SetWindowTextW (hStat10,pbuf)
case WM_COMMAND
select case loword(wParam)
case IDCANCEL, IDOK
EndDialog( hDlg, null )
end select
case WM_CLOSE
EndDialog( hDlg, null )
end select
return 0
end function
sub winmain()
sys lpdt
'provide memory for DLGTEMPLATE structure etc
' dyn::init(lpdt,nBytes)
dyn::init(lpdt,5000) '1024
Dialog( 23, 10,10,360,183, "Multi-Lingual Support", lpdt,
WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_CENTER or DS_SETFONT,
8,"MS Sans Serif" )
CONTROL "Chinese : ",1000,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,14,56,10
CONTROL "Japanese : ",1001,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,26,56,10
CONTROL "Russian : ",1002,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,38,56,10
CONTROL "Greek : ",1003,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,50,56,10
CONTROL "Hindi : ",1004,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,62,56,10
CONTROL "Vietnamese : ",1005,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,74,56,10
CONTROL "Georgian : ",1006,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,86,56,10
CONTROL "Serbian : ",1007,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,98,56,10
CONTROL "Armenian : ",1008,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,110,56,10
CONTROL "Korean : ",1009,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,21,123,56,10
CONTROL "English:",1010,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_RIGHT,18,136,56,10
CONTROL "Chinese",1250,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,14,268,10
CONTROL "Japanese",1251,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,26,268,10
CONTROL "Russian",1252,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,38,268,10
CONTROL "Greek",1253,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,50,268,10
CONTROL "Hindi",1254,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,62,268,10
CONTROL "Vietnamese",1255,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,74,268,10
CONTROL "Georgian",1256,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,86,268,10
CONTROL "Serbian",1257,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,98,268,10
CONTROL "Armenian",1258,"Static",WS_CHILDWINDOW|WS_VISIBLE,76,110,268,10
CONTROL "Korean",1259,"Static",WS_CHILDWINDOW|WS_VISIBLE,78,123,268,10
CONTROL "English",1260,"Static",WS_CHILDWINDOW|WS_VISIBLE,78,136,268,10
CONTROL "OK",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,288,156,56,14
CreateModalDialog( null, @DialogProc, 0, lpdt )
end sub
winmain()