标签:des style blog color os 使用 for ar div
它创建了3个窗口:
窗口创建后,使用WM_ForEachDesc()在其父窗口中移动各个窗口:
1 static void _cbWin(WM_MESSAGE * pMsg) { 2 GUI_COLOR Color; 3 switch (pMsg->MsgId) { 4 case WM_PAINT: 5 WM_GetUserData(pMsg->hWin, &Color, 4); 6 GUI_SetBkColor(Color); 7 GUI_Clear(); 8 break; 9 default: 10 WM_DefaultProc(pMsg); 11 } 12 } 13 /********************************************************************* 14 * 15 * _cbDoSomething 16 */ 17 static void _cbDoSomething(WM_HWIN hWin, void * p) { 18 int Value = *(int *)p; 19 WM_MoveWindow(hWin, Value, Value); 20 } 21 /********************************************************************* 22 * 23 * MainTask 24 */ 25 void Fun(void) { 26 WM_HWIN hWin_1, hWin_2, hWin_3; 27 int Value = 10; 28 GUI_COLOR aColor[] = {GUI_RED, GUI_GREEN, GUI_BLUE}; 29 GUI_Init(); 30 WM_SetDesktopColor(GUI_BLACK); 31 hWin_1 = WM_CreateWindow( 10, 10, 100, 100, WM_CF_SHOW, _cbWin, 4); 32 hWin_2 = WM_CreateWindowAsChild(10, 10, 80, 80, hWin_1, WM_CF_SHOW, _cbWin, 4); 33 hWin_3 = WM_CreateWindowAsChild(10, 10, 60, 60, hWin_2, WM_CF_SHOW, _cbWin, 4); 34 WM_SetUserData(hWin_1, &aColor[0], 4); 35 WM_SetUserData(hWin_2, &aColor[1], 4); 36 WM_SetUserData(hWin_3, &aColor[2], 4); 37 while (1) { 38 WM_ForEachDesc(WM_HBKWIN, _cbDoSomething, (void *)&Value); 39 Value *= -1; 40 GUI_Delay(500); 41 } 42 }
标签:des style blog color os 使用 for ar div
原文地址:http://www.cnblogs.com/zjutlitao/p/3930540.html