
  $filename  "t.exe"
  'uses RTL64
  uses WinUtil
  'WS_THICK
  uses PgBar3d

  INITCOMMONCONTROLSEXt icce
  'Load the common controls library...
  icce.dwSize = sizeof(INITCOMMONCONTROLSEXt)
  icce.dwICC = 0xffff
  InitCommonControlsEx(&icce)

  MainWindow 320,100,WS_OVERLAPPEDWINDOW

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

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

print "t c"

    case WM_DESTROY
    '===============

       
    PostQuitMessage 0

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


  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"

     string ClassName
     ClassName  = "ooo" '"PGBAR3D"
     WNDCLASSEX wc
     'register once
     wc.cbSize        = sizeof(wc)
     wc.lpfnWndProc   = @PgbWndProc
     'wc.lpfnWndProc   = @tProc
     wc.cbWndExtra    = sizeof(sys)  'for pointer to user defined TYPE with control-specific data
     wc.hInstance     = hInst 'GetWindowLongPtr(hWnd, GWL_HINSTANCE) '-6
     wc.hCursor       = LoadCursor(null,  IDC_ARROW )
     wc.lpszClassName = strptr ClassName
     '
     if not RegisterClassEx(&wc) 
       mbox "Error: RegisterdClassEx PGBAR3D failed" : return 0
     endif
    '
    sys hbar
    int st3d=WS_CHILD OR WS_VISIBLE
    'CreatePGBar3D(hWnd, 201, "", 5, 20, 14, 98, st3d, 0x200,1)      'LEFT BAR, VERTICAL
   hBar = CreateWindowEx(0, ClassName,  "tex", st3d, 0, 0, 40, 30, hWnd, 201 hInst, 0 )
   if hBar = 0 then mbox "Error: CreateWindowEx failed: " ClassName


    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
