1个回答
展开全部
临时给你写了一个,处理方法比较特殊:
UINT CALLBACK CFHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
switch(uiMsg)
{
case WM_INITDIALOG:
{
HWND hColorCombo = ::FindWindowEx(hdlg, NULL, "ComboBox", NULL);
while(hColorCombo)
{
char szText[MAX_PATH] = {0};
GetWindowText(hColorCombo, szText, MAX_PATH);
if(strstr(szText, "黑色") != 0)
{
ShowWindow(hColorCombo, SW_HIDE);
break;
}
hColorCombo = ::FindWindowEx(hdlg, hColorCombo, "ComboBox", NULL);
}
HWND hColorStatic = ::FindWindowEx(hdlg, NULL, "Static", NULL);
while(hColorStatic)
{
char szText[MAX_PATH] = {0};
GetWindowText(hColorStatic, szText, MAX_PATH);
if(strstr(szText, "颜色") != 0)
{
ShowWindow(hColorStatic, SW_HIDE);
break;
}
hColorStatic = ::FindWindowEx(hdlg, hColorStatic, "Static", NULL);
}
}
break;
}
return 0;
}
void ShowFontDlg()
{
LOGFONT lf = {0};
CHOOSEFONT cf = {0};
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = m_hWnd;
cf.lpLogFont = &lf;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_ENABLEHOOK;
cf.lpfnHook = CFHookProc;
ChooseFont(&cf);
}
补充一下,直接调用 ShowFontDlg 就可以看到效果了,在我机器上可以看到效果,其他机器没有测试过,呵呵。vc6 + xp sp2
UINT CALLBACK CFHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
switch(uiMsg)
{
case WM_INITDIALOG:
{
HWND hColorCombo = ::FindWindowEx(hdlg, NULL, "ComboBox", NULL);
while(hColorCombo)
{
char szText[MAX_PATH] = {0};
GetWindowText(hColorCombo, szText, MAX_PATH);
if(strstr(szText, "黑色") != 0)
{
ShowWindow(hColorCombo, SW_HIDE);
break;
}
hColorCombo = ::FindWindowEx(hdlg, hColorCombo, "ComboBox", NULL);
}
HWND hColorStatic = ::FindWindowEx(hdlg, NULL, "Static", NULL);
while(hColorStatic)
{
char szText[MAX_PATH] = {0};
GetWindowText(hColorStatic, szText, MAX_PATH);
if(strstr(szText, "颜色") != 0)
{
ShowWindow(hColorStatic, SW_HIDE);
break;
}
hColorStatic = ::FindWindowEx(hdlg, hColorStatic, "Static", NULL);
}
}
break;
}
return 0;
}
void ShowFontDlg()
{
LOGFONT lf = {0};
CHOOSEFONT cf = {0};
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = m_hWnd;
cf.lpLogFont = &lf;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_ENABLEHOOK;
cf.lpfnHook = CFHookProc;
ChooseFont(&cf);
}
补充一下,直接调用 ShowFontDlg 就可以看到效果了,在我机器上可以看到效果,其他机器没有测试过,呵呵。vc6 + xp sp2
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询