ReactOS  0.4.13-dev-73-gcfe54aa
finddlg.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wingdi.h"
#include "winuser.h"
#include "commdlg.h"
#include "cderr.h"
#include "dlgs.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "cdlg.h"
Include dependency graph for finddlg.c:

Go to the source code of this file.

Macros

#define FR_MASK   (FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD | FR_REPLACEALL | FR_REPLACE | FR_FINDNEXT | FR_DIALOGTERM)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (commdlg)
 
static DWORD COMDLG32_FR_GetFlags (HWND hDlgWnd)
 
static void COMDLG32_FR_HandleWMCommand (HWND hDlgWnd, COMDLG32_FR_Data *pData, int Id, int NotifyCode)
 
static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc (HWND hDlgWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL COMDLG32_FR_CheckPartial (const FINDREPLACEA *pfr, BOOL Replace)
 
static HWND COMDLG32_FR_DoFindReplace (COMDLG32_FR_Data *pdata)
 
HWND WINAPI FindTextA (LPFINDREPLACEA pfr)
 
HWND WINAPI ReplaceTextA (LPFINDREPLACEA pfr)
 
HWND WINAPI FindTextW (LPFINDREPLACEW pfr)
 
HWND WINAPI ReplaceTextW (LPFINDREPLACEW pfr)
 

Variables

static UINT FindReplaceMessage
 
static UINT HelpMessage
 

Macro Definition Documentation

◆ FR_MASK

Definition at line 45 of file finddlg.c.

Function Documentation

◆ COMDLG32_FindReplaceDlgProc()

static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc ( HWND  hDlgWnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 177 of file finddlg.c.

178 {
180  INT_PTR retval = TRUE;
181 
182  if(iMsg == WM_INITDIALOG)
183  {
185  if(!SetPropA(hDlgWnd, (LPSTR)COMDLG32_Atom, (HANDLE)pdata))
186  {
187  ERR("Could not Set prop; invent a graceful exit?...\n");
188  DestroyWindow(hDlgWnd);
189  return FALSE;
190  }
191  SendDlgItemMessageA(hDlgWnd, edt1, EM_SETLIMITTEXT, pdata->fr.wFindWhatLen, 0);
192  SendDlgItemMessageA(hDlgWnd, edt1, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrFindWhat);
193  if(pdata->fr.Flags & FR_WINE_REPLACE)
194  {
195  SendDlgItemMessageA(hDlgWnd, edt2, EM_SETLIMITTEXT, pdata->fr.wReplaceWithLen, 0);
196  SendDlgItemMessageA(hDlgWnd, edt2, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrReplaceWith);
197  }
198 
199  if(!(pdata->fr.Flags & FR_SHOWHELP))
200  ShowWindow(GetDlgItem(hDlgWnd, pshHelp), SW_HIDE);
201  if(pdata->fr.Flags & FR_HIDEUPDOWN)
202  {
203  ShowWindow(GetDlgItem(hDlgWnd, rad1), SW_HIDE);
204  ShowWindow(GetDlgItem(hDlgWnd, rad2), SW_HIDE);
205  ShowWindow(GetDlgItem(hDlgWnd, grp1), SW_HIDE);
206  }
207  else if(pdata->fr.Flags & FR_NOUPDOWN)
208  {
209  EnableWindow(GetDlgItem(hDlgWnd, rad1), FALSE);
210  EnableWindow(GetDlgItem(hDlgWnd, rad2), FALSE);
211  EnableWindow(GetDlgItem(hDlgWnd, grp1), FALSE);
212  }
213  else
214  {
215  SendDlgItemMessageA(hDlgWnd, rad1, BM_SETCHECK, pdata->fr.Flags & FR_DOWN ? 0 : BST_CHECKED, 0);
216  SendDlgItemMessageA(hDlgWnd, rad2, BM_SETCHECK, pdata->fr.Flags & FR_DOWN ? BST_CHECKED : 0, 0);
217  }
218 
219  if(pdata->fr.Flags & FR_HIDEMATCHCASE)
220  ShowWindow(GetDlgItem(hDlgWnd, chx2), SW_HIDE);
221  else if(pdata->fr.Flags & FR_NOMATCHCASE)
222  EnableWindow(GetDlgItem(hDlgWnd, chx2), FALSE);
223  else
224  SendDlgItemMessageA(hDlgWnd, chx2, BM_SETCHECK, pdata->fr.Flags & FR_MATCHCASE ? BST_CHECKED : 0, 0);
225 
226  if(pdata->fr.Flags & FR_HIDEWHOLEWORD)
227  ShowWindow(GetDlgItem(hDlgWnd, chx1), SW_HIDE);
228  else if(pdata->fr.Flags & FR_NOWHOLEWORD)
229  EnableWindow(GetDlgItem(hDlgWnd, chx1), FALSE);
230  else
231  SendDlgItemMessageA(hDlgWnd, chx1, BM_SETCHECK, pdata->fr.Flags & FR_WHOLEWORD ? BST_CHECKED : 0, 0);
232 
233  /* We did the init here, now call the hook if requested */
234 
235  /* We do not do ShowWindow if hook exists and is FALSE */
236  /* per MSDN Article Q96135 */
237  if((pdata->fr.Flags & FR_ENABLEHOOK)
238  && ! pdata->fr.lpfnHook(hDlgWnd, iMsg, wParam, (LPARAM) &pdata->fr))
239  return TRUE;
240  ShowWindow(hDlgWnd, SW_SHOWNORMAL);
241  UpdateWindow(hDlgWnd);
242  return TRUE;
243  }
244 
245  if(pdata && (pdata->fr.Flags & FR_ENABLEHOOK))
246  {
247  retval = pdata->fr.lpfnHook(hDlgWnd, iMsg, wParam, lParam);
248  }
249  else
250  retval = FALSE;
251 
252  if(pdata && !retval)
253  {
254  retval = TRUE;
255  switch(iMsg)
256  {
257  case WM_COMMAND:
259  break;
260 
261  case WM_CLOSE:
263  break;
264 
265  case WM_HELP:
266  /* Heeeeelp! */
267  FIXME("Got WM_HELP. Who is gonna supply it?\n");
268  break;
269 
270  case WM_CONTEXTMENU:
271  /* Heeeeelp! */
272  FIXME("Got WM_CONTEXTMENU. Who is gonna supply it?\n");
273  break;
274  /* FIXME: Handle F1 help */
275 
276  default:
277  retval = FALSE; /* We did not handle the message */
278  }
279  }
280 
281  /* WM_DESTROY is a special case.
282  * We need to ensure that the allocated memory is freed just before
283  * the dialog is killed. We also need to remove the added prop.
284  */
285  if(iMsg == WM_DESTROY)
286  {
287  RemovePropA(hDlgWnd, (LPSTR)COMDLG32_Atom);
288  heap_free(pdata);
289  }
290 
291  return retval;
292 }
#define FR_HIDEMATCHCASE
Definition: commdlg.h:133
HANDLE WINAPI RemovePropA(_In_ HWND, _In_ LPCSTR)
#define TRUE
Definition: types.h:120
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define SW_HIDE
Definition: winuser.h:762
#define EM_SETLIMITTEXT
Definition: winuser.h:1972
BOOL WINAPI UpdateWindow(_In_ HWND)
#define FR_WINE_REPLACE
Definition: cdlg.h:37
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:62
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI DestroyWindow(_In_ HWND)
#define FR_HIDEUPDOWN
Definition: commdlg.h:132
WPARAM wParam
Definition: combotst.c:138
#define FR_NOUPDOWN
Definition: commdlg.h:140
#define FR_ENABLEHOOK
Definition: commdlg.h:128
#define rad2
Definition: dlgs.h:131
#define FR_NOMATCHCASE
Definition: commdlg.h:139
#define chx1
Definition: dlgs.h:31
#define chx2
Definition: dlgs.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
LONG_PTR LPARAM
Definition: windef.h:208
static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data *pData, int Id, int NotifyCode)
Definition: finddlg.c:88
#define WM_SETTEXT
Definition: winuser.h:1599
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define WM_DESTROY
Definition: winuser.h:1591
#define BM_SETCHECK
Definition: winuser.h:1882
#define FR_MATCHCASE
Definition: commdlg.h:136
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_CLOSE
Definition: winuser.h:1603
#define BN_CLICKED
Definition: winuser.h:1886
#define edt1
Definition: dlgs.h:65
#define edt2
Definition: dlgs.h:66
BOOL WINAPI SetPropA(_In_ HWND, _In_ LPCSTR, _In_opt_ HANDLE)
#define WM_COMMAND
Definition: winuser.h:1716
#define grp1
Definition: dlgs.h:86
#define COMDLG32_Atom
Definition: cdlg.h:27
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define FR_WHOLEWORD
Definition: commdlg.h:145
#define ERR(fmt,...)
Definition: debug.h:109
#define SW_SHOWNORMAL
Definition: winuser.h:764
HANDLE WINAPI GetPropA(_In_ HWND, _In_ LPCSTR)
#define FR_HIDEWHOLEWORD
Definition: commdlg.h:134
#define pshHelp
Definition: dlgs.h:127
#define BST_CHECKED
Definition: winuser.h:197
#define FR_DOWN
Definition: commdlg.h:127
LRESULT WINAPI SendDlgItemMessageA(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HIWORD(l)
Definition: typedefs.h:246
#define FR_SHOWHELP
Definition: commdlg.h:144
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define rad1
Definition: dlgs.h:130
#define FR_NOWHOLEWORD
Definition: commdlg.h:141
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by COMDLG32_FR_DoFindReplace().

◆ COMDLG32_FR_CheckPartial()

static BOOL COMDLG32_FR_CheckPartial ( const FINDREPLACEA pfr,
BOOL  Replace 
)
static

Definition at line 302 of file finddlg.c.

305  {
306  if(!pfr)
307  {
309  return FALSE;
310  }
311 
312  if(pfr->lStructSize != sizeof(FINDREPLACEA))
313  {
315  return FALSE;
316  }
317 
318  if(!IsWindow(pfr->hwndOwner))
319  {
321  return FALSE;
322  }
323 
324  if((pfr->wFindWhatLen < 1 || !pfr->lpstrFindWhat)
325  ||(Replace && !pfr->lpstrReplaceWith))
326  {
328  return FALSE;
329  }
330 
332  {
334  return FALSE;
335  }
337  {
339  return FALSE;
340  }
341 
342  if((pfr->Flags & FR_ENABLEHOOK) && !pfr->lpfnHook)
343  {
345  return FALSE;
346  }
347 
348  if((pfr->Flags & FR_ENABLETEMPLATEHANDLE) && !pfr->hInstance)
349  {
351  return FALSE;
352  }
353 
354  return TRUE;
355 }
#define CDERR_REGISTERMSGFAIL
Definition: cderr.h:17
LPFRHOOKPROC lpfnHook
Definition: commdlg.h:312
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define FRERR_BUFFERLENGTHZERO
Definition: cderr.h:39
#define FR_ENABLETEMPLATEHANDLE
Definition: commdlg.h:130
#define CDERR_NOHINSTANCE
Definition: cderr.h:9
LPSTR lpstrFindWhat
Definition: commdlg.h:307
#define HELPMSGSTRINGA
Definition: commdlg.h:20
WORD wFindWhatLen
Definition: commdlg.h:309
void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius)
Definition: drawing.cpp:134
#define FINDMSGSTRINGA
Definition: commdlg.h:21
#define FR_ENABLEHOOK
Definition: commdlg.h:128
#define CDERR_STRUCTSIZE
Definition: cderr.h:6
DWORD Flags
Definition: commdlg.h:306
static UINT HelpMessage
Definition: finddlg.c:43
HWND hwndOwner
Definition: commdlg.h:304
#define CDERR_INITIALIZATION
Definition: cderr.h:7
#define CDERR_NOHOOK
Definition: cderr.h:16
LPSTR lpstrReplaceWith
Definition: commdlg.h:308
DWORD lStructSize
Definition: commdlg.h:303
void COMDLG32_SetCommDlgExtendedError(DWORD err) DECLSPEC_HIDDEN
Definition: cdlg32.c:119
static UINT FindReplaceMessage
Definition: finddlg.c:42
HINSTANCE hInstance
Definition: commdlg.h:305
#define CDERR_DIALOGFAILURE
Definition: cderr.h:4
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)

