#include<Windows.h> LRESULT CALLBACK WindowProc(HWND,UINT,WPARAM,LPARAM); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow ) { TCHAR szAppName[] = TEXT("KeyView1"); HWND hwnd; MSG msg; WNDCLASSEX wndClass; wndClass.cbSize = sizeof(WNDCLASSEX); wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndClass.hCursor = LoadCursor(NULL,IDC_ARROW); wndClass.hIcon = LoadIcon(NULL,IDI_APPLICATION); wndClass.hIconSm = LoadIcon(NULL,IDI_APPLICATION); wndClass.hInstance = hInstance; wndClass.lpfnWndProc = WindowProc; wndClass.lpszClassName = szAppName; wndClass.lpszMenuName = NULL; wndClass.style = CS_VREDRAW|CS_HREDRAW; if(!RegisterClassEx(&wndClass)) { MessageBox(NULL,TEXT("it requires Windows NT!"),TEXT("TIPS"),0); return -1; } hwnd = CreateWindow( szAppName,TEXT("KeyView1 Window"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, NULL,NULL,hInstance,NULL ); ShowWindow(hwnd,iCmdShow); UpdateWindow(hwnd); while(GetMessage(&msg,0,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; switch(message) { case WM_CREATE: break; case WM_PAINT: hdc = BeginPaint(hwnd,&ps); EndPaint(hwnd,&ps); break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hwnd,message,wParam,lParam); }
,相关文章
- Python 内置界面开发框架 Tkinter入门篇 丙(文末有福利彩蛋,今天可是元宵节)
- com.panie 项目开发随笔_前后端框架考虑(2016.12.8)
- 基于 Vue.js 之 iView UI 框架非工程化实践记要 使用 Newtonsoft.Json 操作 JSON 字符串 基于.net core实现项目自动编译、并生成nuget包 webpack + vue 在dev和production模式下的小小区别 这样入门asp.net core 之 静态文件 这样入门asp.net core,如何
- 使用Scrapy爬虫框架简单爬取图片并保存本地(妹子图)
- 腾讯出品小程序自动化测试框架【Minium】系列(五)API详解(中)
- 为项目框架创建一个git仓库
- Python+自动化测试框架的设计编写
- 如何手动将第三方Swift框架导入Swift iOS项目?
- 如何在Xamarin.iOS项目中添加第三方库/框架?
- 最新 Eclipse IDE下的Spring框架配置及简单实例