小编wem*_*kon的帖子

WinApi DrawText 和 TextOut 无法显示 unicode 字符 U+5167

Windows 程序员您好!

我是使用 winapi 进行 Windows 编程的新手。我正在阅读这本非常好的书,当我使用 DrawText 和 TextOut 在客户区显示 unicode 字符 U+5167 (?) 时遇到了问题(显示为黑框)。神秘的是,这个特殊的 unicode 字符正确显示在 windows 标题区域中。当我使用 MessageBox 显示它时,这个 unicode 字符也能正确显示。最后,我尝试显示与此 unicode 相对接近的其他 unicode 字符,如 U+5166、U+5168、U+5157 和 U+5177;

这是标准定义的此 unicode 字符的链接。 http://unicode-table.com/en/#5167

注意:我正在使用 Visual Studio 2010 使用 Unicode 编译此代码

下面是我的代码。


#include<windows.h>

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
    static TCHAR szAppName[] = TEXT("HelloWin");
    HWND hwnd;
    MSG msg;

    WNDCLASS wndclass;
    wndclass.style = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc = …
Run Code Online (Sandbox Code Playgroud)

unicode winapi drawtext textout

2
推荐指数
1
解决办法
2451
查看次数

标签 统计

drawtext ×1

textout ×1

unicode ×1

winapi ×1