Referenced by FindTextA(), FindTextW(), ReplaceTextA(), and ReplaceTextW().

◆ COMDLG32_FR_DoFindReplace()

static HWND COMDLG32_FR_DoFindReplace ( COMDLG32_FR_Data pdata)
static

Definition at line 364 of file finddlg.c.

366  {
367  HWND hdlgwnd = 0;
368  HGLOBAL loadrc;
369  DWORD error;
370  LPDLGTEMPLATEW rcs;
371 
372  TRACE("hInst=%p, Flags=%08x\n", pdata->fr.hInstance, pdata->fr.Flags);
373 
374  if(!(pdata->fr.Flags & FR_ENABLETEMPLATEHANDLE))
375  {
377  HRSRC htemplate;
378  if(pdata->fr.Flags & FR_ENABLETEMPLATE)
379  {
380  hmod = pdata->fr.hInstance;
381  if(pdata->fr.Flags & FR_WINE_UNICODE)
382  {
383  htemplate = FindResourceW(hmod, (LPCWSTR)pdata->fr.lpTemplateName, (LPWSTR)RT_DIALOG);
384  }
385  else
386  {
387  htemplate = FindResourceA(hmod, pdata->fr.lpTemplateName, (LPCSTR)RT_DIALOG);
388  }
389  }
390  else
391  {
392  int rcid = pdata->fr.Flags & FR_WINE_REPLACE ? REPLACEDLGORD
393  : FINDDLGORD;
394  htemplate = FindResourceA(hmod, MAKEINTRESOURCEA(rcid), (LPCSTR)RT_DIALOG);
395  }
396  if(!htemplate)
397  {
399  goto cleanup;
400  }
401 
402  loadrc = LoadResource(hmod, htemplate);
403  }
404  else
405  {
406  loadrc = pdata->fr.hInstance;
407  }
408 
409  if(!loadrc)
410  {
412  goto cleanup;
413  }
414 
415  if((rcs = LockResource(loadrc)) == NULL)
416  {
418  goto cleanup;
419  }
420 
422  rcs,
423  pdata->fr.hwndOwner,
425  (LPARAM)pdata);
426  if(!hdlgwnd)
427  {
429 cleanup:
431  heap_free(pdata);
432  }
433  return hdlgwnd;
434 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
#define error(str)
Definition: mkdosfs.c:1605
#define CDERR_LOADRESFAILURE
Definition: cderr.h:12
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define FR_ENABLETEMPLATEHANDLE
Definition: commdlg.h:130
#define FINDDLGORD
Definition: dlgs.h:12
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define FR_WINE_REPLACE
Definition: cdlg.h:37
#define FR_WINE_UNICODE
Definition: cdlg.h:36
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define CDERR_FINDRESFAILURE
Definition: cderr.h:11
#define REPLACEDLGORD
Definition: dlgs.h:13
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
const char * LPCSTR
Definition: xmlstorage.h:183
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define FR_ENABLETEMPLATE
Definition: commdlg.h:129
#define RT_DIALOG
Definition: pedump.c:367
#define CDERR_LOCKRESFAILURE
Definition: cderr.h:13
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
unsigned long DWORD
Definition: ntddk_ex.h:95
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
void COMDLG32_SetCommDlgExtendedError(DWORD err) DECLSPEC_HIDDEN
Definition: cdlg32.c:119
static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: finddlg.c:177
char * cleanup(char *str)
Definition: wpickclick.c:99
#define CDERR_DIALOGFAILURE
Definition: cderr.h:4
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by FindTextA(), FindTextW(), ReplaceTextA(), and ReplaceTextW().

