45 char replacebuffer[64];
54#define CHECK_FIND_OR_REPLACE(FUNC, FAIL, ERR_CODE) \
56 HWND hwnd = FUNC(pFr); \
57 BOOL is_ok = !!hwnd == !FAIL; \
58 ok(is_ok, "%s should%s fail\n", #FUNC, FAIL ? "" : "n't"); \
59 if (FAIL && is_ok) { \
60 DWORD ext_err = CommDlgExtendedError(); \
61 ok(ext_err == ERR_CODE, "expected err %x got %x\n", \
64 DestroyWindow(hwnd); \
68#define CHECK_FIND_FAIL(ERR_CODE) \
69 CHECK_FIND_OR_REPLACE(FindTextA, TRUE, ERR_CODE)
71#define CHECK_FIND_SUCCEED() \
72 CHECK_FIND_OR_REPLACE(FindTextA, FALSE, 0)
74#define CHECK_REPLACE_FAIL(ERR_CODE) \
75 CHECK_FIND_OR_REPLACE(ReplaceTextA, TRUE, ERR_CODE)
77#define CHECK_REPLACE_SUCCEED() \
78 CHECK_FIND_OR_REPLACE(ReplaceTextA, FALSE, 0)
80#define CHECK_FINDREPLACE_FAIL(ERR_CODE) \
82 CHECK_FIND_FAIL(ERR_CODE); \
83 CHECK_REPLACE_FAIL(ERR_CODE); \
107 strcpy(findbuffer,
"abc");
113 strcpy(replacebuffer,
"def");
char * strcpy(char *DstString, const char *SrcString)
#define CDERR_NOHINSTANCE
#define CDERR_INITIALIZATION
#define CDERR_FINDRESFAILURE
#define FRERR_BUFFERLENGTHZERO
#define CDERR_DIALOGFAILURE
#define FR_ENABLETEMPLATEHANDLE
#define FR_ENABLETEMPLATE
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
#define CHECK_REPLACE_FAIL(ERR_CODE)
#define CHECK_FINDREPLACE_FAIL(ERR_CODE)
static LRESULT handle_findmsg(FINDREPLACEA *fr)
static UINT ID_FINDMSGSTRING
static void test_param_check(void)
#define CHECK_REPLACE_SUCCEED()
static LRESULT CALLBACK OwnerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
#define CHECK_FIND_SUCCEED()
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI DestroyWindow(_In_ HWND)