$ filename "HelloUnicode.exe"
  'uses RTL32
  'uses RTL64
 
  % CS_VREDRAW      1
  % CS_HREDRAW      2
  % IDI_APPLICATION 32512
  % IDC_ARROW       32512
  % WHITE_BRUSH      0
  % SM_CXSCREEN      0
  % SM_CYSCREEN      1
  % WS_OVERLAPPEDWINDOW 0x00cf0000
  % SW_SHOW             5
  % WM_CLOSE            16
  % WM_KEYDOWN          0x100
  % WM_DESTROY          2
  % SW_NORMAL           1
  % WS_VISIBLE          0x10000000
  % WS_CHILD            0x40000000
  % WS_CHILDWINDOW      WS_CHILD
    
 
  type POINT
  long x
  long y
  end type
 
  '28 bytes
  type MSG
  sys   hwnd
  int   message
  sys   wParam
  sys   lParam
  dword time
  POINT pt
  end type
 
  '40 bytes
  type WNDCLASS
  int style
  sys lpfnwndproc
  int cbClsextra
  int  cbWndExtra
  sys hInstance
  sys hIcon
  sys hCursor
  sys hbrBackground
  sys lpszMenuName
  sys lpszClassName
  end type
 
  extern lib "Kernel32.dll"
  ! GetCommandLine         "GetCommandLineW"      '0
  ! GetModuleHandle        "GetModuleHandleW"     '1
  end extern
 
  extern lib "User32.dll"
  ! CreateWindowEx        "CreateWindowExW"       '12
  ! DefWindowProc         "DefWindowProcW"        '4
  ! DispatchMessage       "DispatchMessageW"      '1
  ! GetClientRect                                 '2
  ! GetMessage            "GetMessageW"           '4
  ! GetSystemMetrics                              '1
  ! LoadIcon              "LoadIconW"             '2
  ! LoadCursor            "LoadCursorW"           '2
  ! PostQuitMessage                               '1
  ! RegisterClass         "RegisterClassW"        '1
  ! SendMessage           "SendMessageW"          '4
  ! SetWindowText         "SetWindowTextW"        '2  
  ! ShowWindow                                    '2
  ! TranslateMessage                              '1
  ! UpdateWindow                                  '1
  end extern
 
  extern lib "GDI32.dll"
  ! GetStockObject                                '1
  end extern
 
  declare function WinMain(sys inst, prevInst, asciiz2*cmdline, sys show) as sys
  declare sub getwstrings()
  
  '=========
  'MAIN CODE
  '=========
 
  dim cmdline as wchar ptr, hInstance as sys
  @cmdline=GetCommandLine
  hInstance=GetModuleHandle 0
 
  sys lbl[5]
  wstring hellos[5]
  
  '
  'WINDOWS START
  '=============
  '
  WinMain hInstance,0,cmdline,SW_NORMAL
  end
 
 
function WinMain(sys inst, prevInst, asciiz2*cmdline, sys show) as sys
 
   WndClass wc
   MSG      wm
 
   sys hwnd, Wwd, Wht, Wtx, Wty, Tax
   wstring classname="Demo"
 
   wc.style = CS_HREDRAW or CS_VREDRAW
   wc.lpfnWndProc = @WndProc
   wc.cbClsExtra =0
   wc.cbWndExtra =0
   wc.hInstance =inst
   wc.hIcon=LoadIcon 0, IDI_APPLICATION
   wc.hCursor=LoadCursor 0,IDC_ARROW
   wc.hbrBackground = GetStockObject WHITE_BRUSH
   wc.lpszMenuName =null
   wc.lpszClassName = strptr classname
 
   RegisterClass (@wc)
 
   Wwd = 320 : Wht = 200
   Tax = GetSystemMetrics SM_CXSCREEN
   Wtx = (Tax - Wwd) /2
   Tax = GetSystemMetrics SM_CYSCREEN
   Wty = (Tax - Wht) /2
   wstring wst="static"
   wstring wti="OXYGEN BASIC"
   wstring whw="Hello World" 
   hwnd = CreateWindowEx 0,wc.lpszClassName,  wti,WS_OVERLAPPEDWINDOW,Wtx,Wty,Wwd,Wht,0,0,inst,0
   lbl[1]=CreateWindowEx(0, wst, whw,WS_CHILDWINDOW|WS_VISIBLE, 20, 10,200,25, hwnd,0,inst,0)
   lbl[2]=CreateWindowEx(0, wst, "",WS_CHILDWINDOW|WS_VISIBLE, 20, 35,200,25, hwnd,0,inst,0)
   lbl[3]=CreateWindowEx(0, wst, "",WS_CHILDWINDOW|WS_VISIBLE, 20, 60,200,25, hwnd,0,inst,0)
   lbl[4]=CreateWindowEx(0, wst, "",WS_CHILDWINDOW|WS_VISIBLE, 20, 85,200,25, hwnd,0,inst,0)
   lbl[5]=CreateWindowEx(0, wst, "",WS_CHILDWINDOW|WS_VISIBLE, 20,110,200,25, hwnd,0,inst,0)
   getwstrings()
 
   SetWindowText(lbl[2], hellos[4])   'Grecian      
   SetWindowText(lbl[3], hellos[3])   'Japanese    
   SetWindowText(lbl[4], hellos[2])   'Korean    
   SetWindowText(lbl[5], hellos[1])   'Armenian           
 
   ShowWindow hwnd,SW_SHOW
   UpdateWindow hwnd
 
   sys bRet
   do while bRet := GetMessage (@wm, 0, 0, 0)
     if bRet = -1 then
       'show an error message
     else
       TranslateMessage @wm
       DispatchMessage @wm
     end if
   wend
 
end function
 
 
function WndProc ( sys hWnd, wMsg, wParam, lparam ) as sys callback
 
   select wMsg
           
      case WM_DESTROY
         PostQuitMessage 0
 
      case WM_KEYDOWN
         Select wParam
            Case 27 : SendMessage hwnd, WM_CLOSE, 0, 0      'ESCAPE
         End Select
 
      case else
         function=DefWindowProc hWnd,wMsg,wParam,lParam
 
   end select
 
end function ' WndProc
 
sub getwstrings()
   'very simple
   int n=0
   int p1=1, p2, le
   wstring wcrlf=wchr(13)+wchr(10)
    wstring txt
    txt=(wstring) getfile "multi.txt"
   if len(txt)=0 then mbox "Cannot load multi.txt"
   while 1
     p2=instr(p1,txt, wcrlf)
     if p2=0 then exit while
     le=p2-p1+1
     n+=1
     hellos[n]=mid(txt,p1,le)
     p1=p2+2     'wcrlf'
   wend
end sub
 