Sweden-Number/dlls/comctl32/tests/taskdialog.c

59 lines
1.8 KiB
C

/* Unit tests for the task dialog control.
*
* Copyright 2017 Fabian Maurer for the Wine project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "commctrl.h"
#include "wine/test.h"
#include "v6util.h"
static HRESULT (WINAPI *pTaskDialogIndirect)(const TASKDIALOGCONFIG *, int *, int *, BOOL *);
START_TEST(taskdialog)
{
ULONG_PTR ctx_cookie;
void *ptr_ordinal;
HINSTANCE hinst;
HANDLE hCtx;
if (!load_v6_module(&ctx_cookie, &hCtx))
return;
/* Check if task dialogs are available */
hinst = LoadLibraryA("comctl32.dll");
pTaskDialogIndirect = (void *)GetProcAddress(hinst, "TaskDialogIndirect");
if (!pTaskDialogIndirect)
{
win_skip("TaskDialogIndirect not exported by name\n");
unload_v6_module(ctx_cookie, hCtx);
return;
}
ptr_ordinal = GetProcAddress(hinst, (const char *)345);
ok(pTaskDialogIndirect == ptr_ordinal, "got wrong pointer for ordinal 345, %p expected %p\n",
ptr_ordinal, pTaskDialogIndirect);
unload_v6_module(ctx_cookie, hCtx);
}