###User Defined Function###
_WinAPI_FindTextDlg

###Description###
Creates a system-defined modeless Find dialog box to search for text in a document.

###Syntax###
#include <WinAPIDlg.au3>
_WinAPI_FindTextDlg ( $hOwner [, $sFindWhat = '' [, $iFlags = 0 [, $pFindProc = 0 [, $lParam = 0]]]] )


###Parameters###
@@ParamTable@@
$hOwner
	A handle to the window that owns the dialog box. The window procedure of the specified window receives FINDMSGSTRING messages from the dialog box. This parameter can be any valid window handle, but it must not be 0.
$sFindWhat
	[optional] The search string that is displayed when you initialize the dialog box.
$iFlags
	[optional] A set of bit flags that used to initialize the dialog box.
	The dialog box sets these flags when it sends the FINDMSGSTRING registered message to indicate the user's input.
	This parameter can be one or more of the following values.
		$FR_DIALOGTERM
		$FR_DOWN
		$FR_ENABLEHOOK
		$FR_ENABLETEMPLATE
		$FR_ENABLETEMPLATEHANDLE
		$FR_FINDNEXT
		$FR_HIDEUPDOWN
		$FR_HIDEMATCHCASE
		$FR_HIDEWHOLEWORD
		$FR_MATCHCASE
		$FR_NOMATCHCASE
		$FR_NOUPDOWN
		$FR_NOWHOLEWORD
		$FR_REPLACE
		$FR_REPLACEALL
		$FR_SHOWHELP
		$FR_WHOLEWORD
$pFindProc
	[optional] Pointer to an hook procedure that can process messages intended for the dialog box.
	This parameter is ignored unless the $FR_ENABLEHOOK flag is not set.
	(See MSDN for more information)
$lParam
	[optional] Application-defined data that the system passes to the hook procedure.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success 	The window handle to the dialog box.
Failure 	0 and sets the @error flag to non-zero, @extended flag may contain the dialog box error code.
@@End@@


###Remarks###
The <a href="_WinAPI_FindTextDlg.htm">_WinAPI_FindTextDlg()</a> does not perform a search operation. Instead, the dialog box sends FINDMSGSTRING registered messages to the window procedure of the owner window of the dialog box.

Before calling <a href="_WinAPI_FindTextDlg.htm">_WinAPI_FindTextDlg()</a>, you must call the <a href="_WinAPI_RegisterWindowMessage.htm">_WinAPI_RegisterWindowMessage()</a> function to get the identifier for the FINDMSGSTRING message. The dialog box procedure uses this identifier to send messages when the user clicks the "Find Next" button, or when the dialog box is closing. The "lParam" parameter of the FINDMSGSTRING message contains a pointer to a $tagFINDREPLACE structure. The "Flags" member of this structure indicates the event that caused the message. Other members of the structure indicate the user's input.

The <a href="_WinAPI_FindTextDlg.htm">_WinAPI_FindTextDlg()</a> uses an internal buffer to hold the string that the user typed in the "Find What" edit controls. You can increase the size of this buffer by using the <a href="_WinAPI_SetFRBuffer.htm">_WinAPI_SetFRBuffer()</a> function. In addition to free the memory allocated for the internal buffer, you must call the <a href="_WinAPI_FlushFRBuffer.htm">_WinAPI_FlushFRBuffer()</a> in response to the FINDMSGSTRING message with $FR_DIALOGTERM flag set.


###Related###
_WinAPI_RegisterWindowMessage, _WinAPI_SetFRBuffer, _WinAPI_FlushFRBuffer


###See Also###
@@MsdnLink@@ FindText


###Example###
@@IncludeExample@@
