CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2013
    Posts
    77

    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??

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    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

  3. #3
    Join Date
    Apr 2013
    Posts
    77

    Re: Modal and non modal dialog box

    Quote Originally Posted by VictorN View Post
    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.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    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

  5. #5
    Join Date
    Apr 2013
    Posts
    77

    Re: Modal and non modal dialog box

    Quote Originally Posted by VictorN View Post
    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.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Modal and non modal dialog box

    Quote Originally Posted by manjut19 View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured