Thanks Patrice,
I've now got it workinging properly as a child window with a main parent window.
$filename "test2.exe"
uses RTL64
uses corewin
uses OR64
dim cmdline as asciiz ptr, hinst as sys
@cmdline=GetCommandLine
hinst=GetModuleHandle 0
'
Function WinMain(sys hinst, prevInst, asciiz*cmdline, sys show) as sys
'=====================================================================
WndClass wc
MSG wm
sys hwnd, chwnd
wc.style = CS_HREDRAW or CS_VREDRAW
wc.lpfnWndProc = @WndProc
wc.cbClsExtra = 0
wc.cbWndExtra = 0
wc.hInstance = hinst
wc.hIcon=LoadIcon 0, IDI_APPLICATION
wc.hCursor=LoadCursor 0,IDC_ARROW
wc.hbrBackground = GetStockObject WHITE_BRUSH
wc.lpszMenuName =null
wc.lpszClassName = strptr "Demo"
RegisterClass (@wc)
int Wwd = 800 , Wht = 640
hwnd = CreateWindowEx 0,wc.lpszClassName,"ObjectViewer using OxygenBasic",WS_OVERLAPPEDWINDOW,0,0,Wwd,Wht,0,0,hinst,0
'OR_CreateWindow(IN dword dwExStyle, IN HWND hParent, IN dword dwStyle, IN long x, IN long y, IN long w, IN long h, IN HMENU CtrlID)
chwnd=OR_CreateWindow(0, hwnd, WS_POPUP, 100,100,640,480, 0)
ShowWindow hwnd,SW_SHOW
UpdateWindow hwnd
ShowWindow chwnd,SW_SHOW
'
print OR_version() cr OR_About() cr OR_GPUinfo()
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 else
function=DefWindowProc hWnd,wMsg,wParam,lParam
end select
end function ' WndProc
WinMain hinst,0,cmdline,SW_NORMAL