//消息循环这样写while(GetMessage(&Msg,NULL,0,0))
{
if(! IsDialogMessage(hdlg,&Msg))//是对话框消息,就直接发给该对话框窗口过程
{
if(!TranslateAccelerator(hwnd,hAccel,&Msg))
{
TranslateMessage(&Msg);
DispathMessage(&Msg); }
}
}
------------------------------------------------------------
case IDM_FIND:
uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING);
FINDREPLACE fr; // common dialog box structure
static char szFindWhat[80]; // buffer receiving string // Initialize FINDREPLACE
ZeroMemory(&fr, sizeof(fr));
fr.lStructSize = sizeof(fr);
fr.hwndOwner = hWndEdit;
fr.lpstrFindWhat = szFindWhat;
fr.wFindWhatLen = 80;
fr.Flags = FR_DIALOGTERM | FR_DOWN | FR_FINDNEXT | FR_ENABLEHOOK;
fr.lpfnHook = FRHookProc; hfdlg = FindText(&fr);UINT CALLBACK FRHookProc(
HWND hdlg, // handle to the dialog box window
UINT uiMsg, // message identifier
WPARAM wParam, // message parameter
LPARAM lParam // message parameter
)
{
LPFINDREPLACE lpfr;
if (uiMsg == uFindReplaceMsg){
// Get pointer to FINDREPLACE structure from lParam.
lpfr = (LPFINDREPLACE)lParam;} MessageBox(NULL,"挂钩成功","",MB_OK);
return 0;
}
这样,一点菜单IDM_FIND消息,就MessageBox(NULL,"挂钩成功","",MB_OK);执行成功.
一直这样.怎么hfdlg = FindText(&fr);连查找弹出框都没了?还有就是如何处理输入的要查找的字符串?要写一个搜索字符串的函数吗?要怎么写?还有一个疑问就是消息直接发给默认处理函数能处理吗?不需要FRHookProc来处理可以吗?多谢大虾帮忙.小菜一直在线等.
{
if(! IsDialogMessage(hdlg,&Msg))//是对话框消息,就直接发给该对话框窗口过程
{
if(!TranslateAccelerator(hwnd,hAccel,&Msg))
{
TranslateMessage(&Msg);
DispathMessage(&Msg); }
}
}
------------------------------------------------------------
case IDM_FIND:
uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING);
FINDREPLACE fr; // common dialog box structure
static char szFindWhat[80]; // buffer receiving string // Initialize FINDREPLACE
ZeroMemory(&fr, sizeof(fr));
fr.lStructSize = sizeof(fr);
fr.hwndOwner = hWndEdit;
fr.lpstrFindWhat = szFindWhat;
fr.wFindWhatLen = 80;
fr.Flags = FR_DIALOGTERM | FR_DOWN | FR_FINDNEXT | FR_ENABLEHOOK;
fr.lpfnHook = FRHookProc; hfdlg = FindText(&fr);UINT CALLBACK FRHookProc(
HWND hdlg, // handle to the dialog box window
UINT uiMsg, // message identifier
WPARAM wParam, // message parameter
LPARAM lParam // message parameter
)
{
LPFINDREPLACE lpfr;
if (uiMsg == uFindReplaceMsg){
// Get pointer to FINDREPLACE structure from lParam.
lpfr = (LPFINDREPLACE)lParam;} MessageBox(NULL,"挂钩成功","",MB_OK);
return 0;
}
这样,一点菜单IDM_FIND消息,就MessageBox(NULL,"挂钩成功","",MB_OK);执行成功.
一直这样.怎么hfdlg = FindText(&fr);连查找弹出框都没了?还有就是如何处理输入的要查找的字符串?要写一个搜索字符串的函数吗?要怎么写?还有一个疑问就是消息直接发给默认处理函数能处理吗?不需要FRHookProc来处理可以吗?多谢大虾帮忙.小菜一直在线等.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货