#include <stdio.h> #include <windows.h> int CALLBACK myEnumFontFamExProc(const LOGFONT* lpelfe, const TEXTMETRIC* lpntme, DWORD FontType, LPARAM lParam); int main() { SetConsoleTitle("Neo"); HWND hwnd = FindWindow(0, "Neo"); PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); hdc = GetDC(hwnd); LOGFONT lf = { 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, "" }; EnumFontFamiliesExA(hdc, &lf, myEnumFontFamExProc, 0, 0); getchar(); return 0; } int CALLBACK myEnumFontFamExProc(const LOGFONT* lpelfe, const TEXTMETRIC* lpntme, DWORD FontType, LPARAM lParam) { printf("%s\n",lpelfe->lfFaceName); return 1; }
沒有留言:
張貼留言