
  $filename  "t.exe"
  'uses RTL64
  uses WinUtil
  'WS_THICK
  MainWindow 320,100,WS_OVERLAPPEDWINDOW


  function WndProc(sys hWnd, wMsg, wParam,lparam) as sys callback
  ===============================================================
    
  static sys hdc
  static RECT r

  '==========
  select wMsg
  '==========
        
    case WM_CREATE
    '=============

    SetWindowText hwnd,"Greeting"
    'SendMessage hwnd,WM_SETTEXT,0,strptr "Greeting"


    case WM_DESTROY
    '===============
          
    PostQuitMessage 0
        
    case WM_PAINT
    '============

    hdc=GetDC hwnd
    GetClientRect  hWnd,@r
    'style
    '0x20 DT_SINGLELINE
    '0x04 DT_VCENTER
    '0x01 DT_CENTER
    '0x25

    SetBkColor   hdc,white
    SetTextColor hdc,blue
    DrawText hDC,"HelloWorld!",-1,@r,0x25
    ValidateRect hwnd,@r
     
    case WM_KEYDOWN
    '==============

    if wParam=27 then SendMessage hwnd, WM_CLOSE, 0, 0      'ESCAPE

    case else
    '========
          
    function=DefWindowProc hWnd,wMsg,wParam,lParam
    
    end select
    '
  end function ' WndProc
