菜鸟问 啥是回调函数
#include<stdio.h>int max(int a, int b){ if(a>b) return a; else return b;}void main(){ int (*pmax)(int,int); int a,b,c; pmax=max; printf("input two number:"); scanf("%d,%d",&a,&b); c=(*pmax)(a,b); printf("max=%d\n",c);}
/***************************************************************************** 名 称:static void _cbCallback(WM_MESSAGE * pMsg) * 功 能:窗体回调函数 * 入口参数:无* 出口参数:无* 说 明:* 调用方法:无 ****************************************************************************/static void _cbCallback(WM_MESSAGE * pMsg) { int NCode, Id; WM_HWIN hDlg; hDlg = pMsg->hWin; switch (pMsg->MsgId) { case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); /*获得窗体部件的ID*/ NCode = pMsg->Data.v; /*动作代码 */ switch (NCode) { case WM_NOTIFICATION_VALUE_CHANGED: /*窗体部件的值被改变 */ _OnValueChanged(hDlg, Id); break; default: break; } break; default: WM_DefaultProc(pMsg); }}