here's the solution for listbox, combobox, I have forgotten to use the correct style equates for listbox and combobox and used unfortunately button equates, my mistake.
"minwin.inc" I have updated too, you can find in zip folder.
$ filename "t.exe"
'#include "../../inc/RTL32.inc"
'#include "../../inc/RTL64.inc"
#include "../../inc/MinWin.inc"
%Buttoni = 1001
%ID_LISTBOX = 1002
%ID_Combobox = 1003
#lookahead ' for procedures
s=error()
'
if s then
print s
goto endprog
end if
'==================
'GLOBAL DEFINITIONS
'==================
' sys inst,hdc
' sys xmax,ymax,r,idx,idy,xball,yball
'
' r =15 : idx =5 : idy=5 : xball=200 : yball=100
'=========
'MAIN CODE
'=========
dim cmdline as asciiz ptr, inst as sys
&cmdline=GetCommandLine
inst=GetModuleHandle 0
'
'WINDOWS
'-------
'
WinMain inst,0,cmdline,SW_NORMAL
endprog:
'RELEASE SYSTEM RESOURCES
'---------------------
FreeMinWinLibraries
'===========
'END OF MAIN
'===========
'--------------------------------------------------------------------
Function WinMain(sys inst, prevInst, asciiz*cmdline, sys show) as sys
'====================================================================
WndClass wc
MSG wm
sys hwnd, wwd, wht, wtx, wty, tax, myButton, hList, hCombo, hFont
'string szItem
asciiz*256 szItem
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 "Demo"
RegisterClass (@wc)
Wwd = 320 : Wht = 200
Tax = GetSystemMetrics SM_CXSCREEN
Wtx = (Tax - Wwd) /2
Tax = GetSystemMetrics SM_CYSCREEN
Wty = (Tax - Wht) /2
hwnd = CreateWindowEx 0,wc.lpszClassName,"OXYGEN BASIC",WS_OVERLAPPEDWINDOW,Wtx,Wty,Wwd,Wht,0,0,inst,0
hList = CreateWindowEx(0, _
"Listbox", _
"", _
%WS_CHILD OR %WS_VISIBLE OR %WS_HSCROLL OR _
%WS_VSCROLL OR %WS_BORDER OR %LBS_SORT OR %LBS_NOTIFY OR %LBS_HASSTRINGS, _
22, 20, _
160, 24, _
hWnd, %ID_Listbox, _
inst, 0)
SendMessage hList, WM_SETFONT, hFont, TRUE '1
szItem = "Paula 5"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
szItem = "Robert 4"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
szItem = "Jenny 3"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
szItem = "Laura 2"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
szItem = "Thomas 1"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
szItem = "Cesar 0"
SendMessage hList, %LB_ADDSTRING, 0, @szItem
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
dim as rect crect 'for WndProc and TimerProc
'------------------------------------------------------------------
function WndProc ( sys hWnd, wMsg, wParam, lparam ) as sys callback
'==================================================================
static as sys hdc
static as String txt
static as PaintStruct Paintst
'==========
select wMsg
'==========
CASE WM_COMMAND
IF wparam = %Buttoni THEN
print "hello my oxygen button!"
END IF
'--------------
case WM_CREATE
'=============
GetClientRect hWnd,&cRect
'--------------
case WM_DESTROY
'===============
PostQuitMessage 0
'------------
case WM_PAINT
'============
'TEXT
'http://msdn.microsoft.com/en-us/library/dd144821(v=VS.85).aspx
'DRAWING AND PAINTING
'http://msdn.microsoft.com/en-us/library/dd162760(v=VS.85).aspx
GetClientRect hWnd,&cRect
hDC=BeginPaint hWnd,&Paintst
'style
'0x20 DT_SINGLELINE
'0x04 DT_VCENTER
'0x01 DT_CENTER
'0x25
SetBkColor hdc,yellow
SetTextColor hdc,red
DrawText hDC,"Hello World!",-1,&cRect,0x25
EndPaint hWnd,&Paintst
'--------------
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
2) how I can convert "Ubound" / "Lbound" command to oxygen? I need it for scroll window example. scroll bar I will check for next time too.
best regards, frank