它创建了3个窗口:

  • 第一个作为桌面的子窗口
  • 第二个作为第一个窗口的子窗口
  • 第三个作为第二个窗口的子窗口

窗口创建后,使用WM_ForEachDesc()在其父窗口中移动各个窗口:

 static void _cbWin(WM_MESSAGE * pMsg) {
GUI_COLOR Color;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetUserData(pMsg->hWin, &Color, );
GUI_SetBkColor(Color);
GUI_Clear();
break;
default:
WM_DefaultProc(pMsg);
}
}
/*********************************************************************
*
* _cbDoSomething
*/
static void _cbDoSomething(WM_HWIN hWin, void * p) {
int Value = *(int *)p;
WM_MoveWindow(hWin, Value, Value);
}
/*********************************************************************
*
* MainTask
*/
void Fun(void) {
WM_HWIN hWin_1, hWin_2, hWin_3;
int Value = ;
GUI_COLOR aColor[] = {GUI_RED, GUI_GREEN, GUI_BLUE};
GUI_Init();
WM_SetDesktopColor(GUI_BLACK);
hWin_1 = WM_CreateWindow( , , , , WM_CF_SHOW, _cbWin, );
hWin_2 = WM_CreateWindowAsChild(, , , , hWin_1, WM_CF_SHOW, _cbWin, );
hWin_3 = WM_CreateWindowAsChild(, , , , hWin_2, WM_CF_SHOW, _cbWin, );
WM_SetUserData(hWin_1, &aColor[], );
WM_SetUserData(hWin_2, &aColor[], );
WM_SetUserData(hWin_3, &aColor[], );
while () {
WM_ForEachDesc(WM_HBKWIN, _cbDoSomething, (void *)&Value);
Value *= -;
GUI_Delay();
}
}
  • 前两个为回调函数,Fun函数为主函数,建立3个窗口
  • WM_HWIN WM_CreateWindow(int x0, int y0,
    int width, int height,
    U8 Style, WM_CALLBACK * cb
    int NumExtraBytes);
  • WM_HWIN WM_CreateWindowAsChild(int x0, int y0,
    int width, int height,
    WM_HWIN hWinParent,
    U8 Style,
    WM_CALLBACK* cb
    int NumExtraBytes);
  • void WM_ForEachDesc(WM_HWIN hWin, WM_tfForEach * pcb, void * pData);

最新文章

  1. docker-compose启动报错,解决方案
  2. java6
  3. PPP 转义字符 编码 和 解码
  4. Alpha版本十天冲刺——Day 9
  5. picasso-强大的Android图片下载缓存库
  6. 关于C#中get和set
  7. Linux中部署JAVA程序
  8. 创Wcf案例数据服务
  9. 8.19! 今天我有18生日,点击阅读或顶部 尾随幸运的一天!生日知识!↓——【Badboy】
  10. php面向对象中的魔术方法
  11. 面向对象之组合VS继承:继承过时了?
  12. python 数据分析算法(决策树)
  13. 一个狗血的mysql编码错误
  14. flask上下文(new)
  15. idHTTP 向网站发送json格式数据
  16. Vue 命令
  17. springcloud之Hystrix
  18. win7/win8下手工搭建WAMP环境
  19. 【android】开发中遇到的一些问题
  20. JDBC基本操作示例

热门文章

  1. JavaWeb总结--Servlet 工作原理解析
  2. mysql - 最小缺失值查询
  3. asp.net GDI+绘制多个矩形
  4. [Swift]基础
  5. HQL
  6. constraint更新表列约束默认值
  7. C# webBrowser(wpf/winform) 互调js
  8. 小甲鱼python视频第八讲(课后习题)
  9. WPF中ListBox的样式设置
  10. 遇到的check the manual that corresponds to your MySQL server version for the right syntax错误