YES...
I finally got it what is wrong ,i add control ID in SetButton() function and work.
'syn : SetButton (hwnd,x,y,w,h,caption$,style,ext,controlID)
Function SetButton(byval _bhwnd as int,byval _bx as int,byval _by as int,byval _bw as int,byval _bh as int, byval _btext as string,byval _bflag as int,byval _ext as int,byval _cID as INT) as int
If _bflag=0
_bflag = 0x50000000
EndIf
_ext = 0
hButton = CreateWindowEx(_ext,"BUTTON",_btext,_bflag,_bx,_by,_bw,_bh,_bhwnd,_cID,0,0)
UpdateWindow _bhwnd
Function = hButton
End Function
Note:this function is inside awinh.inc
So now example code look like this :
Include "awinh.inc"
#lookahead ' for procedures
INT win
INT winstyle
INT button1,button2
INT ed1
INT Lb1
int ed2
INT b1ID,b2ID,b3ID,b4ID,b5ID,b6ID,b7ID
b1ID=100
b1ID=101
b1ID=102
b1ID=103
b1ID=104
b1ID=105
winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN
'create window
win = SetWindow("Test AwinH",100,100,640,480,winstyle)
'create buttons
button1 = SetButton(win,200,40,80,24,"button_1",0x50000001,0x200,b1ID)
button2 = SetButton(win,300,40,80,24,"button_2",0x50000001,0x200,b2ID)
'create edit control
ed1 = SetEditBox(win,200,80,80,24,"edit 1",0,0)
'create listbox
Lb1 = SetListBox(win,200,140,180,240,"LB 1",0,0)
'WHILE GetMessage (&wm,0,0,0)<>0
'TranslateMessage &wm
'DispatchMessage &wm
'WEND
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
Function WndProc(byval hWnd as long,byval wMsg as long, byval wParam as long,byval lparam as long) as long callback
SELECT wMsg
'----------------------------
CASE WM_DESTROY
PostQuitMessage 0
'-------------------------------------------------------------
CASE WM_COMMAND
controlID = LoWord(wparam) 'get control ID
notifyCode = HiWord(wParam) 'get notification message
Select controlID
Case b1ID
If notifycode=0
Print "Button 1 Clicked!"
End If
Case b2ID
If notifycode=0
Print "Button 2 Clicked!"
End If
End Select
'-----------------------------------------------------
END SELECT
FUNCTION = DefWindowProc hwnd,wMsg,wParam,lParam
END FUNCTION