#include<windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrveIntance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAPPName[] = TEXT("MyWindows");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAPPName;
if (!RegisterClass(&wndclass))
{ MessageBox(NULL, TEXT("RESULT"), szAPPName, MB_OK | MB_ICONWARNING);
return 0;
}
hwnd = CreateWindow(szAPPName,
TEXT("空间"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL); ShowWindow(hwnd, iCmdShow);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;}LRESULT CALLBACK WhdProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
DrawText(hdc, TEXT("大家好"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hwnd, &ps);
return 0; }
return DefWindowProc(hwnd, message, wParam, lParam);
}
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrveIntance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAPPName[] = TEXT("MyWindows");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAPPName;
if (!RegisterClass(&wndclass))
{ MessageBox(NULL, TEXT("RESULT"), szAPPName, MB_OK | MB_ICONWARNING);
return 0;
}
hwnd = CreateWindow(szAPPName,
TEXT("空间"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL); ShowWindow(hwnd, iCmdShow);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;}LRESULT CALLBACK WhdProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
DrawText(hdc, TEXT("大家好"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hwnd, &ps);
return 0; }
return DefWindowProc(hwnd, message, wParam, lParam);
}
解决方案 »
- 在XP系统下office2010中word无法直接打开的问题
- 宿主win2012, hyper v 安装了centos 6.4的虚拟机?物理网络是万兆网卡,如何让虚拟机具备同样链路带宽。
- 客户端访问远程桌面报错
- 正版win10安装WIN7的时候总是提示替换或跳过文件
- windows2008无法创建新帐户,老说账户名无效,高手速来!
- 这是什么,必须虐杀病毒?
- 向大佬请教一下bios这方面的问题
- 如何在excel中对姓名列按照拼音进行多行排序
- 目前windows主流的软件打包程序有哪些
- windows server 组授权问题
- 求解救 net framework 装了一个星期
- 求助,如何bat批量获取文件修改时间并精确到秒
错误 LNK2019 无法解析的外部符号 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z),该符号在函数 _WinMain@16 中被引用 Project1 C:\Users\10045\source\repos\Project1\Project1\源.obj 1