好吧,您知道这是可能的,因为您的浏览器可以呈现它们。在 Windows 上,您可以使用 charmap.exe 小程序来发现它们的 Unicode 代码点:
\n\n挑战在于让 C/C++ 程序来显示它们。除非您使用 Qt 或 wxWidgets 等跨平台 UI 库,否则以任何非特定于平台的方式都是不可能的。在 Windows GUI 程序中,您可以在 WM_PAINT 消息处理程序中执行以下操作:
\n\n case WM_PAINT: {\n hdc = BeginPaint(hWnd, &ps);\n HFONT hFont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L"Arial Unicode MS");\n HGDIOBJ oldFont = SelectObject(hdc, hFont);\n RECT rc = {0, 0, 666, 16};\n DrawTextEx(hdc, L"\\x2660\\x2663\\x2665\\x2666", -1, &rc, DT_LEFT, 0);\n SelectObject(hdc, oldFont);\n DeleteObject(hFont);\n EndPaint(hWnd, &ps);\n }\n break;\n
Run Code Online (Sandbox Code Playgroud)\n