用WIN32应用程序修改而成的WIN32对话框程序(模板)
来源:互联网 发布:js 对象长度 编辑:程序博客网 时间:2024/06/05 10:12
// win32dlg.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "win32dlg.h"
// Global Variables:
HINSTANCE hInst; // current instance
// Forward declarations of functions included in this code module:
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK Dialog1Proc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!IsDialogMessage(msg.hwnd, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, Dialog1Proc);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
// Message handler for dialog1.
INT_PTR CALLBACK Dialog1Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
PostQuitMessage(0);
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
- 用WIN32应用程序修改而成的WIN32对话框程序(模板)
- 简单的Win32对话框程序
- Win32程序关于对话框
- Win32对话框程序_1
- VS中win32应用程序和win32控制台程序的差别
- 用vc6生成win32对话框程序的简单方法
- 简易的WIN32对话框程序框架
- MFC之基于对话框的Win32程序
- Win32模板程序
- 基于win32应用程序的电梯调度程序
- win32的对话框问题
- 基于 Win32 的应用程序
- [Win32]Win32窗口应用程序的框架
- Win32对话框
- 用pywinauto进行win32应用程序的测试
- 用pywinauto进行win32应用程序的测试
- 用pywinauto进行win32应用程序的测试
- C++win32 SDK下面如何修改应用程序的图标
- 实用!超强VC/MFC 常见问答收集
- 用Viusal C++实现字符串分割函数
- 《OpenSSL与网络信息安全——基础、结构和指令》作者简介
- 接口和抽象类的理解2
- 关于移动名片
- 用WIN32应用程序修改而成的WIN32对话框程序(模板)
- Struts2之HelloWorld程序
- linux线程,进程经典文章
- const语法理解
- STL中的如此简单的常识现在才知道!!!
- Service threw an exception during method invocation: null错误
- 我的博客地址
- DATASTAGE——关于数据分区的概述
- 给ActiveX控件加上数字签名的步骤