◆ COMDLG32_FR_GetFlags()

static DWORD COMDLG32_FR_GetFlags ( HWND  hDlgWnd)
static

Definition at line 72 of file finddlg.c.

73 {
74  DWORD flags = 0;
75  if(IsDlgButtonChecked(hDlgWnd, rad2) == BST_CHECKED)
76  flags |= FR_DOWN;
77  if(IsDlgButtonChecked(hDlgWnd, chx1) == BST_CHECKED)
79  if(IsDlgButtonChecked(hDlgWnd, chx2) == BST_CHECKED)
81  return flags;
82 }
#define rad2
Definition: dlgs.h:131
#define chx1
Definition: dlgs.h:31
#define chx2
Definition: dlgs.h:32
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define FR_MATCHCASE
Definition: commdlg.h:136
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define FR_WHOLEWORD
Definition: commdlg.h:145
#define BST_CHECKED
Definition: winuser.h:197
#define FR_DOWN
Definition: commdlg.h:127

Referenced by COMDLG32_FR_HandleWMCommand().

◆ COMDLG32_FR_HandleWMCommand()

static void COMDLG32_FR_HandleWMCommand ( HWND  hDlgWnd,
COMDLG32_FR_Data pData,
int  Id,
int  NotifyCode 
)
static

Definition at line 88 of file finddlg.c.

