

  $ filename "t.exe"
  'uses RTL32
  'uses RTL64
  $ EscapeKeyEnd
  uses WinUtil
  MainWindow 640,480,WS_OVERLAPPEDWINDOW

  % ID_FIRSTCHILD  100 

  sys hinstance
  sys hWndMain


  'STANDARD CHILD WINDOWS STYLES
  '=============================
  '
  'Button	The class for a button.
  'ComboBox	The class for a combo box.
  'Edit	        The class for an edit control.
  'ListBox	The class for a list box.
  'MDIClient	The class for an MDI client window.
  'ScrollBar	The class for a scroll bar.
  'Static	The class for a static control.




  dim cRect   as rect
  dim Paintst as paintstruct

  dim hDC     as sys


  function WndProc(sys hwnd, uMsg, wParam, lParam) as long callback
  '================================================================
  indexbase 0
  RECT rcClient; 
  sys i,w,px,py,lx,ly,nx,ny,id,idmenu,style
  static sys hchw[0x200]
  static sys hfont 
  string s
 
  select umsg 
 
  case WM_CREATE

    SetWindowText hwnd,"Edit Box"
    style=WS_CHILD | WS_BORDER | WS_VISIBLE |
    ES_MULTILINE   | ES_WANTRETURN  | ES_NOHIDESEL |
    ES_AUTOHSCROLL | ES_AUTOVSCROLL | WS_HSCROLL   | WS_VSCROLL
    py=10 : lx=600 : ly=400
    id=ID_FIRSTCHILD+i
    px=10
    hchw[i]=CreateWindowExW(0,l"edit", null, style, px,py,lx,ly, hwnd, id, inst, null)
    ShowWindow(hchw[i], SW_SHOW)
    wstring ws=cast wstring getfile "Multilingual.txt"

    wstring ws=cast wstring getfile "Multilingual.txt"
    'ws=mid(ws,2) 'skip bom code
    hfont=CreateFont( 30,10,0,0,1,0,0,0,0,0,0,0,0,"Arial")
    SendMessageW hchw[i],WM_SETFONT,hfont,0
    'SetWindowTextW(hchw[i], ws)
    SendMessageW hchw[i] ,WM_SETTEXT,len(ws),strptr(ws)

 
    case WM_COMMAND

      id=wparam and 0xffff
      int co=wparam >>16
      if id>0x100 and id<0x200 then
        s="PushButton: " str id
        SetWindowText hWnd, s
        SetWindowText hchw[id], hex(id)+"h"
        SetFocus hwnd
      end if

    case WM_SIZE:   // main window changed size 

      RECT rc
      int wo=10,ho=10, x, y
      GetClientRect(hWnd, &rc)
      x=rc.right-wo-wo
      y=rc.bottom-ho-ho 
      MoveWindow(hchw[0], wo, ho, x, y, TRUE); 
      ShowWindow(hchw[0], SW_SHOW); 

    case WM_DESTROY:

      DeleteObject hfont
      PostQuitMessage 0 

    case else

      return DefWindowProc(hwnd, uMsg, wParam, lParam)

    end select
    '
  end function

 
