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

首頁 > 學院 > 開發(fā)設計 > 正文

VC++簡單窗口

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

計劃寫一個取詞軟件,看完hook,遠程注入后發(fā)現用VC++連個GDI畫圖都不會,學起來有點暈,干脆用win32匯編的程序改吧

#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")); hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &Rect); DrawText(hdc, Text, -1, &Rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); 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); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); 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);}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 南宫市| 宜章县| 宣武区| 郑州市| 岢岚县| 天峨县| 宁陕县| 寻甸| 武穴市| 广饶县| 黄梅县| 涿鹿县| 栖霞市| 西宁市| 焦作市| 丘北县| 灵丘县| 福泉市| 康定县| 达州市| 启东市| 和平县| 黄石市| 名山县| 佛坪县| 随州市| 松原市| 望城县| 河东区| 北川| 班玛县| 沙洋县| 甘孜| 绍兴县| 宕昌县| 乐东| 喀喇沁旗| 凌源市| 泸水县| 安庆市| 木兰县|