-
-
[旧帖]
[求助]win32创建RichEdit控件
0.00雪花
-
发表于:
2012-4-20 20:24
1430
-
[旧帖] [求助]win32创建RichEdit控件
0.00雪花
写了个简单的Win32窗口程序,在窗口过程的WM_CREATE消息里创建RichEdit控件,创建失败;代码如下:
===========================================================
case WM_CREATE:
{
CHARFORMAT stCf;
//加载Rich Edit 库
hRichEdit = LoadLibrary(L"RichEd20.dll");
if(!hRichEdit)
{
MessageBox(NULL,L"Load RichEd20.dll Fail",L"Error",0);
return 0;
}
hwndRichEdit = CreateWindowEx(WS_EX_CLIENTEDGE,L"RichEdit20W",NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_NOHIDESEL,
0,0,0,0,
hWnd,0,hInst,0
);
if(!hwndRichEdit)
{
TCHAR szTmp[20] = {0};
wsprintf(szTmp,L"Error: %d",GetLastError());
MessageBox(hWnd,L"Create Rich Edit Fail !!",szTmp,0);
break;
}
==================================================
LoadLibrary(L"RichEd20.dll"); 成功;
CreateWindowEx()创建RichEdit控件的时候fail,GetLastError是1407(找不到窗口类别。)
摸不到头脑,请大家指教~
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)