国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

gdi文字和矩形填充

2019-11-14 09:35:02
字體:
來源:轉載
供稿:網友

磨磨唧唧終于搞清楚怎么用gdi畫圖和寫字了,什么字體這些亂七八糟的東西等我把鼠標取詞完成后再說,后面在把詳細的補上

#include <windowsx.h>#include <stdio.h>#include <stdlib.h>#include <tchar.h>#include <StrSafe.h> #include "CmnHdr.h"LRESULT CALLBACK WndPRoc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ RECT Rect; PAINTSTRUCT ps; HDC hdc; TCHAR Text[100]; switch (message) { case WM_CLOSE: DestroyWindow(hWnd); PostQuitMessage(NULL); case WM_PAINT: StringCchPrintf(Text, _countof(Text), TEXT("Hello World Hello World")); hdc = BeginPaint(hWnd, &ps); SelectObject(hdc, GetStockObject(NULL_PEN)); Rectangle(hdc, 10, 10, 110,110); Rect.left = 20; Rect.top = 20; Rect.right = 100; Rect.bottom = 100; DrawTextEx(hdc, Text, _tcslen(Text), &Rect, DT_TOP | DT_WordBREAK , NULL); EndPaint(hWnd, &ps); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0;}VOID MyCreateWindow(HINSTANCE hInstanceExe) { MSG msg; WNDCLASSEX wcex; HWND hWinMain; TCHAR ClassName[100]; TCHAR ClassCaption[100]; StringCchPrintf(ClassName, _countof(ClassName), TEXT("MyClassName")); StringCchPrintf(ClassCaption, _countof(ClassCaption), TEXT("MyClassCaption")); wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstanceExe; wcex.hIcon = LoadIcon(0, IDC_ARROW); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); GetStockObject(GRAY_BRUSH); wcex.hbrBackground = (HBRUSH)(GetStockObject(GRAY_BRUSH)); wcex.lpszMenuName = 0; wcex.lpszClassName = ClassName; wcex.hIconSm = LoadIcon(wcex.hInstance, 0); RegisterClassEx(&wcex); hWinMain = CreateWindowEx(WS_EX_CLIENTEDGE,ClassName,ClassCaption, WS_OVERLAPPEDWINDOW, 100,100,600,400, NULL,NULL,hInstanceExe,NULL ); ShowWindow(hWinMain, SW_SHOWNORMAL); UpdateWindow(hWinMain); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); }}int WINAPI _tWinMain (HINSTANCE hInstanceExe, HINSTANCE, PTSTR pszCmdLine, int) { MyCreateWindow(hInstanceExe); return (0);}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永嘉县| 南岸区| 余姚市| 于都县| 阳西县| 璧山县| 江西省| 新疆| 旬邑县| 丰都县| 新竹市| 宁陵县| 西藏| 大兴区| 开平市| 曲水县| 申扎县| 石首市| 赣榆县| 德州市| 中西区| 枣庄市| 密云县| 莱西市| 吉木萨尔县| 象山县| 淮滨县| 扶沟县| 治县。| 新安县| 富源县| 临沧市| 拉孜县| 东阿县| 铁岭县| 武夷山市| 陇川县| 迁安市| 梅河口市| 郸城县| 郸城县|