你是否正在寻找关于dialogboxparam的内容?让我把最实时的东西奉献给你:
/*******************************************************************************
* File:FirstTry.cpp
* Author:guzhoudiaoke@126.com
* Time:2013-04-14
* 描述:主要尝试使用DialogBoxParam函数显式一个对话框
*******************************************************************************/
#include <Windows.h>
#include <Windowsx.h>
#include <tchar.h>
#include "Resource.h"
/* SetDlgMsgResult This macro maps to the SetWindowLong function.
* SetWindowLong changes an attribute of the specified window, also sets a 32-bit (LONG)
* value at the specified offset into the extra window memory of a window.
* The normal HANDLE_MSG macro in WindowsX.h does not work properly for dialog
* boxes because DlgProc returns a BOOL instead of an LRESULT (likeWndProcs).
* This chHANDLE_DLGMSG macro corrects the problem.
*/
#define chHANDLE_DLGMSG(hWnd, message, fn)
\
case (message): return (SetDlgMsgResult(hWnd, uMsg,
\
HANDLE_##message((hWnd), (wParam), (lParam), (fn))))
void Dlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
switch (id) {
case IDCANCEL:
EndDialog(hwnd, id);
break;
}
}
// 对话框过程函数
INT_PTR WINAPI Dlg_Proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
chHANDLE_DLGMSG(hwnd, WM_COMMAND, Dlg_OnCommand);
}
return FALSE;
}
int WINAPI _tWinMain(HINSTANCE hinstExe, HINSTANCE, PTSTR pszCmdLine, int)
{
dialogboxparam(hinstExe, MAKEINTRESOURCE(IDD_FIRSTTRY), NULL, Dlg_Proc, _ttoi(pszCmdLine));
return 0;
}
其中chHANDLE_DLGMSG是原书作者对HANDLE_MSG的改进,。
以上就是关于dialogboxparam的全部内容,相信你一定会非常满意。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shenmilingyu/article-3238-1.html
允许同志结婚倒是不错的见解
很喜欢舒淇