-
August 21st, 2013, 06:08 AM
#1
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??
-
August 21st, 2013, 07:19 AM
#2
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".
Victor Nijegorodov
-
August 22nd, 2013, 12:11 AM
#3
Re: Modal and non modal dialog box
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
}
}
}
}
Last edited by manjut19; August 22nd, 2013 at 12:15 AM.
-
August 22nd, 2013, 01:19 AM
#4
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?
Victor Nijegorodov
-
August 22nd, 2013, 01:34 AM
#5
Re: Modal and non modal dialog box
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?
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
Last edited by manjut19; August 22nd, 2013 at 02:03 AM.
-
August 22nd, 2013, 02:49 AM
#6
Re: Modal and non modal dialog box
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.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|