1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| DWORD WINAPI Thread1(LPVOID lpParameter) // Reçoit en paramètre l'adresse du pointeur de la staticbox
{
HWND hdl = (HWND) lpParameter ;
CString truc("T") ;
var1.txt1->SetWindowTextW(truc) ;
LRESULT chk1 = SendDlgItemMessage (hdl,IDC_RADIO1, BM_GETSTATE,0,0) ;
LRESULT chk2 = SendDlgItemMessage (hdl, IDC_RADIO2, BM_GETSTATE,0,0) ;
LRESULT chk3 = SendDlgItemMessage (hdl, IDC_RADIO3, BM_GETSTATE,0,0) ;
LRESULT chk4 = SendDlgItemMessage (hdl, IDC_RADIO4, BM_GETSTATE,0,0) ;
while(1)
{
chk1 = SendDlgItemMessage (hdl,IDC_RADIO1, BM_GETSTATE,0,0) ;
chk2 = SendDlgItemMessage (hdl, IDC_RADIO2, BM_GETSTATE,0,0) ;
chk3 = SendDlgItemMessage (hdl, IDC_RADIO3, BM_GETSTATE,0,0) ;
chk4 = SendDlgItemMessage (hdl, IDC_RADIO4, BM_GETSTATE,0,0) ;
if( chk1 == BST_CHECKED )
{
truc="1" ;
var1.txt1->SetWindowTextW(truc) ;
}
else if( chk2 == BST_CHECKED )
{
truc="2" ;
var1.txt1->SetWindowTextW(truc) ;
}
else if( chk3 == BST_CHECKED )
{
truc="3" ;
var1.txt1->SetWindowTextW(truc) ;
}
else if( chk4 == BST_CHECKED )
{
truc="4" ;
var1.txt1->SetWindowTextW(truc) ;
}
}
return 0;
} |