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
|
#include <resource.h>
#define LABEL1 0
#define FIRSTVELOCITYVALUE 1
#define LABEL2 2
#define ACCELERATION 3
#define LABEL3 4
#define ENDVELOCITYVALUE 5
#define BUTTON 6
#define LABEL4 7
#define TIME 8
TCHAR buffer[14];
Window(HWND A,UINT B,WPARAM C,LPARAM D){
switch(B){case WM_CREATE:{
Create br(label,"First Velocity Value:",5,10,130,18,A,(HMENU)LABEL1);
Create br2(text,"",135,10,100,15,A,(HMENU)FIRSTVELOCITYVALUE);
Create br3(label,"Acceleration:",5,30,85,15,A,(HMENU)LABEL2);
Create br4(text,"",135,30,100,15,A,(HMENU)ACCELERATION);
Create br5(label,"End Velocity Value:",5,68,125,18,A,(HMENU)LABEL3);
Create br6(text,"",135,70,100,15,A,(HMENU)ENDVELOCITYVALUE);
Create br7(but,"Result",235,110,85,20,A,(HMENU)BUTTON);
Create br9(text,"",135,50,100,15,A,(HMENU)TIME);
Create br8(label,"Time:",5,50,35,15,A,(HMENU)LABEL4);
break;}
case WM_COMMAND:{
switch(LOWORD(C)){
case BUTTON:{
double v_first,acceleration,v_end,time;
v_first=GetDlgItemInt(A,FIRSTVELOCITYVALUE,NULL,TRUE);
acceleration=GetDlgItemInt(A,ACCELERATION,NULL,TRUE);
time=GetDlgItemInt(A,TIME,NULL,TRUE);
v_end=v_first+acceleration*time;
SetDlgItemText(A,ENDVELOCITYVALUE,_gcvt((v_end),13,buffer));
break;}}
break;}
Protocole;
}
WindowTitle Title("Force And Action");
WindowSize Size(50,150,350,200);
WindowCreate;
|