Modal and non modal dialog box
Hi all,
I am doing a win32 application,In that i have a modal dialog box and inside the dialog box one list control also,to display students record,In tht record i want to use Find dialog box and find and replace dialog box(Non modal dialog box).Is it possible??
Re: Modal and non modal dialog box
Yes, you can use modeless Find dialog box (CFindReplaceDialog)
What is not clear is what you mean by "In that record".
Re: Modal and non modal dialog box
Quote:
Originally Posted by
VictorN
Yes, you can use modeless Find dialog box (CFindReplaceDialog)
What is not clear is what you mean by "In that record".
Record means,Students details displaying on a list view control.Now i got the Find Dialog box,but i canot handle the FR_FINDNEXT.Actaully i have written this handler on the defult case of Dialog box procedure.Is it correct?Relevent part given below
Code:
//Dialog procedure
LRESULT CALLBACK DlgtProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
UINT uFindReplaceMsg=0; // message identifier FINDMSGSTRING
HWND HdlgFindOrReplce = NULL; // handle to Find dialog box
switch (uMsg)
{
case WM_INITDIALOG://setting the items & subitem values
break;
case WM_NOTIFY:
switch(LOWORD(wParam))
{
case IDC_LISTVIEW:
switch(((LPNMHDR)lParam)->code)
{
case LVN_KEYDOWN:
//creating the find dialog box
break;
}
break;
}
break;
default:
{
LPFINDREPLACE lpfr;
if ( uMsg == uFindReplaceMsg)
{
// Get pointer to FINDREPLACE structure from lParam.
lpfr = (LPFINDREPLACE)lParam;
// If the FR_DIALOGTERM flag is set,
// invalidate the handle identifying the dialog box.
if (lpfr->Flags & FR_DIALOGTERM)
{
HdlgFindOrReplce = NULL;
return 0;
}
// If the FR_FINDNEXT flag is set,
// call the application-defined search routine
// to search for the requested string.
if ((lpfr->Flags & FR_FINDNEXT))
{//Handler of find next
}
}
}
}
Re: Modal and non modal dialog box
Is there something preventing you to use MFC? Then why did you post to Visual C++ forum rather then to Win32 one?
Where and how do you create the find/replace dialog?
Why did you set the uFindReplaceMsg to zero? Didn't you read the FINDMSGSTRING message documentation? :confused:
Re: Modal and non modal dialog box
Quote:
Originally Posted by
VictorN
Is there something preventing you to use MFC? Then why did you post to
Visual C++ forum rather then to
Win32 one?
Where and how do you create the find/replace dialog?
Why did you set the
uFindReplaceMsg to zero? Didn't you read the
FINDMSGSTRING message documentation? :confused:
Yes,I canot use MFC.Sorry,I got my problem,I forgot to use RegisterWindow Message() Can you tell me.How to identify Cntrl+F events under LVN_KEYDOWN
Re: Modal and non modal dialog box
Quote:
Originally Posted by
manjut19
Can you tell me.How to identify Cntrl+F events under LVN_KEYDOWN
Handle WM_CHAR message and if 'F' (or 'f') was clicked call GetKeyState to check whether the VK_CONTROL was down.