ReactOS 0.4.15-dev-7842-g558ab78
filedlg.c File Reference
#include <windows.h>
#include <wine/test.h>
#include "shlguid.h"
#include "shobjidl.h"
#include "commdlg.h"
#include "cderr.h"
#include "dlgs.h"
Include dependency graph for filedlg.c:

Go to the source code of this file.

Classes

struct  ok_wndproc_testcase
 
struct  posz
 

Macros

#define COBJMACROS
 
#define MAXNRCTRLS   30
 
#define TESTRECTS(R1, R2, Mx, My, Sx, Sy)
 

Functions

static void toolbarcheck (HWND hDlg)
 
static UINT_PTR CALLBACK OFNHookProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_DialogCancel (void)
 
static UINT_PTR CALLBACK create_view_window2_hook (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT_PTR WINAPI template_hook (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_create_view_window2 (void)
 
static void test_create_view_template (void)
 
static UINT_PTR WINAPI resize_template_hook (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_resize (void)
 
static UINT_PTR WINAPI test_ok_wndproc (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT_PTR WINAPI ok_template_hook (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_ok (void)
 
static UINT_PTR WINAPI template_hook_arrange (HWND dlgChild, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_arrange (void)
 
static UINT_PTR CALLBACK path_hook_proc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_getfolderpath (void)
 
static void test_resizable2 (void)
 
static void test_mru (void)
 
static UINT_PTR WINAPI test_extension_wndproc (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_extension_helper (OPENFILENAMEA *ofn, const char *filter, const char *expected_filename)
 
static void test_extension (void)
 
static BOOL WINAPI test_null_enum (HWND hwnd, LPARAM lParam)
 
static UINT_PTR WINAPI test_null_wndproc (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_null_filename (void)
 
static void test_directory_filename (void)
 
static UINT_PTR WINAPI test_ole_init_wndproc (HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK hook_proc (int code, WPARAM wp, LPARAM lp)
 
static void test_ole_initialization (void)
 
 START_TEST (filedlg)
 

Variables

static BOOL resizesupported = TRUE
 
struct {
   DWORD   flags
 
   int   resize_folderchange
 
   int   resize_timer1
 
   int   resize_check
 
   BOOL   todo
 
   BOOL   testcontrols
 
resize_testcases []
 
static ok_wndproc_testcase ok_testcases []
 
struct {
   int   nrcontrols
 
   posz   poszDlg
 
   posz   poszStc32
 
   posz   poszBtn
 
   DWORD   ofnflags
 
arrange_tests []
 
static CHAR SYSDIR [MAX_PATH]
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file filedlg.c.

◆ MAXNRCTRLS

#define MAXNRCTRLS   30

◆ TESTRECTS

#define TESTRECTS (   R1,
  R2,
  Mx,
  My,
  Sx,
  Sy 
)
Value:
((R1).left + (Mx) ==(R2).left \
&&(R1).top + (My) ==(R2).top \
&&(R1).right + (Mx) + (Sx) == (R2).right \
&&(R1).bottom + (My) + (Sy) ==(R2).bottom)
Definition: mxgeneral.h:41
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
#define R1(v, w, x, y, z, i)
Definition: sha1.c:36
#define R2(v, w, x, y, z, i)
Definition: sha1.c:37

Function Documentation

◆ create_view_window2_hook()

static UINT_PTR CALLBACK create_view_window2_hook ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 165 of file filedlg.c.

166{
167 if (msg == WM_NOTIFY)
168 {
170 {
171 IShellBrowser *shell_browser = (IShellBrowser *)SendMessageA(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0);
172 IShellView *shell_view = NULL;
173 IShellView2 *shell_view2 = NULL;
174 SV2CVW2_PARAMS view_params;
175 FOLDERSETTINGS folder_settings;
176 HRESULT hr;
177 RECT rect = {0, 0, 0, 0};
178
179 hr = IShellBrowser_QueryActiveShellView(shell_browser, &shell_view);
180 ok(SUCCEEDED(hr), "QueryActiveShellView returned %#x\n", hr);
181 if (FAILED(hr)) goto cleanup;
182
183 hr = IShellView_QueryInterface(shell_view, &IID_IShellView2, (void **)&shell_view2);
184 if (hr == E_NOINTERFACE)
185 {
186 win_skip("IShellView2 not supported\n");
187 goto cleanup;
188 }
189 ok(SUCCEEDED(hr), "QueryInterface returned %#x\n", hr);
190 if (FAILED(hr)) goto cleanup;
191
192 hr = IShellView2_DestroyViewWindow(shell_view2);
193 ok(SUCCEEDED(hr), "DestroyViewWindow returned %#x\n", hr);
194
195 folder_settings.ViewMode = FVM_LIST;
196 folder_settings.fFlags = 0;
197
198 view_params.cbSize = sizeof(view_params);
199 view_params.psvPrev = NULL;
200 view_params.pfs = &folder_settings;
201 view_params.psbOwner = shell_browser;
202 view_params.prcView = &rect;
203 view_params.pvid = NULL;
204 view_params.hwndView = NULL;
205
206 hr = IShellView2_CreateViewWindow2(shell_view2, &view_params);
207 if (hr == E_FAIL)
208 {
209 win_skip("CreateViewWindow2 is broken on Vista/W2K8\n");
210 goto cleanup;
211 }
212 ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#x\n", hr);
213 if (FAILED(hr)) goto cleanup;
214
215 hr = IShellView2_GetCurrentInfo(shell_view2, &folder_settings);
216 ok(SUCCEEDED(hr), "GetCurrentInfo returned %#x\n", hr);
217 ok(folder_settings.ViewMode == FVM_LIST,
218 "view mode is %d, expected FVM_LIST\n",
219 folder_settings.ViewMode);
220
221 hr = IShellView2_DestroyViewWindow(shell_view2);
222 ok(SUCCEEDED(hr), "DestroyViewWindow returned %#x\n", hr);
223
224 /* XP and W2K3 need this. On W2K the call to DestroyWindow() fails and has
225 * no side effects. NT4 doesn't get here. (FIXME: Vista doesn't get here yet).
226 */
227 DestroyWindow(view_params.hwndView);
228
229 view_params.pvid = &VID_Details;
230 hr = IShellView2_CreateViewWindow2(shell_view2, &view_params);
231 ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#x\n", hr);
232 if (FAILED(hr)) goto cleanup;
233
234 hr = IShellView2_GetCurrentInfo(shell_view2, &folder_settings);
235 ok(SUCCEEDED(hr), "GetCurrentInfo returned %#x\n", hr);
236 ok(folder_settings.ViewMode == FVM_DETAILS || broken(folder_settings.ViewMode == FVM_LIST), /* nt4 */
237 "view mode is %d, expected FVM_DETAILS\n",
238 folder_settings.ViewMode);
239
240cleanup:
241 if (shell_view2) IShellView2_Release(shell_view2);
242 if (shell_view) IShellView_Release(shell_view);
244 }
245 }
246 return 0;
247}
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139
#define CDN_FOLDERCHANGE
Definition: commdlg.h:35
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
static void cleanup(void)
Definition: main.c:1335
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define WM_NOTIFY
Definition: richedit.h:61
#define win_skip
Definition: test.h:160
HRESULT hr
Definition: shlfolder.c:183
@ FVM_LIST
Definition: shobjidl.idl:671
@ FVM_DETAILS
Definition: shobjidl.idl:672
& rect
Definition: startmenu.cpp:1413
Definition: inflate.c:139
#define E_NOINTERFACE
Definition: winerror.h:2364
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetParent(_In_ HWND)
#define WM_USER
Definition: winuser.h:1895
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by test_create_view_window2().

◆ hook_proc()

static LRESULT CALLBACK hook_proc ( int  code,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 1279 of file filedlg.c.

1280{
1281 static BOOL first_dlg = TRUE;
1282 HRESULT hr;
1283
1284 if (code == HCBT_CREATEWND)
1285 {
1287
1288 if (c->lpcs->lpszClass == (LPWSTR)WC_DIALOG)
1289 {
1290 /* OleInitialize() creates a window for the main apartment. Since
1291 * Vista OleInitialize() is called before the file dialog is
1292 * created. SimCity 2000 expects that the first window created
1293 * after GetOpenFileA() is a file dialog window. Mark Vista+
1294 * behavior as broken. */
1296 ok((first_dlg ? hr == S_OK : hr == S_FALSE)
1297 || broken(first_dlg && hr == S_FALSE),
1298 "OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg);
1300 first_dlg = FALSE;
1301 }
1302 }
1303
1304 return CallNextHookEx(NULL, code, wp, lp);
1305}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
unsigned int BOOL
Definition: ntddk_ex.h:94
const GLubyte * c
Definition: glext.h:8905
#define S_OK
Definition: intsafe.h:52
#define WC_DIALOG
Definition: undocuser.h:11
#define S_FALSE
Definition: winerror.h:2357
#define HCBT_CREATEWND
Definition: winuser.h:58
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by test_ole_initialization().

◆ OFNHookProc()

static UINT_PTR CALLBACK OFNHookProc ( HWND  hDlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 64 of file filedlg.c.

65{
66 LPNMHDR nmh;
67
68 if( msg == WM_NOTIFY)
69 {
70 nmh = (LPNMHDR) lParam;
71 if( nmh->code == CDN_INITDONE)
72 {
74 } else if (nmh->code == CDN_FOLDERCHANGE )
75 {
76 char buf[1024];
77 int ret;
78
79 memset(buf, 0x66, sizeof(buf));
81 ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n");
82 if (ret > 5)
83 ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n");
84 toolbarcheck( GetParent(hDlg));
85 }
86 }
87
88 return 0;
89}
#define CDN_INITDONE
Definition: commdlg.h:33
#define CDM_GETFOLDERIDLIST
Definition: commdlg.h:46
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void toolbarcheck(HWND hDlg)
Definition: filedlg.c:40
#define memset(x, y, z)
Definition: compat.h:39
UINT code
Definition: winuser.h:3159
int ret
LONG_PTR LPARAM
Definition: windef.h:208
struct tagNMHDR * LPNMHDR

Referenced by test_DialogCancel().

◆ ok_template_hook()

static UINT_PTR WINAPI ok_template_hook ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 617 of file filedlg.c.

618{
619 if (msg == WM_SETFONT)
621 return FALSE;
622}
static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:574
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GWLP_WNDPROC
Definition: treelist.c:66
#define SetWindowLongPtrA
Definition: winuser.h:5345
#define WM_SETFONT
Definition: winuser.h:1650

Referenced by test_ok().

◆ path_hook_proc()

static UINT_PTR CALLBACK path_hook_proc ( HWND  hDlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 866 of file filedlg.c.

867{
868 LPNMHDR nmh;
869
870 if( msg == WM_NOTIFY)
871 {
872 nmh = (LPNMHDR) lParam;
873 if( nmh->code == CDN_INITDONE)
874 {
876 }
877 else if ( nmh->code == CDN_FOLDERCHANGE)
878 {
879 char buf[1024];
880 int ret;
881
882 memset(buf, 0x66, sizeof(buf));
884 ok(!lstrcmpiA(SYSDIR, buf), "Expected '%s', got '%s'\n", SYSDIR, buf);
885 ok(lstrlenA(SYSDIR) + 1 == ret, "Expected %d, got %d\n", lstrlenA(SYSDIR) + 1, ret);
886 }
887 }
888
889 return 0;
890}
#define CDM_GETFOLDERPATH
Definition: commdlg.h:45
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static CHAR SYSDIR[MAX_PATH]
Definition: filedlg.c:864

Referenced by test_getfolderpath().

◆ resize_template_hook()

static UINT_PTR WINAPI resize_template_hook ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 328 of file filedlg.c.

329{
330 static RECT initrc, rc;
331 static int index, count;
332 static BOOL gotSWP_bottom, gotShowWindow;
333 HWND parent = GetParent( dlg);
334 int resize;
335#define MAXNRCTRLS 30
336 static RECT ctrlrcs[MAXNRCTRLS];
337 static int ctrlids[MAXNRCTRLS];
338 static HWND ctrls[MAXNRCTRLS];
339 static int nrctrls;
340
341 switch( msg)
342 {
343 case WM_INITDIALOG:
344 {
345 DWORD style;
346
347 index = ((OPENFILENAMEA*)lParam)->lCustData;
348 count = 0;
349 gotSWP_bottom = gotShowWindow = FALSE;
350 /* test style */
353 if( !(style & WS_SIZEBOX)) {
354 win_skip( "OFN_ENABLESIZING flag not supported.\n");
357 } else
359 "testid %d: dialog should have a WS_SIZEBOX style.\n", index);
360 else
361 ok( !(style & WS_SIZEBOX),
362 "testid %d: dialog should not have a WS_SIZEBOX style.\n", index);
363 break;
364 }
365 case WM_NOTIFY:
366 {
368 GetWindowRect( parent, &initrc);
370 MoveWindow( parent, initrc.left,initrc.top, initrc.right - initrc.left + resize,
371 initrc.bottom - initrc.top + resize, TRUE);
372 }
373 SetTimer( dlg, 0, 100, 0);
374 }
375 break;
376 }
377 case WM_TIMER:
378 {
379 if( count == 0){
380 /* store the control rectangles */
382 HWND ctrl;
383 int i;
384 for( i = 0, ctrl = GetWindow( parent, GW_CHILD);
385 i < MAXNRCTRLS && ctrl;
386 i++, ctrl = GetWindow( ctrl, GW_HWNDNEXT)) {
387 ctrlids[i] = GetDlgCtrlID( ctrl);
388 GetWindowRect( ctrl, &ctrlrcs[i]);
389 MapWindowPoints( NULL, parent, (LPPOINT) &ctrlrcs[i], 2);
390 ctrls[i] = ctrl;
391 }
392 nrctrls = i;
393 }
394 if( (resize = resize_testcases[index].resize_timer1)){
395 GetWindowRect( parent, &rc);
396 MoveWindow( parent, rc.left,rc.top, rc.right - rc.left + resize,
397 rc.bottom - rc.top + resize, TRUE);
398 }
399 } else if( count == 1){
400 resize = resize_testcases[index].resize_check;
401 GetWindowRect( parent, &rc);
403 ok( resize == rc.right - rc.left - initrc.right + initrc.left,
404 "testid %d size-x change %d expected %d\n", index,
405 rc.right - rc.left - initrc.right + initrc.left, resize);
406 ok( resize == rc.bottom - rc.top - initrc.bottom + initrc.top,
407 "testid %d size-y change %d expected %d\n", index,
408 rc.bottom - rc.top - initrc.bottom + initrc.top, resize);
409 }
411 int i;
412 RECT rc;
413 for( i = 0; i < nrctrls; i++) {
414 GetWindowRect( ctrls[i], &rc);
415 MapWindowPoints( NULL, parent, (LPPOINT) &rc, 2);
416 switch( ctrlids[i]){
417
418/* test if RECT R1, moved and sized result in R2 */
419#define TESTRECTS( R1, R2, Mx, My, Sx, Sy) \
420 ((R1).left + (Mx) ==(R2).left \
421 &&(R1).top + (My) ==(R2).top \
422 &&(R1).right + (Mx) + (Sx) == (R2).right \
423 &&(R1).bottom + (My) + (Sy) ==(R2).bottom)
424
425 /* sized horizontal and moved vertical */
426 case cmb1:
427 case edt1:
428 ok( TESTRECTS( ctrlrcs[i], rc, 0, 10, 10, 0),
429 "control id %03x should have sized horizontally and moved vertically, before %s after %s\n",
430 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
431 wine_dbgstr_rect( &rc ));
432 break;
433 /* sized horizontal and vertical */
434 case lst2:
435 ok( TESTRECTS( ctrlrcs[i], rc, 0, 0, 10, 10),
436 "control id %03x should have sized horizontally and vertically, before %s after %s\n",
437 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
438 wine_dbgstr_rect( &rc ));
439 break;
440 /* moved horizontal and vertical */
441 case IDCANCEL:
442 case pshHelp:
443 ok( TESTRECTS( ctrlrcs[i], rc, 10, 10, 0, 0),
444 "control id %03x should have moved horizontally and vertically, before %s after %s\n",
445 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
446 wine_dbgstr_rect( &rc ));
447 break;
448 /* moved vertically */
449 case chx1:
450 case stc2:
451 case stc3:
452 ok( TESTRECTS( ctrlrcs[i], rc, 0, 10, 0, 0),
453 "control id %03x should have moved vertically, before %s after %s\n",
454 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
455 wine_dbgstr_rect( &rc ));
456 break;
457 /* resized horizontal */
458 case cmb2: /* aka IDC_LOOKIN */
459 ok( TESTRECTS( ctrlrcs[i], rc, 0, 0, 10, 0)||
460 TESTRECTS( ctrlrcs[i], rc, 0, 0, 0, 0), /* Vista and higher */
461 "control id %03x should have resized horizontally, before %s after %s\n",
462 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
463 wine_dbgstr_rect( &rc ));
464 break;
465 /* non moving non sizing controls */
466 case stc4:
467 ok( TESTRECTS( rc, ctrlrcs[i], 0, 0, 0, 0),
468 "control id %03x was moved/resized, before %s after %s\n",
469 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
470 wine_dbgstr_rect( &rc ));
471 break;
472 /* todo_wine: non moving non sizing controls */
473 case lst1:
475 ok( TESTRECTS( rc, ctrlrcs[i], 0, 0, 0, 0),
476 "control id %03x was moved/resized, before %s after %s\n",
477 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
478 wine_dbgstr_rect( &rc ));
479 break;
480 /* don't test: id is not unique */
481 case IDOK:
482 case stc1:
483 case 0:
484 case -1:
485 break;
486 default:
487 trace("untested control id %03x before %s after %s\n",
488 ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ),
489 wine_dbgstr_rect( &rc ));
490#undef TESTRECTS
491#undef MAXNRCTRLS
492 }
493 }
494 }
495 KillTimer( dlg, 0);
497 }
498 count++;
499 }
500 break;
502 {
503 WINDOWPOS *pwp = (WINDOWPOS *)lParam;
504 if( !index && pwp->hwndInsertAfter == HWND_BOTTOM){
505 gotSWP_bottom = TRUE;
506 ok(!gotShowWindow, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n");
507 }
508 }
509 break;
510 case WM_SHOWWINDOW:
511 {
512 if( !index){
513 gotShowWindow = TRUE;
514 ok(gotSWP_bottom, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n");
515 }
516 }
517 break;
518 }
519 return 0;
520}
Arabic default style
Definition: afstyles.h:94
#define trace
Definition: atltest.h:70
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define index(s, c)
Definition: various.h:29
#define OFN_ENABLESIZING
Definition: commdlg.h:101
#define cmb1
Definition: dlgs.h:48
#define stc2
Definition: dlgs.h:161
#define pshHelp
Definition: dlgs.h:127
#define edt1
Definition: dlgs.h:65
#define lst2
Definition: dlgs.h:96
#define stc1
Definition: dlgs.h:160
#define stc4
Definition: dlgs.h:163
#define chx1
Definition: dlgs.h:31
#define cmb2
Definition: dlgs.h:49
#define stc3
Definition: dlgs.h:162
#define lst1
Definition: dlgs.h:95
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
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 const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MAXNRCTRLS
#define TESTRECTS(R1, R2, Mx, My, Sx, Sy)
int resize_timer1
Definition: filedlg.c:311
BOOL testcontrols
Definition: filedlg.c:314
BOOL todo
Definition: filedlg.c:313
int resize_folderchange
Definition: filedlg.c:310
static BOOL resizesupported
Definition: filedlg.c:38
static const struct @1641 resize_testcases[]
#define todo_wine_if(is_todo)
Definition: custom.c:76
#define todo_wine
Definition: custom.c:79
#define ctrl
Definition: input.c:1756
#define WS_SIZEBOX
Definition: pedump.c:642
HWND hwndInsertAfter
Definition: winuser.h:3589
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1661
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_INITDIALOG
Definition: winuser.h:1739
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define IDOK
Definition: winuser.h:830
#define GW_HWNDNEXT
Definition: winuser.h:761
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_SHOWWINDOW
Definition: winuser.h:1628
#define WM_TIMER
Definition: winuser.h:1742
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
int WINAPI GetDlgCtrlID(_In_ HWND)
#define GW_CHILD
Definition: winuser.h:763
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define GWL_STYLE
Definition: winuser.h:852
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define HWND_BOTTOM
Definition: winuser.h:1205

Referenced by test_resize().

◆ START_TEST()

START_TEST ( filedlg  )

Definition at line 1333 of file filedlg.c.

1334{
1338 test_arrange();
1339 test_resize();
1340 test_ok();
1342 test_mru();
1348}
static void test_arrange(void)
Definition: filedlg.c:787
static void test_mru(void)
Definition: filedlg.c:969
static void test_extension(void)
Definition: filedlg.c:1054
static void test_create_view_window2(void)
Definition: filedlg.c:270
static void test_null_filename(void)
Definition: filedlg.c:1156
static void test_ok(void)
Definition: filedlg.c:624
static void test_resizable2(void)
Definition: filedlg.c:928
static void test_directory_filename(void)
Definition: filedlg.c:1226
static void test_resize(void)
Definition: filedlg.c:522
static void test_DialogCancel(void)
Definition: filedlg.c:92
static void test_getfolderpath(void)
Definition: filedlg.c:892
static void test_create_view_template(void)
Definition: filedlg.c:287
static void test_ole_initialization(void)
Definition: filedlg.c:1307

◆ template_hook()

static UINT_PTR WINAPI template_hook ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 249 of file filedlg.c.

250{
251 if (msg == WM_INITDIALOG)
252 {
253 HWND p,cb;
254 INT sel;
255 p = GetParent(dlg);
256 ok(p!=NULL, "Failed to get parent of template\n");
257 cb = GetDlgItem(p,0x470);
258 ok(cb!=NULL, "Failed to get filter combobox\n");
259 sel = SendMessageA(cb, CB_GETCURSEL, 0, 0);
260 ok (sel != -1, "Failed to get selection from filter listbox\n");
261 }
262 if (msg == WM_NOTIFY)
263 {
266 }
267 return 0;
268}
GLfloat GLfloat p
Definition: glext.h:8902
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
int32_t INT
Definition: typedefs.h:58
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CB_GETCURSEL
Definition: winuser.h:1943

Referenced by test_create_view_template().

◆ template_hook_arrange()

static UINT_PTR WINAPI template_hook_arrange ( HWND  dlgChild,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 697 of file filedlg.c.

698{
699 static int index, fixhelp;
700 static posz posz0[2];
701 static RECT clrcParent, clrcChild, rcStc32;
702 static HWND hwndStc32;
703 HWND dlgParent;
704
705 dlgParent = GetParent( dlgChild);
706 if (msg == WM_INITDIALOG) {
707 index = ((OPENFILENAMEA*)lParam)->lCustData;
708 /* get the positions before rearrangement */
709 GetClientRect( dlgParent, &clrcParent);
710 GetClientRect( dlgChild, &clrcChild);
711 hwndStc32 = GetDlgItem( dlgChild, stc32);
712 if( hwndStc32) GetWindowRect( hwndStc32, &rcStc32);
713 }
714 if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) {
715 RECT wrcParent;
716
717 GetWindowRect( dlgParent, &wrcParent);
718 /* the fist two "tests" just save the dialogs position, with and without
719 * help button */
720 if( index == 0) {
721 posz0[0].x = wrcParent.left;
722 posz0[0].y = wrcParent.top;
723 posz0[0].cx = wrcParent.right - wrcParent.left;
724 posz0[0].cy = wrcParent.bottom - wrcParent.top;
725 } else if( index == 1) {
726 posz0[1].x = wrcParent.left;
727 posz0[1].y = wrcParent.top;
728 posz0[1].cx = wrcParent.right - wrcParent.left;
729 posz0[1].cy = wrcParent.bottom - wrcParent.top;
730 fixhelp = posz0[1].cy - posz0[0].cy;
731 } else {
732 /* the real tests */
733 int withhelp;
734 int expectx, expecty;
735 DWORD style;
736
737 withhelp = (arrange_tests[index].ofnflags & OFN_SHOWHELP) != 0;
738 GetWindowRect( dlgParent, &wrcParent);
739 if( !hwndStc32) {
740 /* case with no custom subitem with stc32:
741 * default to all custom controls below the standard */
742 expecty = posz0[withhelp].cy + clrcChild.bottom;
743 expectx = posz0[withhelp].cx;
744 } else {
745 /* special case: there is a control with id stc32 */
746 /* expected height */
747 expecty = posz0[withhelp].cy;
748 if( rcStc32.bottom - rcStc32.top + (withhelp ? 0 : fixhelp) > clrcParent.bottom) {
749 expecty += clrcChild.bottom - clrcParent.bottom;
750 if( !withhelp) expecty += fixhelp;
751 }
752 else
753 expecty += clrcChild.bottom - ( rcStc32.bottom - rcStc32.top) ;
754 /* expected width */
755 expectx = posz0[withhelp].cx;
756 if( rcStc32.right - rcStc32.left > clrcParent.right) {
757 expectx += clrcChild.right - clrcParent.right;
758 }
759 else
760 expectx += clrcChild.right - ( rcStc32.right - rcStc32.left) ;
761 }
762 style = GetWindowLongA( dlgParent, GWL_STYLE);
763 if( !(style & WS_SIZEBOX)) {
764 /* without the OFN_ENABLESIZING flag */
765 ok( wrcParent.bottom - wrcParent.top == expecty,
766 "Wrong height of dialog %d, expected %d\n",
767 wrcParent.bottom - wrcParent.top, expecty);
768 ok( wrcParent.right - wrcParent.left == expectx,
769 "Wrong width of dialog %d, expected %d\n",
770 wrcParent.right - wrcParent.left, expectx);
771 } else {
772 /* with the OFN_ENABLESIZING flag */
773 ok( wrcParent.bottom - wrcParent.top > expecty,
774 "Wrong height of dialog %d, expected more than %d\n",
775 wrcParent.bottom - wrcParent.top, expecty);
776 ok( wrcParent.right - wrcParent.left > expectx,
777 "Wrong width of dialog %d, expected more than %d\n",
778 wrcParent.right - wrcParent.left, expectx);
779 }
780
781 }
782 PostMessageA( dlgParent, WM_COMMAND, IDCANCEL, 0);
783 }
784 return 0;
785}
#define OFN_SHOWHELP
Definition: commdlg.h:120
#define stc32
Definition: dlgs.h:191
static struct @1642 arrange_tests[]
Definition: filedlg.c:664
int x
Definition: filedlg.c:665
int y
Definition: filedlg.c:665
int cx
Definition: filedlg.c:666
int cy
Definition: filedlg.c:666
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by test_arrange().

◆ test_arrange()

static void test_arrange ( void  )
static

Definition at line 787 of file filedlg.c.

788{
789 OPENFILENAMEA ofn = {0};
790 char filename[1024] = {0};
791 DWORD ret;
792 HRSRC hRes;
793 HANDLE hDlgTmpl;
794 LPBYTE pv;
795 DLGTEMPLATE *template;
796 DLGITEMTEMPLATE *itemtemplateStc32, *itemtemplateBtn;
797 int i;
798
799 /* load subdialog template into memory */
800 hRes = FindResourceA( GetModuleHandleA(NULL), "template_stc32", (LPSTR)RT_DIALOG);
801 hDlgTmpl = LoadResource( GetModuleHandleA(NULL), hRes );
802 /* get pointers to the structures for the dialog and the controls */
803 pv = LockResource( hDlgTmpl );
804 template = (DLGTEMPLATE*)pv;
805 if( template->x != 11111) {
806 win_skip("could not find the dialog template\n");
807 return;
808 }
809 /* skip dialog template, menu, class and title */
810 pv += sizeof(DLGTEMPLATE);
811 pv += 3 * sizeof(WORD);
812 /* skip font info */
813 while( *(WORD*)pv)
814 pv += sizeof(WORD);
815 pv += sizeof(WORD);
816 /* align on 32 bit boundaries */
817 pv = (LPBYTE)(((UINT_PTR)pv + 3 ) & ~3);
818 itemtemplateStc32 = (DLGITEMTEMPLATE*)pv;
819 if( itemtemplateStc32->x != 22222) {
820 win_skip("could not find the first item template\n");
821 return;
822 }
823 /* skip itemtemplate, class, title and creation data */
824 pv += sizeof(DLGITEMTEMPLATE);
825 pv += 4 * sizeof(WORD);
826 /* align on 32 bit boundaries */
827 pv = (LPBYTE)(((UINT_PTR)pv + 3 ) & ~3);
828 itemtemplateBtn = (DLGITEMTEMPLATE*)pv;
829 if( itemtemplateBtn->x != 12345) {
830 win_skip("could not find the second item template\n");
831 return;
832 }
833
836 ofn.nMaxFile = 1024;
838 ofn.hInstance = hDlgTmpl;
839 ofn.lpstrFilter="text\0*.txt\0All\0*\0\0";
840 for( i = 0; arrange_tests[i].nrcontrols != -1; i++) {
841 ofn.lCustData = i;
843 arrange_tests[i].ofnflags;
844 template->cdit = arrange_tests[i].nrcontrols;
845 template->x = arrange_tests[i].poszDlg.x;
846 template->y = arrange_tests[i].poszDlg.y;
847 template->cx = arrange_tests[i].poszDlg.cx;
848 template->cy = arrange_tests[i].poszDlg.cy;
849 itemtemplateStc32->x = arrange_tests[i].poszStc32.x;
850 itemtemplateStc32->y = arrange_tests[i].poszStc32.y;
851 itemtemplateStc32->cx = arrange_tests[i].poszStc32.cx;
852 itemtemplateStc32->cy = arrange_tests[i].poszStc32.cy;
853 itemtemplateBtn->x = arrange_tests[i].poszBtn.x;
854 itemtemplateBtn->y = arrange_tests[i].poszBtn.y;
855 itemtemplateBtn->cx = arrange_tests[i].poszBtn.cx;
856 itemtemplateBtn->cy = arrange_tests[i].poszBtn.cy;
858 ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
860 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
861 }
862}
DWORD WINAPI CommDlgExtendedError(void)
Definition: cdlg32.c:148
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_ENABLETEMPLATEHANDLE
Definition: commdlg.h:103
#define OFN_ENABLEHOOK
Definition: commdlg.h:99
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OPENFILENAME_SIZE_VERSION_400A
Definition: commdlg.h:396
BOOL WINAPI GetOpenFileNameA(OPENFILENAMEA *ofn)
Definition: filedlg.c:4701
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const UINT template
Definition: action.c:7481
unsigned short WORD
Definition: ntddk_ex.h:93
const char * filename
Definition: ioapi.h:137
static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:697
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define RT_DIALOG
Definition: pedump.c:367
OPENFILENAME ofn
Definition: sndrec32.cpp:56
LPARAM lCustData
Definition: commdlg.h:346
HINSTANCE hInstance
Definition: commdlg.h:331
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:347
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
unsigned char * LPBYTE
Definition: typedefs.h:53
char * LPSTR
Definition: xmlstorage.h:182

Referenced by START_TEST().

◆ test_create_view_template()

static void test_create_view_template ( void  )
static

Definition at line 287 of file filedlg.c.

288{
289 OPENFILENAMEA ofn = {0};
290 char filename[1024] = {0};
291 DWORD ret;
292
295 ofn.nMaxFile = 1024;
299 ofn.lpTemplateName = "template1";
300 ofn.lpstrFilter="text\0*.txt\0All\0*\0\0";
302 ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
304 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
305}
#define OFN_ENABLETEMPLATE
Definition: commdlg.h:102
static UINT_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:249
LPCSTR lpTemplateName
Definition: commdlg.h:348

Referenced by START_TEST().

◆ test_create_view_window2()

static void test_create_view_window2 ( void  )
static

Definition at line 270 of file filedlg.c.

271{
272 OPENFILENAMEA ofn = {0};
273 char filename[1024] = {0};
274 DWORD ret;
275
278 ofn.nMaxFile = 1024;
282 ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
284 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
285}
static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:165

Referenced by START_TEST().

◆ test_DialogCancel()

static void test_DialogCancel ( void  )
static

Definition at line 92 of file filedlg.c.

93{
96 char szFileName[MAX_PATH] = "";
97 char szInitialDir[MAX_PATH];
98
99 GetWindowsDirectoryA(szInitialDir, MAX_PATH);
100
101 ZeroMemory(&ofn, sizeof(ofn));
102
105 ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
106 ofn.lpstrFile = szFileName;
109 ofn.lpstrDefExt = "txt";
111 ofn.lpstrInitialDir = szInitialDir;
112
115 "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
116
118 ok(FALSE == result, "expected FALSE, got %d\n", result);
119 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
121
124 "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
125
127 ok(FALSE == result, "expected FALSE, got %d\n", result);
128 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
130
133 "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
134
135 /* Before passing the ofn to Unicode functions, remove the ANSI strings */
139
142 "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
143
144 SetLastError(0xdeadbeef);
147 win_skip("GetOpenFileNameW is not implemented\n");
148 else
149 {
150 ok(FALSE == result, "expected FALSE, got %d\n", result);
151 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
152 }
153
154 SetLastError(0xdeadbeef);
157 win_skip("GetSaveFileNameW is not implemented\n");
158 else
159 {
160 ok(FALSE == result, "expected FALSE, got %d\n", result);
161 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
162 }
163}
#define CDERR_INITIALIZATION
Definition: cderr.h:7
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4736
BOOL WINAPI GetSaveFileNameA(OPENFILENAMEA *ofn)
Definition: filedlg.c:4772
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
Definition: filedlg.c:4801
BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
Definition: printdlg.c:2252
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
GLuint64EXT * result
Definition: glext.h:11304
static UINT_PTR CALLBACK OFNHookProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:64
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by START_TEST().

◆ test_directory_filename()

static void test_directory_filename ( void  )
static

Definition at line 1226 of file filedlg.c.

1227{
1228 OPENFILENAMEA ofnA = {0};
1229 OPENFILENAMEW ofnW = {0};
1230 WCHAR filterW[] = {'t','e','x','t','\0','*','.','t','x','t','\0',
1231 'A','l','l','\0','*','\0','\0'};
1232 char szInitialDir[MAX_PATH] = {0};
1233 WCHAR szInitialDirW[MAX_PATH] = {0};
1234 DWORD ret;
1235
1236 GetWindowsDirectoryA(szInitialDir, MAX_PATH);
1237 GetWindowsDirectoryW(szInitialDirW, MAX_PATH);
1238
1239 szInitialDir[strlen(szInitialDir)] = '\\';
1240 szInitialDirW[lstrlenW(szInitialDirW)] = '\\';
1241
1243 ofnA.lpstrFile = szInitialDir;
1244 ofnA.nMaxFile = MAX_PATH;
1248 ofnA.lpstrFilter = "text\0*.txt\0All\0*\0\0";
1249 ofnA.lpstrDefExt = NULL;
1250 ret = GetOpenFileNameA(&ofnA);
1251 todo_wine ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
1252
1253 /* unicode tests */
1255 ofnW.lpstrFile = szInitialDirW;
1256 ofnW.nMaxFile = MAX_PATH;
1260 ofnW.lpstrFilter = filterW;
1261 ofnW.lpstrDefExt = NULL;
1262 ret = GetOpenFileNameW(&ofnW);
1263 todo_wine ok(!ret, "GetOpenFileNameW returned %#x\n", ret);
1264}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define OPENFILENAME_SIZE_VERSION_400W
Definition: commdlg.h:397
#define lstrlenW
Definition: compat.h:750
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
static UINT_PTR WINAPI test_null_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:1136
HINSTANCE hInstance
Definition: commdlg.h:362
DWORD Flags
Definition: commdlg.h:373
LPWSTR lpstrFile
Definition: commdlg.h:367
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:378
LPCWSTR lpstrDefExt
Definition: commdlg.h:376
DWORD lStructSize
Definition: commdlg.h:360
DWORD nMaxFile
Definition: commdlg.h:368
LPCWSTR lpstrFilter
Definition: commdlg.h:363
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ test_extension()

static void test_extension ( void  )
static

Definition at line 1054 of file filedlg.c.

1055{
1057 char filename[1024] = {0};
1058 char curdir[MAX_PATH];
1059 unsigned int i;
1060 BOOL boolret;
1061
1062 const char *defext_concrete_filters[] = {
1063 "TestFilter (*.abc)\0*.abc\0",
1064 "TestFilter (*.abc;)\0*.abc;\0",
1065 "TestFilter (*.abc;*.def)\0*.abc;*.def\0",
1066 };
1067
1068 const char *defext_wildcard_filters[] = {
1069 "TestFilter (*.pt*)\0*.pt*\0",
1070 "TestFilter (*.pt*;*.abc)\0*.pt*;*.abc\0",
1071 "TestFilter (*.ab?)\0*.ab?\0",
1072 "TestFilter (*.*)\0*.*\0",
1073 "TestFilter (*sav)\0*sav\0",
1074 NULL /* is a test, not an endmark! */
1075 };
1076
1077 boolret = GetCurrentDirectoryA(sizeof(curdir), curdir);
1078 ok(boolret, "Failed to get current dir err %d\n", GetLastError());
1079
1080 ofn.hwndOwner = NULL;
1084 ofn.lpstrInitialDir = curdir;
1086 ofn.nFileExtension = 0;
1087
1089
1090 /* Without lpstrDefExt, append no extension */
1091 test_extension_helper(&ofn, "TestFilter (*.abc) lpstrDefExt=NULL\0*.abc\0", "deadbeef");
1092 test_extension_helper(&ofn, "TestFilter (*.ab?) lpstrDefExt=NULL\0*.ab?\0", "deadbeef");
1093
1094 ofn.lpstrDefExt = "";
1095
1096 /* If lpstrDefExt="" and the filter has a concrete extension, append it */
1097 test_extension_helper(&ofn, "TestFilter (*.abc) lpstrDefExt=\"\"\0*.abc\0", "deadbeef.abc");
1098
1099 /* If lpstrDefExt="" and the filter has a wildcard extension, do nothing */
1100 test_extension_helper(&ofn, "TestFilter (*.ab?) lpstrDefExt=\"\"\0*.ab?\0", "deadbeef");
1101
1102 ofn.lpstrDefExt = "xyz";
1103
1104 /* Append concrete extensions from filters */
1105 for (i = 0; i < ARRAY_SIZE(defext_concrete_filters); i++) {
1106 test_extension_helper(&ofn, defext_concrete_filters[i], "deadbeef.abc");
1107 }
1108
1109 /* Append nothing from this filter */
1110 test_extension_helper(&ofn, "TestFilter (*.)\0*.\0", "deadbeef");
1111
1112 /* Ignore wildcard extensions in filters */
1113 for (i = 0; i < ARRAY_SIZE(defext_wildcard_filters); i++) {
1114 test_extension_helper(&ofn, defext_wildcard_filters[i], "deadbeef.xyz");
1115 }
1116
1117 /* Append valid extensions consisting of multiple parts */
1118 test_extension_helper(&ofn, "TestFilter (*.abc.def)\0*.abc.def\0", "deadbeef.abc.def");
1119 test_extension_helper(&ofn, "TestFilter (.abc.def)\0.abc.def\0", "deadbeef.abc.def");
1120 test_extension_helper(&ofn, "TestFilter (*.*.def)\0*.*.def\0", "deadbeef.xyz");
1121}
#define ARRAY_SIZE(A)
Definition: main.h:33
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:1018
static void test_extension_helper(OPENFILENAMEA *ofn, const char *filter, const char *expected_filename)
Definition: filedlg.c:1033
WORD nFileExtension
Definition: commdlg.h:344

Referenced by START_TEST().

◆ test_extension_helper()

static void test_extension_helper ( OPENFILENAMEA ofn,
const char filter,
const char expected_filename 
)
static

Definition at line 1033 of file filedlg.c.

1035{
1036 char *filename_ptr;
1037 DWORD ret;
1038 BOOL boolret;
1039
1040 strcpy(ofn->lpstrFile, "deadbeef");
1042
1043 boolret = GetSaveFileNameA(ofn);
1044 ok(boolret, "%s: expected TRUE\n", filter);
1045
1047 ok(!ret, "%s: CommDlgExtendedError returned %#x\n", filter, ret);
1048
1049 filename_ptr = ofn->lpstrFile + ofn->nFileOffset;
1050 ok(strcmp(filename_ptr, expected_filename) == 0,
1051 "%s: Filename is %s, expected %s\n", filter, filename_ptr, expected_filename);
1052}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
WORD nFileOffset
Definition: commdlg.h:343

Referenced by test_extension().

◆ test_extension_wndproc()

static UINT_PTR WINAPI test_extension_wndproc ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1018 of file filedlg.c.

1019{
1020 HWND parent = GetParent( dlg);
1021 if( msg == WM_NOTIFY) {
1022 SetTimer( dlg, 0, 1000, 0);
1024 }
1025 if( msg == WM_TIMER) {
1026 /* the dialog did not close automatically */
1027 KillTimer( dlg, 0);
1029 }
1030 return FALSE;
1031}

Referenced by test_extension().

◆ test_getfolderpath()

static void test_getfolderpath ( void  )
static

Definition at line 892 of file filedlg.c.

893{
895 BOOL result;
896 char szFileName[MAX_PATH] = "";
897 char szInitialDir[MAX_PATH];
898
899 /* We need to pick a different directory as the other tests because of new
900 * Windows 7 behavior.
901 */
902 GetSystemDirectoryA(szInitialDir, MAX_PATH);
903 lstrcpyA(SYSDIR, szInitialDir);
904
905 ZeroMemory(&ofn, sizeof(ofn));
906
909 ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
910 ofn.lpstrFile = szFileName;
913 ofn.lpstrDefExt = "txt";
915 ofn.lpstrInitialDir = szInitialDir;
916
918 ok(FALSE == result, "expected FALSE, got %d\n", result);
919 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
921
923 ok(FALSE == result, "expected FALSE, got %d\n", result);
924 ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
926}
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2283
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static UINT_PTR CALLBACK path_hook_proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:866

Referenced by START_TEST().

◆ test_mru()

static void test_mru ( void  )
static

Definition at line 969 of file filedlg.c.

970{
971 ok_wndproc_testcase testcase = {0};
973 const char *test_dir_name = "C:\\mru_test";
974 const char *test_file_name = "test.txt";
975 const char *test_full_path = "C:\\mru_test\\test.txt";
976 char filename_buf[MAX_PATH];
977 DWORD ret;
978
979 ofn.lpstrFile = filename_buf;
980 ofn.nMaxFile = sizeof(filename_buf);
981 ofn.lpTemplateName = "template1";
984 ofn.lCustData = (LPARAM)&testcase;
986
987 SetLastError(0xdeadbeef);
988 ret = CreateDirectoryA(test_dir_name, NULL);
989 ok(ret == TRUE, "CreateDirectoryA should have succeeded: %d\n", GetLastError());
990
991 /* "teach" comdlg32 about this directory */
992 strcpy(filename_buf, test_full_path);
993 SetLastError(0xdeadbeef);
995 ok(ret, "GetOpenFileNameA should have succeeded: %d\n", GetLastError());
997 ok(!ret, "CommDlgExtendedError returned %x\n", ret);
998 ok(testcase.actclose, "Open File dialog should have closed.\n");
999 ok(!strcmp(ofn.lpstrFile, test_full_path), "Expected to get %s, got %s\n", test_full_path, ofn.lpstrFile);
1000
1001 /* get a filename without a full path. it should return the file in
1002 * test_dir_name, not in the CWD */
1003 strcpy(filename_buf, test_file_name);
1004 SetLastError(0xdeadbeef);
1006 ok(ret, "GetOpenFileNameA should have succeeded: %d\n", GetLastError());
1008 ok(!ret, "CommDlgExtendedError returned %x\n", ret);
1009 ok(testcase.actclose, "Open File dialog should have closed.\n");
1010 if(strcmp(ofn.lpstrFile, test_full_path) != 0)
1011 win_skip("Platform doesn't save MRU data\n");
1012
1013 SetLastError(0xdeadbeef);
1014 ret = RemoveDirectoryA(test_dir_name);
1015 ok(ret == TRUE, "RemoveDirectoryA should have succeeded: %d\n", GetLastError());
1016}
#define OFN_NOCHANGEDIR
Definition: commdlg.h:109
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
#define test_file_name(a)
Definition: pipe.c:1224

Referenced by START_TEST().

◆ test_null_enum()

static BOOL WINAPI test_null_enum ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 1123 of file filedlg.c.

1124{
1125 /* Find the textbox and send a filename so IDOK will work.
1126 If the file textbox is empty IDOK will be ignored */
1127 CHAR className[20];
1128 if(GetClassNameA(hwnd, className, sizeof(className)) > 0 && !strcmp("Edit",className))
1129 {
1130 SetWindowTextA(hwnd, "testfile");
1131 return FALSE; /* break window enumeration */
1132 }
1133 return TRUE;
1134}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
char CHAR
Definition: xmlstorage.h:175

Referenced by test_null_wndproc().

◆ test_null_filename()

static void test_null_filename ( void  )
static

Definition at line 1156 of file filedlg.c.

1157{
1158 OPENFILENAMEA ofnA = {0};
1159 OPENFILENAMEW ofnW = {0};
1160 WCHAR filterW[] = {'t','e','x','t','\0','*','.','t','x','t','\0',
1161 'A','l','l','\0','*','\0','\0'};
1162 DWORD ret;
1163
1165 ofnA.lpstrFile = NULL;
1166 ofnA.nMaxFile = 0;
1167 ofnA.nFileOffset = 0xdead;
1168 ofnA.nFileExtension = 0xbeef;
1172 ofnA.lpstrFilter = "text\0*.txt\0All\0*\0\0";
1173 ofnA.lpstrDefExt = NULL;
1174 ret = GetOpenFileNameA(&ofnA);
1175 todo_wine ok(ret, "GetOpenFileNameA returned %#x\n", ret);
1177 todo_wine ok(!ret, "CommDlgExtendedError returned %#x, should be 0\n", ret);
1178
1179 todo_wine ok(ofnA.nFileOffset != 0xdead, "ofnA.nFileOffset is 0xdead\n");
1180 todo_wine ok(ofnA.nFileExtension != 0xbeef, "ofnA.nFileExtension is 0xbeef\n");
1181
1182 ofnA.lpstrFile = NULL;
1183 ofnA.nMaxFile = 1024; /* bogus input - lpstrFile = NULL but fake 1024 bytes available */
1184 ofnA.nFileOffset = 0xdead;
1185 ofnA.nFileExtension = 0xbeef;
1186 ret = GetOpenFileNameA(&ofnA);
1187 ok(ret, "GetOpenFileNameA returned %#x\n", ret);
1189 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
1190
1191 ok(ofnA.nFileOffset != 0xdead, "ofnA.nFileOffset is 0xdead\n");
1192 ok(ofnA.nFileExtension == 0, "ofnA.nFileExtension is 0x%x, should be 0\n", ofnA.nFileExtension);
1193
1194 /* unicode tests */
1196 ofnW.lpstrFile = NULL;
1197 ofnW.nMaxFile = 0;
1198 ofnW.nFileOffset = 0xdead;
1199 ofnW.nFileExtension = 0xbeef;
1203 ofnW.lpstrFilter = filterW;
1204 ofnW.lpstrDefExt = NULL;
1205 ret = GetOpenFileNameW(&ofnW);
1206 todo_wine ok(ret, "GetOpenFileNameW returned %#x\n", ret);
1208 todo_wine ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
1209
1210 todo_wine ok(ofnW.nFileOffset != 0xdead, "ofnW.nFileOffset is 0xdead\n");
1211 todo_wine ok(ofnW.nFileExtension != 0xbeef, "ofnW.nFileExtension is 0xbeef\n");
1212
1213 ofnW.lpstrFile = NULL;
1214 ofnW.nMaxFile = 1024; /* bogus input - lpstrFile = NULL but fake 1024 bytes available */
1215 ofnW.nFileOffset = 0xdead;
1216 ofnW.nFileExtension = 0xbeef;
1217 ret = GetOpenFileNameW(&ofnW);
1218 ok(ret, "GetOpenFileNameA returned %#x\n", ret);
1220 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
1221
1222 ok(ofnW.nFileOffset != 0xdead, "ofnW.nFileOffset is 0xdead\n");
1223 ok(ofnW.nFileExtension == 0, "ofnW.nFileExtension is 0x%x, should be 0\n", ofnW.nFileExtension);
1224}
WORD nFileExtension
Definition: commdlg.h:375
WORD nFileOffset
Definition: commdlg.h:374

Referenced by START_TEST().

◆ test_null_wndproc()

static UINT_PTR WINAPI test_null_wndproc ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1136 of file filedlg.c.

1137{
1138 HWND parent = GetParent( dlg);
1139 if( msg == WM_NOTIFY) {
1140 SetTimer( dlg, 0, 100, 0);
1141 SetTimer( dlg, 1, 1000, 0);
1143 }
1144 if( msg == WM_TIMER) {
1145 if(!wParam)
1147 else {
1148 /* the dialog did not close automatically */
1149 KillTimer( dlg, 0);
1151 }
1152 }
1153 return FALSE;
1154}
WPARAM wParam
Definition: combotst.c:138
static BOOL WINAPI test_null_enum(HWND hwnd, LPARAM lParam)
Definition: filedlg.c:1123
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)

Referenced by test_directory_filename(), and test_null_filename().

◆ test_ok()

static void test_ok ( void  )
static

Definition at line 624 of file filedlg.c.

625{
627 char filename[1024] = {0};
628 char tmpfilename[ MAX_PATH];
629 char curdir[MAX_PATH];
630 int i;
631 DWORD ret;
632 BOOL cdret;
633
634 cdret = GetCurrentDirectoryA(sizeof(curdir), curdir);
635 ok(cdret, "Failed to get current dir err %d\n", GetLastError());
636 if (!GetTempFileNameA(".", "txt", 0, tmpfilename)) {
637 skip("Failed to create a temporary file name\n");
638 return;
639 }
641 ofn.nMaxFile = 1024;
643 ofn.lpTemplateName = "template1";
645 for( i = 0; ok_testcases[i].retval != -1; i++) {
650 ok( ok_testcases[i].expclose == ok_testcases[i].actclose,
651 "testid %d: Open File dialog should %shave closed.\n", i,
652 ok_testcases[i].expclose ? "" : "NOT ");
653 ok(ret == ok_testcases[i].expclose, "testid %d: GetOpenFileName returned %#x\n", i, ret);
655 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
656 cdret = SetCurrentDirectoryA(curdir);
657 ok(cdret, "Failed to restore current dir err %d\n", GetLastError());
658 }
660 ok( ret, "Failed to delete temporary file %s err %d\n", tmpfilename, GetLastError());
661}
#define skip(...)
Definition: atltest.h:64
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
static UINT_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:617
static ok_wndproc_testcase ok_testcases[]
Definition: filedlg.c:556
static const char tmpfilename[]
Definition: parser.c:49

Referenced by START_TEST().

◆ test_ok_wndproc()

static UINT_PTR WINAPI test_ok_wndproc ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 574 of file filedlg.c.

575{
576 HWND parent = GetParent( dlg);
577 static ok_wndproc_testcase *testcase = NULL;
578 static UINT msgFILEOKSTRING;
579 if (msg == WM_INITDIALOG)
580 {
581 testcase = (ok_wndproc_testcase*)((OPENFILENAMEA*)lParam)->lCustData;
582 testcase->actclose = TRUE;
583 msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRINGA);
584 }
585 if( msg == WM_NOTIFY) {
587 SetTimer( dlg, 0, 100, 0);
589 return FALSE;
590 } else if(((LPNMHDR)lParam)->code == CDN_FILEOK) {
591 if( testcase->usemsgokstr)
592 return FALSE;
593 if( testcase->setmsgresult)
594 SetWindowLongPtrA( dlg, DWLP_MSGRESULT, testcase->retval);
595 return testcase->retval;
596 }
597 }
598 if( msg == msgFILEOKSTRING) {
599 if( !testcase->usemsgokstr)
600 return FALSE;
601 if( testcase->setmsgresult)
602 SetWindowLongPtrA( dlg, DWLP_MSGRESULT, testcase->retval);
603 return testcase->retval;
604 }
605 if( msg == WM_TIMER) {
606 /* the dialog did not close automatically */
607 testcase->actclose = FALSE;
608 KillTimer( dlg, 0);
610 return FALSE;
611 }
612 if( testcase && testcase->do_subclass)
613 return DefWindowProcA( dlg, msg, wParam, lParam);
614 return FALSE;
615}
#define FILEOKSTRINGA
Definition: commdlg.h:17
#define CDN_FILEOK
Definition: commdlg.h:38
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DWLP_MSGRESULT
Definition: winuser.h:870

Referenced by ok_template_hook(), test_mru(), and test_ok().

◆ test_ole_init_wndproc()

static UINT_PTR WINAPI test_ole_init_wndproc ( HWND  dlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1266 of file filedlg.c.

1267{
1268 HRESULT hr;
1269
1271 ok(hr == S_FALSE, "OleInitialize() returned %#x\n", hr);
1273
1274 if (msg == WM_NOTIFY)
1276 return FALSE;
1277}

Referenced by test_ole_initialization().

◆ test_ole_initialization()

static void test_ole_initialization ( void  )
static

Definition at line 1307 of file filedlg.c.

1308{
1309 char file[MAX_PATH] = {0};
1310 OPENFILENAMEA ofn = {0};
1311 HRESULT hr;
1312 HHOOK hook;
1313 BOOL ret;
1314
1316
1318 ofn.lpstrFile = file;
1324 ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
1325
1327 ok(hr == S_OK, "OleInitialize() returned %#x\n", hr);
1329
1331}
@ hook
Definition: SystemMenu.c:35
static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: filedlg.c:1279
static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:1266
Definition: fci.c:127
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
#define WH_CBT
Definition: winuser.h:35
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)

Referenced by START_TEST().

◆ test_resizable2()

static void test_resizable2 ( void  )
static

Definition at line 928 of file filedlg.c.

929{
930 OPENFILENAMEA ofn = {0};
931 char filename[1024] = "pls press Enter if sizable, Esc otherwise";
932 DWORD ret;
933
934 /* interactive because there is no hook function */
936 skip( "some interactive resizable dialog tests (set WINETEST_INTERACTIVE=1)\n");
937 return;
938 }
941 ofn.nMaxFile = 1024;
942 ofn.lpfnHook = NULL;
944 ofn.lpTemplateName = "template1";
947 ok( ret == TRUE, "File Dialog should have been sizable\n");
949 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
952 ok( !ret, "File Dialog should NOT have been sizable\n");
954 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
959 ok( !ret, "File Dialog should NOT have been sizable\n");
961 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
964 ok( !ret, "File Dialog should NOT have been sizable\n");
966 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
967}
int winetest_interactive

Referenced by START_TEST().

◆ test_resize()

static void test_resize ( void  )
static

Definition at line 522 of file filedlg.c.

523{
525 char filename[1024] = {0};
526 DWORD ret;
527 int i;
528
530 ofn.nMaxFile = 1024;
533 ofn.lpTemplateName = "template_sz";
534 for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) {
535 ofn.lCustData = i;
536 ofn.Flags = resize_testcases[i].flags |
539 ok(!ret, "GetOpenFileName returned %#x\n", ret);
541 ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
542 }
543}
static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: filedlg.c:328

Referenced by START_TEST().

◆ toolbarcheck()

static void toolbarcheck ( HWND  hDlg)
static

Definition at line 40 of file filedlg.c.

41{
42 /* test toolbar properties */
43 /* bug #10532 */
44 int maxtextrows;
45 HWND ctrl;
46 DWORD ret;
47 char classname[20];
48
49 for( ctrl = GetWindow( hDlg, GW_CHILD);
52 classname[7] = '\0';
53 if( !strcmp( classname, "Toolbar")) break;
54 }
55 ok( ctrl != NULL, "could not get the toolbar control\n");
56 ret = SendMessageA( ctrl, TB_ADDSTRINGA, 0, (LPARAM)"winetestwinetest\0\0");
57 ok( ret == 0, "addstring returned %d (expected 0)\n", ret);
58 maxtextrows = SendMessageA( ctrl, TB_GETTEXTROWS, 0, 0);
59 ok( maxtextrows == 0 || broken(maxtextrows == 1), /* Win2k and below */
60 "Get(Max)TextRows returned %d (expected 0)\n", maxtextrows);
61}
#define TB_ADDSTRINGA
Definition: commctrl.h:1131
#define TB_GETTEXTROWS
Definition: commctrl.h:1163
WCHAR classname[128]
Definition: startup.c:15

Referenced by OFNHookProc().

Variable Documentation

◆ 

struct { ... } arrange_tests[]
Initial value:
= {
{ 0, {0},{0},{0},0 },
{ 0, {0},{0},{0}, OFN_SHOWHELP},
{ 0, {0, 0, 316, 76},{0},{0},0 },
{ 0, {0, 0, 100, 76},{0},{0}, OFN_SHOWHELP},
{ 1, {0, 0, 316, 76} ,{0, 0, 204, 76,},{0},0 },
{ 1, {0, 0, 316, 76} ,{0, 0, 204, 76,},{0}, OFN_SHOWHELP},
{ 1, {0, 0, 316, 170} ,{0, 0, 204, 170,},{0},0 },
{ 1, {0, 0, 316, 165} ,{0, 0, 411, 165,},{0}, OFN_SHOWHELP },
{ 1, {0, 0, 300, 100} ,{73, 17, 50, 50,},{0},0 },
{ 2, {0, 0, 280, 100} ,{0, 0, 50, 50,},{300,20,30,30},0 },
{ 0, {0},{0},{0}, OFN_SHOWHELP|OFN_ENABLESIZING},
{ -1 }
}

Referenced by template_hook_arrange(), and test_arrange().

◆ flags

Definition at line 309 of file filedlg.c.

◆ nrcontrols

int nrcontrols

Definition at line 669 of file filedlg.c.

◆ ofnflags

DWORD ofnflags

Definition at line 673 of file filedlg.c.

◆ ok_testcases

ok_wndproc_testcase ok_testcases[]
static
Initial value:
= {
{ 0, FALSE, FALSE, FALSE, TRUE},
{ 0, TRUE, FALSE, FALSE, TRUE},
{ 0, FALSE, FALSE, TRUE, TRUE},
{ 0, TRUE, FALSE, TRUE, TRUE},
{ 1, FALSE, FALSE, FALSE, TRUE},
{ 1, TRUE, FALSE, FALSE, FALSE},
{ 1, FALSE, FALSE, TRUE, FALSE},
{ 1, TRUE, FALSE, TRUE, FALSE},
{ 1, TRUE, TRUE, FALSE, FALSE},
{ 1, FALSE, TRUE, TRUE, FALSE},
{ -1 }
}

Definition at line 556 of file filedlg.c.

Referenced by test_ok().

◆ poszBtn

posz poszBtn

Definition at line 672 of file filedlg.c.

◆ poszDlg

posz poszDlg

Definition at line 670 of file filedlg.c.

◆ poszStc32

posz poszStc32

Definition at line 671 of file filedlg.c.

◆ resize_check

int resize_check

Definition at line 312 of file filedlg.c.

◆ resize_folderchange

int resize_folderchange

Definition at line 310 of file filedlg.c.

Referenced by resize_template_hook().

◆ 

const struct { ... } resize_testcases[]
Initial value:
= {
{ 0 , 10, 10, 20,FALSE,FALSE},
{ 0 ,-10,-10,-20,FALSE,FALSE},
{ OFN_ENABLESIZING , 0,-10, 0,FALSE,FALSE},
{ OFN_ENABLESIZING , 0, 10, 10,FALSE, TRUE},
{ OFN_ENABLESIZING ,-10, 0, 10,FALSE,FALSE},
{ OFN_ENABLESIZING , 10, 0, 10,FALSE,FALSE},
{ OFN_ENABLESIZING , 0, 10, 20,FALSE,FALSE},
{ 0xffffffff }
}

Referenced by resize_template_hook(), and test_resize().

◆ resize_timer1

int resize_timer1

Definition at line 311 of file filedlg.c.

Referenced by resize_template_hook().

◆ resizesupported

BOOL resizesupported = TRUE
static

Definition at line 38 of file filedlg.c.

Referenced by resize_template_hook(), and START_TEST().

◆ SYSDIR

CHAR SYSDIR[MAX_PATH]
static

Definition at line 864 of file filedlg.c.

Referenced by path_hook_proc(), and test_getfolderpath().

◆ testcontrols

BOOL testcontrols

Definition at line 314 of file filedlg.c.

Referenced by resize_template_hook().

◆ todo

BOOL todo

Definition at line 313 of file filedlg.c.

Referenced by _check_cur_pos(), _lzx_get_bytes(), _sink_check_ok(), _sink_fire_ok(), _test_group(), check_lnk_(), check_orderarray(), check_output(), check_reg_dword(), check_reg_str(), checkChainStatus(), checkElementStatus(), checkSimpleChainStatus(), chmc_appendfile(), compare_attributes(), compare_bitmap_bits_(), compare_export_(), compare_hash_broken_todo(), compare_query_(), DSOUND_MixInBuffer(), DSOUND_PerformMix(), expect_guid(), expect_rawformat(), get_security_descriptor(), getChain(), ok_(), ok_iids_(), ok_path(), ok_sequence_(), resize_template_hook(), test_bufferrawformat(), test_button_messages(), test_CertRDNValueToStrA(), test_CertRDNValueToStrW(), test_CoInternetCombineIUri(), test_CoInternetCombineUrlEx(), test_color_formats(), test_component_states(), test_conversion(), test_convert(), test_create_and_fail(), test_DavGetHTTPFromUNCPath(), test_decoder_info(), test_dik_codes(), test_DrawImage_scale(), test_feature_states(), test_FindFirstFile_wildcards(), test_GetCharsetInfo_other(), test_GetRfc1766Info(), test_hittest(), test_ico_data_(), test_IdnToNameprepUnicode(), test_Image_StretchMode(), test_IWbemLocator(), test_listbox_size(), test_named_pipe_security(), test_NameToStrConversionA(), test_NameToStrConversionW(), test_png_color_formats(), test_preinitialization(), test_queryreader(), test_saxstr(), test_ScriptIsComplex(), test_url_canonicalize(), test_url_combine(), test_UrlCanonicalizeA(), test_UrlCombine(), test_VerifyVersionInfo(), test_wintrust_digest(), test_WriteAttributeString(), test_WriteElementString(), test_WriteStartElement(), testGetCertChain(), and verify_reg_().