资源简介
Q760642.zip windows程序设计 编写Windows窗口应用程序实现对话框与菜单的应用 https://ask.csdn.net/questions/760642 编写Windows窗口应用程序实现对话框与菜单的应用
1)编程实现如下应用程序,含有菜单,单击“新建”时弹出新建对话框(非模态对话框),单击对话框颜色按钮后应用程序窗口字体和背景色发生相应的变化。单击“关于”菜单项时弹出关于对话框(模态对话框)。
(Winodws对话框、Windows菜单)

代码片段和文件信息
// Q760642.cpp : Defines the entry point for the application.
//
#include “stdafx.h“
#include “commdlg.h“
#include “Q760642.h“
#define MAX_LOADSTRING 100
LRESULT CALLBACK NewWndProc(HWND hWnd UINT message WPARAM wParam LPARAM lParam);
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR sztitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
HWND hWnd;
HWND newdlghWnd;
HBRUSH hmainBrush = NULL;
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
INT_PTR CALLBACK About(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;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
LoadString(hInstance IDC_Q760642 szWindowClass MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance MAKEINTRESOURCE(IDC_Q760642));
// Main message loop:
while (GetMessage(&msg NULL 0 0))
{
if (!TranslateAccelerator(msg.hwnd hAccelTable &msg))
{
if (!IsDialogMessage(newdlghWnd &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the ‘RegisterClassEx‘
// function that was added to Windows 95. It is important to call this function
// so that the application will get ‘well formed‘ small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance MAKEINTRESOURCE(IDI_Q760642));
wcex.hCursor = LoadCursor(NULL IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_Q760642);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HINSTANCE int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function we
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-10 01:41 Q760642\Debug\
文件 91648 2019-05-10 01:38 Q760642\Debug\Q760642.exe
文件 888 2019-05-10 00:18 Q760642\Q760642.sln
文件 12288 2019-05-10 01:41 Q760642\Q760642.suo
目录 0 2019-05-10 01:05 Q760642\Q760642\
目录 0 2019-05-10 01:42 Q760642\Q760642\Debug\
文件 52452 2019-05-10 01:05 Q760642\Q760642\Q760642.APS
文件 6923 2019-05-10 01:38 Q760642\Q760642\Q760642.cpp
文件 39 2019-05-10 00:18 Q760642\Q760642\Q760642.h
文件 23558 2009-08-31 02:31 Q760642\Q760642\Q760642.ico
文件 8774 2019-05-10 01:04 Q760642\Q760642\Q760642.rc
文件 4592 2019-05-10 00:18 Q760642\Q760642\Q760642.vcxproj
文件 1824 2019-05-10 00:18 Q760642\Q760642\Q760642.vcxproj.filters
文件 143 2019-05-10 00:18 Q760642\Q760642\Q760642.vcxproj.user
文件 2578 2019-05-10 00:18 Q760642\Q760642\ReadMe.txt
文件 2252 2019-05-10 01:04 Q760642\Q760642\resource.h
文件 23558 2009-08-31 02:31 Q760642\Q760642\small.ico
文件 294 2019-05-10 00:18 Q760642\Q760642\stdafx.cpp
文件 529 2019-05-10 00:18 Q760642\Q760642\stdafx.h
文件 314 2019-05-10 00:18 Q760642\Q760642\targetver.h
- 上一篇:指纹识别的代码
- 下一篇:2个8位PWM实现16位DAC
相关资源
- zlib 最新 1.2.8 win32 win64 编译好的dll
- Win32 API大全.chm
- eetop.cn_eetop.cn_hfss15_win32crack
- nginx-rtmp-win32-master.rar
- sunxi-tools-win32-support_f1c100s_32M(32M fl
- ipscan-win32
- ffplay_win32
- cmake-3.7.0-win32-x86.zip官方绿色包
- ffmpeg-3.2-win32-shared.zip
- windows32位系统的ffmpeg
- ffmpeg-2.5.2-win32-shared
- OpenCC-1.0.5-Win32
- Notepad++的Json格式化插件win32和x64两版
- Eclipse64位4.3开普勒版eclipse-standard-ke
- award_bios_editor1.2_win32.zip
- Eclipse64位4.3.2开普勒版eclipse-jee-keple
- ninja(windows 32/64位)
- ffmpeg-4.2.1-win32-dev.zip
- Eclipse64位4.3开普勒版eclipse-jee-kepler-
- Eclipse32位4.3开普勒版eclipse-standard-ke
- pywin32-225-cp38-cp38-win_amd64.whl
- openssl-0.9.8k_WIN32.rar
- chromedriver_win32适用于 72.0.3626.119正式版
- 操作系统程序 WIN32API 进程的控制通信
- Pywin32-222.win-amd64-py3.7
- TimeControl定时提醒小工具源码
- protoc-3.4.0-win32
- 3DxWare-SDK_v2-0-4_win32
- win32下的简单打字游戏
- coreseek-3.2.14-win32
评论
共有 条评论