Microsoft KB Archive/96135

{|
 * width="100%"|

PRB: FindText, ReplaceText Hook Function

 * }

Q96135

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) 3.1

-

SYMPTOMS
When adding a hook function to the FindText or ReplaceText common dialog box, the dialog box is not shown. However, the hook function is receiving messages and the dialog box window does exist.

CAUSE
The hook function is returning FALSE after processing the WM_INITDIALOG message.

RESOLUTION
After processing the WM_INITDIALOG message in the hook function, return TRUE. If your hook function is setting the focus to a specific control, and therefore should return FALSE, add the following code:

  case WM_INITDIALOG:

...WM_INITDIALOG code...

SetFocus(hCtrl); ShowWindow(hDlg, SW_NORMAL); UpdateWindow(hDlg); return(FALSE); This code ensures that the dialog box is visible.

Additional query words:

Keywords : _IK kbCmnDlg kbCmnDlgFind kbCmnDlgRepl kbOSWinNT kbOSWin2000 kbGrpDSUser kbOSWin

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK310