该楼层疑似违规已被系统折叠隐藏此楼查看此楼
#include
#include
constcharg_szClassName[]="Example";
constcharg_szCaption[]="Archimedes\'Screw";
constintID_TIMER1=1,
   nScreenWidth=GetSystemMetrics(SM_CXSCREEN),
   nScreenHeight=GetSystemMetrics(SM_CYSCREEN);
LRESULTCALLBACKWndProc(HWNDhWnd,UINTmsg,WPARAMwParam,LPARAMlParam)
{
   staticboolflag=false;
   staticdoublemax_theta=0;
   staticPAINTSTRUCTps;
   staticHDChDC,mDC;
   switch(msg)
   {
   caseWM_PAINT:
      hDC=BeginPaint(hWnd,&ps);
      for(doubletheta=0;theta
         SetPixel(hDC,nScreenWidth/2+10*cos(theta)*theta,nScreenHeight/2+10*sin(theta)*theta,RGB(255,0,0));
      UpdateWindow(hWnd);
      EndPaint(hWnd,&ps);
      return0;
   caseWM_TIMER:
      if(!flag)
      {
         if(max_theta
         {
            max_theta+=5;
            InvalidateRect(hWnd,NULL,TRUE);
         }
         elseflag=true;
      }
      elseif(max_theta>0)
      {
         max_theta-=5;
         InvalidateRect(hWnd,NULL,TRUE);
      }
      elseKillTimer(hWnd,ID_TIMER1);
      return0;
   caseWM_DESTROY:
      PostQuitMessage(0);
      return0;
   }
   returnDefWindowProcA(hWnd,msg,wParam,lParam);
}
intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPSTRlpCmdLine,intnCmdShow)
{
   WNDCLASSAwc;
   HWNDhWnd;
   MSGmsg;
   wc.style    =0;