MFC 如何把MessageBox弹出对话框的“是”,“否”按钮变成“Yes”,“No ...
中文系统就只能显示中文的“是”“否”么,怎么改成yesno呢?高手解答#include<Windows.h>HHOOKhHook;LRESULT__stdcallCBTH...
中文系统 就只能显示中文的“是” “否”么 ,怎么改成yes no 呢?
高手解答
#include <Windows.h>
HHOOK hHook;
LRESULT __stdcall CBTHookProc( long nCode,WPARAM wParam,LPARAM lParam);
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInstance,LPSTR szCmdLine, int iCmdShow)
{
hHook=SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTHookProc,hInst,NULL);
if (hHook)
{
MessageBox(NULL,"你是帅哥吗?","SC++",MB_ICONINFORMATION|MB_YESNO);
}
else
{
MessageBox(NULL,"无法安装HOOK" ,"SC++",MB_ICONINFORMATION|MB_YESNO);
}//if
return 1;
}
LRESULT __stdcall CBTHookProc( long nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode==HCBT_ACTIVATE)
{
SetDlgItemText((HWND)wParam,IDYES,"&Yes");
SetDlgItemText((HWND)wParam,IDNO ,"&No");
UnhookWindowsHookEx(hHook);
}
return 0;
}
这段代码 怎么才能用到MFC 工程里呢? 展开
高手解答
#include <Windows.h>
HHOOK hHook;
LRESULT __stdcall CBTHookProc( long nCode,WPARAM wParam,LPARAM lParam);
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInstance,LPSTR szCmdLine, int iCmdShow)
{
hHook=SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTHookProc,hInst,NULL);
if (hHook)
{
MessageBox(NULL,"你是帅哥吗?","SC++",MB_ICONINFORMATION|MB_YESNO);
}
else
{
MessageBox(NULL,"无法安装HOOK" ,"SC++",MB_ICONINFORMATION|MB_YESNO);
}//if
return 1;
}
LRESULT __stdcall CBTHookProc( long nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode==HCBT_ACTIVATE)
{
SetDlgItemText((HWND)wParam,IDYES,"&Yes");
SetDlgItemText((HWND)wParam,IDNO ,"&No");
UnhookWindowsHookEx(hHook);
}
return 0;
}
这段代码 怎么才能用到MFC 工程里呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询