Boujour à Tous!
Voila mon probleme , j'essaye de faire un logiciel dessinant une courbe mais dès que la fenetre s'ouvre, elle se referme et cela est du à WM_PAINT
Voici le bout de code:
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
POINT pos;
hDC = BeginPaint (hwnd,&ps);
Polygon (hDC,Poly,4 );
MoveToEx (hDC,425,10,&pos);
SelectObject (hDC,absord);
LineTo(hDC,425,310);
LineTo(hDC,775,310);
//---
MoveToEx (hDC,firstx,secondy,&pos);
SendMessage (hwnd,WM_USER,0,0);
for (paint = 0; paint <= xmax;paint+=dist)
{
x = firstx + (paint*refx);
y = secondy - (2*paint*refy);
LineTo (hDC,x,y);
sprintf (egal,"%d=%d=>",x,y);
strcat (edit,egal);
SetWindowText (hchiffre,edit);
}
for (paint = 0; paint <= xmax;paint+=dist)
{
MoveToEx (hDC,firstx,secondy,&pos);
x = firstx + (paint*refx);
MoveToEx (hDC,x,310,&pos);
LineTo (hDC,x,305);
}
for (paint = 0; paint <= 10; paint++);
{
MoveToEx (hDC,firstx,secondy,&pos);
y = secondy - (paint*refy);
MoveToEx (hDC,425,y,&pos);
LineTo (hDC,420,y);
}
//---
EndPaint (hwnd,&ps);
break;
Merci d'avance pour votre aide.
Bye
P.S: Je n'ai commencer le WinAPI, il n'y as pas longtemp.