89 {
90  DWORD flag;
91 
92  pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
93  if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
94  pData->user_fr.fra->Flags |= FR_DOWN;
95 
96  if(NotifyCode == BN_CLICKED)
97  {
98  switch(Id)
99  {
100  case IDOK: /* Find Next */
101  if(GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0)
102  {
103  pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_FINDNEXT;
104  if(pData->fr.Flags & FR_WINE_UNICODE)
105  {
106  MultiByteToWideChar( CP_ACP, 0, pData->fr.lpstrFindWhat, -1,
107  pData->user_fr.frw->lpstrFindWhat,
108  0x7fffffff );
109  }
110  else
111  {
112  strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
113  }
114  SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
115  }
116  break;
117 
118  case IDCANCEL:
119  pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_DIALOGTERM;
120  SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
121  DestroyWindow(hDlgWnd);
122  break;
123 
124  case psh2: /* Replace All */
126  goto Replace;
127 
128  case psh1: /* Replace */
129  flag = FR_REPLACE;
130 Replace:
131  if((pData->fr.Flags & FR_WINE_REPLACE)
132  && GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0)
133  {
134  pData->fr.lpstrReplaceWith[0] = 0; /* In case the next GetDlgItemText Fails */
135  GetDlgItemTextA(hDlgWnd, edt2, pData->fr.lpstrReplaceWith, pData->fr.wReplaceWithLen);
136  pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | flag;
137  if(pData->fr.Flags & FR_WINE_UNICODE)
138  {
139  MultiByteToWideChar( CP_ACP, 0, pData->fr.lpstrFindWhat, -1,
140  pData->user_fr.frw->lpstrFindWhat,
141  0x7fffffff );
142  MultiByteToWideChar( CP_ACP, 0, pData->fr.lpstrReplaceWith, -1,
143  pData->user_fr.frw->lpstrReplaceWith,
144  0x7fffffff );
145  }
146  else
147  {
148  strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
149  strcpy(pData->user_fr.fra->lpstrReplaceWith, pData->fr.lpstrReplaceWith);
150  }
151  SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
152  }
153  break;
154 
155  case pshHelp:
156  pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd);
157  SendMessageA(pData->fr.hwndOwner, HelpMessage, (WPARAM)hDlgWnd, (LPARAM)pData->user_fr.fra);
158  break;
159  }
160  }
161  else if(NotifyCode == EN_CHANGE && Id == edt1)
162  {
163  BOOL enable = SendDlgItemMessageA(hDlgWnd, edt1, WM_GETTEXTLENGTH, 0, 0) > 0;
164  EnableWindow(GetDlgItem(hDlgWnd, IDOK), enable);
165  if(pData->fr.Flags & FR_WINE_REPLACE)
166  {
167  EnableWindow(GetDlgItem(hDlgWnd, psh1), enable);
168  EnableWindow(GetDlgItem(hDlgWnd, psh2), enable);
169  }
170  }
171 }
#define FR_FINDNEXT
Definition: commdlg.h:131
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define IDOK
Definition: winuser.h:824
_In_ ULONG NotifyCode
Definition: winddi.h:4265
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CP_ACP
Definition: compat.h:99
static DWORD COMDLG32_FR_GetFlags(HWND hDlgWnd)
Definition: finddlg.c:72
#define FR_WINE_REPLACE
Definition: cdlg.h:37
UINT_PTR WPARAM
Definition: windef.h:207
void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius)
Definition: drawing.cpp:134
#define FR_WINE_UNICODE
Definition: cdlg.h:36
BOOL WINAPI DestroyWindow(_In_ HWND)
#define psh2
Definition: dlgs.h:113
DWORD Id
#define FR_REPLACEALL
Definition: commdlg.h:143
#define FR_MASK
Definition: finddlg.c:45
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
static UINT HelpMessage
Definition: finddlg.c:43
#define psh1
Definition: dlgs.h:112
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1886
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FR_REPLACE
Definition: commdlg.h:142
#define edt1
Definition: dlgs.h:65
#define edt2
Definition: dlgs.h:66
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
UINT WINAPI GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
Definition: dialog.c:2177
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
GLboolean enable
Definition: glext.h:11120
#define pshHelp
Definition: dlgs.h:127
static UINT FindReplaceMessage
Definition: finddlg.c:42
#define MultiByteToWideChar
Definition: compat.h:100
#define FR_DOWN
Definition: commdlg.h:127
LRESULT WINAPI SendDlgItemMessageA(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define FR_DIALOGTERM
Definition: commdlg.h:126
#define IDCANCEL
Definition: winuser.h:825
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define EN_CHANGE
Definition: winuser.h:1983

Referenced by COMDLG32_FindReplaceDlgProc().

◆ FindTextA()

HWND WINAPI FindTextA ( LPFINDREPLACEA  pfr)

Definition at line 441 of file finddlg.c.

443  {
445 
446  TRACE("LPFINDREPLACE=%p\n", pfr);
447 
449  return 0;
450 
451  if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL)
452  return 0; /* Error has been set */
453 
454  pdata->user_fr.fra = pfr;
455  pdata->fr = *pfr;
457 }
LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
Definition: cdlg32.c:100
static HWND COMDLG32_FR_DoFindReplace(COMDLG32_FR_Data *pdata)
Definition: finddlg.c:364
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL COMDLG32_FR_CheckPartial(const FINDREPLACEA *pfr, BOOL Replace)
Definition: finddlg.c:302

