![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
win32
soulsoul_god
慢一点,当你理解的越多,需要记得就越少。
展开
-
win api 遍历窗口获取窗口text
char class_name[256];char title_name[256];GetClassNameA(hwnd, class_name, 256);GetWindowTextA(hwnd, title_name, 256);ERR("xxxxx class_name:%s, title_name:%s\n", class_name, title_name);HWND child_hwnd = NULL;if (strcmp(title_name, "Microsoft Excel").原创 2022-02-23 10:26:29 · 600 阅读 · 0 评论 -
win32修改字体
参考:win32程序如何改变字体大小颜色 - 疯封风 - 博客园TEXTMETRICW lptm;GetTextMetricsW (hdc, &lptm);LOGFONTA logfont;ZeroMemory(&logfont, sizeof(LOGFONTA)); GetObjectA(GetStockObject(SYSTEM_FONT), sizeof(LOGFONTA), &logfont);//logfont.lfItalic = TR原创 2021-12-21 11:00:52 · 1370 阅读 · 0 评论 -
wine中部分代码无法直接调用user32函数的解决办法
typedef HWND (WINAPI *WindowFromDC_funcptr)(HDC);typedef INT (WINAPI *GetWindowTextA_funcptr)(HWND, LPSTR, INT);HMODULE mod;mod = GetModuleHandleA("user32.dll");if(mod){ WindowFromDC_funcptr pWindowFromDC = (WindowFromDC_funcptr)GetProcAddress(m.原创 2021-12-21 10:55:52 · 213 阅读 · 0 评论 -
win32 多字节、宽字符转换
#include <Windows.h>#include <stdio.h>#include <stdlib.h>#include <locale.h>int main(){ setlocale(LC_ALL, ""); char sText[] = "你好!"; //计算sText字符串的长度 DWORD dwNum = MultiByteToWideChar(CP_ACP, 0, sText, -1, NULL, 0); pri.原创 2021-11-28 22:33:03 · 598 阅读 · 0 评论 -
win32 宽字符串输出
#include <Windows.h>#include <stdio.h>#include <locale.h>int main(){ setlocale(LC_ALL, ""); printf("Locale is %s\n", setlocale(LC_ALL, NULL)); char c = 'A'; printf("%c\n", c); WCHAR c2[] = L"我们"; wprintf(L"%s\n", c2); prin.原创 2021-11-28 21:38:17 · 734 阅读 · 0 评论 -
windows api学习-1
#include <Windows.h>#include "resource.h"INT_PTR CALLBACK MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ BOOL bRet = TRUE; switch (uMsg) { case WM_LBUTTONDOWN: MessageBoxW(hWnd, L"aaa", L"bbb", MB_OK); break; case WM_C.原创 2021-11-28 19:19:23 · 537 阅读 · 0 评论