Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1048142
  • 博文数量: 178
  • 博客积分: 10222
  • 博客等级: 上将
  • 技术积分: 2215
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-03 11:27
个人简介

有所追求

文章分类

全部博文(178)

文章存档

2012年(1)

2011年(5)

2010年(3)

2009年(78)

2008年(91)

我的朋友

分类:

2008-02-03 22:11:45

/*
***********************************************************************************
*                                                uC/GUI
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : WM__SendMessage.c
Purpose     : Implementation of WM__SendMessage
----------------------------------------------------------------------
*/
#include            /* needed for definition of NULL */
#include "WM_Intern.h"
#if GUI_WINSUPPORT    /* If 0, WM will not generate any code */
/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       WM__SendMessage
*/
void WM__SendMessage(WM_HWIN hWin, WM_MESSAGE* pMsg) {
// 创建的窗体的句柄转化为指针,同时创建结构pWin时创建了回调函数指针cb指向WM_CALLBACK
// typedef void WM_CALLBACK( WM_MESSAGE* pMsg);
// #define WM_HANDLE2PTR(hWin) ((WM_Obj*)WM_HMEM2Ptr(hWin))
  WM_Obj* pWin = WM_HANDLE2PTR(hWin);
// 此窗体句柄存入消息结构中
  pMsg->hWin = hWin;
// 此处cb为回调函数指针,在窗体创建时作为参数带入
  if (pWin->cb != NULL) {
// 执行相应回调函数,pMsg作为参数消息带入
    (*pWin->cb)(pMsg);
  } else {
    WM_DefaultProc(pMsg);
  }
}
#endif
阅读(2354) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

liseri2009-07-11 15:41:33

谢谢!