◆ FindTextW()

HWND WINAPI FindTextW ( LPFINDREPLACEW  pfr)

Definition at line 492 of file finddlg.c.

494  {
496  DWORD len;
497 
498  TRACE("LPFINDREPLACE=%p\n", pfr);
499 
501  return 0;
502 
504  NULL, 0, NULL, NULL );
505  if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data) + len)) == NULL)
506  return 0; /* Error has been set */
507 
508  pdata->user_fr.frw = pfr;
509  pdata->fr = *(LPFINDREPLACEA)pfr; /* FINDREPLACEx have same size */
510  pdata->fr.Flags |= FR_WINE_UNICODE;
511  pdata->fr.lpstrFindWhat = (LPSTR)(pdata + 1); /* Set string pointer */
513  pdata->fr.lpstrFindWhat, len, NULL, NULL );
515 }
LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
Definition: cdlg32.c:100
#define WideCharToMultiByte
Definition: compat.h:101
static HWND COMDLG32_FR_DoFindReplace(COMDLG32_FR_Data *pdata)
Definition: finddlg.c:364
#define CP_ACP
Definition: compat.h:99
LPSTR lpstrFindWhat
Definition: commdlg.h:307
WORD wFindWhatLen
Definition: commdlg.h:309
char * LPSTR
Definition: xmlstorage.h:182
#define FR_WINE_UNICODE
Definition: cdlg.h:36
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static BOOL COMDLG32_FR_CheckPartial(const FINDREPLACEA *pfr, BOOL Replace)
Definition: finddlg.c:302
struct FINDREPLACEA * LPFINDREPLACEA

