盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

Windows的多线程程序设计初步

时间:2025/1/2作者:未知来源:盾怪网教程人气:

[摘要]cyClient != 0)     xLeft = rand () % cxClient ;   xRight = rand () % cxClient ;   yTop = rand () % ...
cyClient != 0)
  {
   xLeft = rand () % cxClient ;
   xRight = rand () % cxClient ;
   yTop = rand () % cyClient ;
   yBottom = rand () % cyClient ;
   iRed = rand () & 255 ;
   iGreen = rand () & 255 ;
   iBlue = rand () & 255 ;
 
   hdc = GetDC (hwnd) ;
   hBrush = CreateSolidBrush (RGB (iRed, iGreen, iBlue)) ;
   SelectObject (hdc, hBrush) ;

   Rectangle (hdc,min (xLeft, xRight), min (yTop, yBottom),
     max (xLeft, xRight), max (yTop, yBottom)) ;

   ReleaseDC (hwnd, hdc) ;
   DeleteObject (hBrush) ;
  }
 }
}

LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 switch (message)
 {
  case WM_CREATE:
   _beginthread (Thread, 0, NULL) ;
   return 0 ;
  case WM_SIZE:
   cxClient = LOWORD (lParam) ;
   cyClient = HIWORD (lParam) ;
   return 0 ;
  case WM_DESTROY:
   PostQuitMessage (0) ;
   return 0 ;
 }
 return DefWindowProc (hwnd, message, wParam, lParam) ;
}

//demo4 end-----------------------------------------------


  参考:windows 程序设计 

关键词:Windows的多线程程序设计初步




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版