/*
***********************************************************************************
* 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
阅读(2367) | 评论(1) | 转发(0) |