消息的传送问题
消息的传送问题
我画了一个对话框
放了一个listbox
和三个button
然后写了如下代码:
//manager.cpp
//----------------------------------------
#include "stdafx.h"
#include "manager.h"
#define LOWORD(l) ((WORD)(l))
int CALLBACK DlgProc(HWND hwndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_CLOSE:
PostQuitMessage(0);
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_NEW:
MessageBox(hwndDlg,"new","hello",MB_OK);
break;
case IDC_DEL:
MessageBox(hwndDlg,"delete","hello",MB_OK);
break;
case IDC_PROPER:
MessageBox(hwndDlg,"property","hello",MB_OK);
break;
default: break;
}
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
DialogBox(hInstance,MAKEINTRESOURCE(DLG_MAIN),0, DlgProc);
return 0;
}
//----------------------------------------------------------
//-res.h
#ifndef _RES_H_
#define _RES_H_
#define DLG_MAIN 101
#define IDC_DEL 1001
#define IDC_NEW 1002
#define IDC_PROPER 1003
#endif
//----------------
//manager.h
#ifndef _MANAGERH_
#define _MANAGERH_
#include <windows.h>
#include "res.h"
#endif
结果,只有当按下New按钮时才有消息发出
且每次都是IDC_PROPER 即每次都是1003
请指点
我画了一个对话框
放了一个listbox
和三个button
然后写了如下代码:
//manager.cpp
//----------------------------------------
#include "stdafx.h"
#include "manager.h"
#define LOWORD(l) ((WORD)(l))
int CALLBACK DlgProc(HWND hwndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_CLOSE:
PostQuitMessage(0);
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_NEW:
MessageBox(hwndDlg,"new","hello",MB_OK);
break;
case IDC_DEL:
MessageBox(hwndDlg,"delete","hello",MB_OK);
break;
case IDC_PROPER:
MessageBox(hwndDlg,"property","hello",MB_OK);
break;
default: break;
}
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
DialogBox(hInstance,MAKEINTRESOURCE(DLG_MAIN),0, DlgProc);
return 0;
}
//----------------------------------------------------------
//-res.h
#ifndef _RES_H_
#define _RES_H_
#define DLG_MAIN 101
#define IDC_DEL 1001
#define IDC_NEW 1002
#define IDC_PROPER 1003
#endif
//----------------
//manager.h
#ifndef _MANAGERH_
#define _MANAGERH_
#include <windows.h>
#include "res.h"
#endif
结果,只有当按下New按钮时才有消息发出
且每次都是IDC_PROPER 即每次都是1003
请指点
...全文
相关推荐
H2DB数据库使用方法
H2DB数据库使用方法,一个简单的ppt
HTML5 Web Database 数据库的SQL语句的使用方法
本文将详细介绍HTML5 Web Database 数据库的SQL语句的使用方法,需要了解的朋友可以参考下
数据仓库的使用方法.pptx
数据仓库的使用方法.pptx
HSQL DB 在Web 应用下使用方法
NULL 博文链接:https://brofe.iteye.com/blog/410055
使用SSIS创建同步数据库数据任务的方法
SSIS(SQL Server Integration Services)是用于生成企业级数据集成和数据转换解决方案的平台。使用 Integration Services 可解决复杂的业务问题,具体表现为:复制或下载文件,发送电子邮件以响应事件,更新数据仓库,清除和挖掘数据以及管理 SQL Server 对象和数据


