i can call "find/replace" Dialod this Way
- Code: Select all Expand view
- FindReplaceDlg ( NIL, lNoUpDown, lNoMatchCase, lNoWholeWord, lCheckDown, lCheckMatchCase, lCheckWholeWord, cFind, cReplace, .T., cTitle )
now i need to receive Event
- Code: Select all Expand view
- _HMG_MsgIDFindDlg := REGISTERFINDMSGSTRING () // ADD
case nMsg == _HMG_MsgIDFindDlg // FindReplace Dialog Notification ( by Dr. Claudio Soto, January 2014 )
EVAL ( _HMG_FindReplaceOnAction )
but how to add Event to Fivewin
---
- Code: Select all Expand view
- static TCHAR cFindWhat[ 1024 ];
static TCHAR cReplaceWith[ 1024 ];
static FINDREPLACE FindReplace;
static HWND hDlgFindReplace = NULL;
HB_FUNC( REGISTERFINDMSGSTRING )
{
UINT MessageID = RegisterWindowMessage( FINDMSGSTRING );
hb_retnl( ( LONG ) MessageID );
}
HB_FUNC( FINDREPLACEDLG )
{
HWND hWnd = HB_ISNIL( 1 ) ? GetActiveWindow() : ( HWND ) hb_parnl( 1 );
BOOL NoUpDown = ( BOOL ) ( HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 ) );
BOOL NoMatchCase = ( BOOL ) ( HB_ISNIL( 3 ) ? FALSE : hb_parl( 3 ) );
BOOL NoWholeWord = ( BOOL ) ( HB_ISNIL( 4 ) ? FALSE : hb_parl( 4 ) );
BOOL CheckDown = ( BOOL ) ( HB_ISNIL( 5 ) ? TRUE : hb_parl( 5 ) );
BOOL CheckMatchCase = ( BOOL ) ( HB_ISNIL( 6 ) ? FALSE : hb_parl( 6 ) );
BOOL CheckWholeWord = ( BOOL ) ( HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) );
BOOL lReplace = ( BOOL ) hb_parl( 10 );
#ifndef UNICODE
LPSTR FindWhat = ( LPSTR ) hb_parc( 8 );
LPSTR ReplaceWith = ( LPSTR ) hb_parc( 9 );
LPSTR cTitle = ( LPSTR ) hb_parc( 11 );
#else
LPWSTR FindWhat = AnsiToWide( ( char * ) hb_parc( 8 ) );
LPWSTR ReplaceWith = AnsiToWide( ( char * ) hb_parc( 9 ) );
LPWSTR cTitle = AnsiToWide( ( char * ) hb_parc( 11 ) );
#endif
if( hDlgFindReplace == NULL )
{
ZeroMemory( &FindReplace, sizeof( FindReplace ) );
lstrcpy( cFindWhat, FindWhat );
lstrcpy( cReplaceWith, ReplaceWith );
FindReplace.lStructSize = sizeof( FindReplace );
FindReplace.Flags = ( NoUpDown ? FR_HIDEUPDOWN : 0 ) | ( NoMatchCase ? FR_HIDEMATCHCASE : 0 ) | ( NoWholeWord ? FR_HIDEWHOLEWORD : 0 )
| ( CheckDown ? FR_DOWN : 0 ) | ( CheckMatchCase ? FR_MATCHCASE : 0 ) | ( CheckWholeWord ? FR_WHOLEWORD : 0 );
FindReplace.hwndOwner = hWnd;
FindReplace.lpstrFindWhat = cFindWhat;
FindReplace.wFindWhatLen = sizeof( cFindWhat ) / sizeof( TCHAR );
FindReplace.lpstrReplaceWith = cReplaceWith;
FindReplace.wReplaceWithLen = sizeof( cReplaceWith ) / sizeof( TCHAR );
if( lReplace )
hDlgFindReplace = ReplaceText( &FindReplace );
else
hDlgFindReplace = FindText( &FindReplace );
if( HB_ISCHAR( 11 ) )
SetWindowText( hDlgFindReplace, cTitle );
ShowWindow( hDlgFindReplace, SW_SHOW );
}
#ifdef UNICODE
hb_xfree( ( TCHAR * ) FindWhat );
hb_xfree( ( TCHAR * ) ReplaceWith );
hb_xfree( ( TCHAR * ) cTitle );
#endif
}