Referenced by dialog_find().

◆ ReplaceTextA()

HWND WINAPI ReplaceTextA ( LPFINDREPLACEA  pfr)

Definition at line 464 of file finddlg.c.

466  {
468 
469  TRACE("LPFINDREPLACE=%p\n", pfr);
470 
471  if(!COMDLG32_FR_CheckPartial(pfr, TRUE))
472  return 0;
473 
474  if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL)
475  return 0; /* Error has been set */
476 
477  pdata->user_fr.fra = pfr;
478  pdata->fr = *pfr;
479  pdata->fr.Flags |= FR_WINE_REPLACE;
481 }
LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
Definition: cdlg32.c:100
#define TRUE
Definition: types.h:120
static HWND COMDLG32_FR_DoFindReplace(COMDLG32_FR_Data *pdata)
Definition: finddlg.c:364
#define FR_WINE_REPLACE
Definition: cdlg.h:37
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL COMDLG32_FR_CheckPartial(const FINDREPLACEA *pfr, BOOL Replace)
Definition: finddlg.c:302

◆ ReplaceTextW()

HWND WINAPI ReplaceTextW ( LPFINDREPLACEW  pfr)

Definition at line 526 of file finddlg.c.

528  {
530  DWORD len1, len2;
531 
532  TRACE("LPFINDREPLACE=%p\n", pfr);
533 
535  return 0;
536 
537  len1 = WideCharToMultiByte( CP_ACP, 0, pfr->lpstrFindWhat, pfr->wFindWhatLen,
538  NULL, 0, NULL, NULL );
540  NULL, 0, NULL, NULL );
541  if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data) + len1 + len2)) == NULL)
542  return 0; /* Error has been set */
543 
544  pdata->user_fr.frw = pfr;
545  pdata->fr = *(LPFINDREPLACEA)pfr; /* FINDREPLACEx have same size */
546  pdata->fr.Flags |= FR_WINE_REPLACE | FR_WINE_UNICODE;
547  pdata->fr.lpstrFindWhat = (LPSTR)(pdata + 1); /* Set string pointer */
548  pdata->fr.lpstrReplaceWith = pdata->fr.lpstrFindWhat + len1;
549 
551  pdata->fr.lpstrFindWhat, len1, NULL, NULL );
553  pdata->fr.lpstrReplaceWith, len2, NULL, NULL );
555 }
LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
Definition: cdlg32.c:100
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
static HWND COMDLG32_FR_DoFindReplace(COMDLG32_FR_Data *pdata)
Definition: finddlg.c:364
#define CP_ACP
Definition: compat.h:99
LPSTR lpstrFindWhat
Definition: commdlg.h:307
#define FR_WINE_REPLACE
Definition: cdlg.h:37
WORD wFindWhatLen
Definition: commdlg.h:309
char * LPSTR
Definition: xmlstorage.h:182
#define FR_WINE_UNICODE
Definition: cdlg.h:36
WORD wReplaceWithLen
Definition: commdlg.h:310
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL COMDLG32_FR_CheckPartial(const FINDREPLACEA *pfr, BOOL Replace)
Definition: finddlg.c:302
LPSTR lpstrReplaceWith
Definition: commdlg.h:308
struct FINDREPLACEA * LPFINDREPLACEA

Referenced by dialog_find().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( commdlg  )

Variable Documentation

◆ FindReplaceMessage

UINT FindReplaceMessage
static

Definition at line 42 of file finddlg.c.

Referenced by COMDLG32_FR_CheckPartial(), and COMDLG32_FR_HandleWMCommand().

◆ HelpMessage

UINT HelpMessage
static

Definition at line 43 of file finddlg.c.

Referenced by COMDLG32_FR_CheckPartial(), and COMDLG32_FR_HandleWMCommand().