它创建了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);

[ucgui] 子窗口父窗口的更多相关文章

  1. 关于Mdi窗口-父窗口上的控件把子窗口的挡住的问题

    using System.Runtime.InteropServices; [DllImport("user32")] public static extern int SetPa ...

  2. 更新记录后关闭子窗口并刷新父窗口的Javascript

    有时我们需要在新打开的窗口里面编辑信息,等编辑完了,需要将当前窗口关闭并且刷新父窗口,以使修改生效,本文就是介绍用 javascript 来实现"更新记录后关闭子窗口并刷新父窗口" ...

  3. HTML中IFrame父窗口与子窗口相互操作

    一.Iframe篇 //&&&&&&&&&&&&&&&&&&am ...

  4. JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...

  5. 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...

  6. 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...

  7. showModalDialog()子窗口刷新父窗口

    今天再次使用showModalDialog(),发现了两个问题,一是子窗口如何刷新父窗口,二是窗口的参数问题. 1 子窗口刷新父窗口 如果是window.open();问题就好办,直接用window. ...

  8. mfc窗口,父窗口parentwindow,所有者窗口ownerwindow 区别

    一. parent:创建者,owner:所有者 小玉的父母生下小玉,养到8岁,卖给贾府当丫头小玉的父母是parent,贾府是owner 二. 1.Pop-up窗口: 一个弹出窗口是必须具有WS_POP ...

  9. 窗口,父窗口parentwindow,所有者窗口ownerwindow

    参考文档:http://www.cnblogs.com/fwycmengsoft/p/4026592.html 一. parent:创建者,owner:所有者 小玉的父母生下小玉,养到8岁,卖给贾府当 ...

随机推荐

  1. MFCC matlab code

    %function ccc=mfcc(x) %归一化mel滤波器组系数 filename=input('input filename:','s'); [x,fs,bits]=wavread(filen ...

  2. perl中读取外部文件

    打开一个在电脑G盘111文件下的一个文件 #!/usr/bin/perl -w  use strict; open(IN,"G:/111/mylove.txt"); while($ ...

  3. Linux网络编程-SIGPIPE信号导致的程序退出问题

    当客户端close关闭连接时,若server端接着发送数据,根据TCP协议的规定,server端会收到RST响应,当server端再次往客户端发送数据时,系统会发出一个SIGPIPE信号给server ...

  4. expdp报错ora 39126

    11.2.0.2,expdp报错: ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS []O ...

  5. 将asp.net页面弄成伪静态

    在Web.config中写: <RewriterConfig>     <Rules> <RewriterRule>         <LookFor> ...

  6. C4.5算法

    C4.5算法是对ID3算法的改进,在决策树的生成过程中,使用了信息增益率作为属性选择的方法,其具体的算法步骤如下: 输入:训练数据集D,特征集A,阈值e 输出:决策树T 1.如果D中所有实例属于同一类 ...

  7. python学习之路-day2-pyth基础2

    一.        模块初识 Python的强大之处在于他有非常丰富和强大的标准库和第三方库,第三方库存放位置:site-packages sys模块简介 导入模块 import sys 3 sys模 ...

  8. Awesome Machine Learning

    https://github.com/josephmisiti/awesome-machine-learning 包含了很多的machine-learning开源的资源,包括各种语言的machin l ...

  9. gvim 配置Pydiction

    配置windows下gvim 的python关键字补全插件Pydiction 1.下载Pydiction 2.解压缩包,里面有after文件夹.complete-dict.pydiction.py 3 ...

  10. loadrunner11录制报 NOT PROXIED!错误,无法生成脚本

    使用loadrunner11,IE9录制完脚本,报错: [Net An. Error    (1dec:282c)] Request Connection: Remote Server @ 210.5 ...