34#define WM_KEYF1 0x004d
37#define WM_TD_CALLBACK (WM_APP)
39#define NUM_MSG_SEQUENCES 1
40#define TASKDIALOG_SEQ_INDEX 0
42#define TEST_NUM_BUTTONS 10
43#define TEST_NUM_RADIO_BUTTONS 3
46#define ID_START_BUTTON (ID_START + 0)
47#define ID_START_RADIO_BUTTON (ID_START + 20)
396#define run_test(info, expect_button, expect_radio_button, verification_checked, seq, context) \
397 run_test_(info, expect_button, expect_radio_button, verification_checked, seq, context, \
398 ARRAY_SIZE(seq) - 1, __FILE__, __LINE__)
412 msg_start =
msg = heap_alloc_zero(
sizeof(*
msg) * (test_messages_len + 3));
416 for (
i = 0;
i < test_messages_len;
i++)
424 hr = pTaskDialogIndirect(
info, &ret_button, &ret_radio, &ret_verification);
429 "Wrong button. Expected %d, got %d\n", expect_button, ret_button);
431 "Wrong radio button. Expected %d, got %d\n", expect_radio_button, ret_radio);
454 for(; msg_send && msg_send->
message; msg_send++)
497 const WCHAR button_format[] = {
'%',
'0',
'2',
'd',0};
531 info.nDefaultButton = 0;
548 info.dwFlags = command_link_flags[
i];
551 info.nDefaultButton = 0xff;
553 info.pButtons = custom_buttons;
555 "default button: invalid default, with common buttons - 1");
557 info.nDefaultButton = -1;
560 info.nDefaultButton = -2;
562 "default button: invalid default, with common buttons - 3");
565 info.dwCommonButtons = 0;
567 "default button: invalid default, no common buttons");
581 info.nDefaultButton = 0;
586 info.pRadioButtons = radio_buttons;
590 "default radio button: default first radio button");
595 "default radio button: default radio button");
598 info.nDefaultRadioButton = -2;
600 "default radio button: default radio button with id -2");
605 "default radio button: radio button after clicking");
610 "default radio button: disable radio button before clicking");
616 "default radio button: no default radio flag");
620 info.nDefaultRadioButton = 0;
623 "default radio button: no default radio id and flag");
627 info.nDefaultRadioButton = 0xff;
630 "default radio button: no default flag, invalid id");
632 info.nDefaultRadioButton = 0;
635 "radio button: manually click radio button with negative id");
639 info.pButtons = custom_buttons;
641 info.pRadioButtons = radio_buttons;
642 info.dwCommonButtons = 0;
649 "sends click to non-existent buttons with WM_COMMAND");
685 if (
data->num_fired == 3)
686 ok(
data->last_elapsed_ms > elapsed_ms,
"Expected reference time update.\n");
689 delta = elapsed_ms -
data->last_elapsed_ms;
690 ok(delta > 0,
"Expected positive time tick difference.\n");
692 data->last_elapsed_ms = elapsed_ms;
694 if (
data->num_fired == 3)
727 ok(
ret == PBST_NORMAL,
"Expect state: %d got state: %lx\n", PBST_NORMAL,
ret);
729 ok(
ret == PBST_NORMAL,
"Expect state: %d got state: %lx\n", PBST_NORMAL,
ret);
732 todo_wine ok(
ret == PBST_PAUSED,
"Expect state: %d got state: %lx\n", PBST_PAUSED,
ret);
734 todo_wine ok(
ret == PBST_ERROR,
"Expect state: %d got state: %lx\n", PBST_ERROR,
ret);
746 ok(
ret == 0,
"Expect position:%x got:%lx\n", 0,
ret);
748 ok(
ret == 0,
"Expect position:%x got:%lx\n", 0,
ret);
753 ok(
ret == 0,
"Expect position:%x got:%lx\n", 0,
ret);
755 ok(
ret == 1,
"Expect position:%x got:%lx\n", 1,
ret);
807 "default verification box: default checked and then unchecked");
811 "default verification box: default unchecked and then checked");
817 static const WCHAR textW[] = {
't',
'e',
'x',
't', 0};
818 static const WCHAR button_format[] = {
'%',
'0',
'2',
'd', 0};
838 info.pRadioButtons = radio_buttons;
886 if (!pTaskDialogIndirect)
888 win_skip(
"TaskDialogIndirect not exported by name\n");
896 ok(pTaskDialog == ptr_ordinal,
"got wrong pointer for ordinal 344, %p expected %p\n",
897 ptr_ordinal, pTaskDialog);
900 ok(pTaskDialogIndirect == ptr_ordinal,
"got wrong pointer for ordinal 345, %p expected %p\n",
901 ptr_ordinal, pTaskDialogIndirect);
static BOOL heap_free(void *mem)
static void init_msg_sequences(struct msg_sequence **seq, int n)
static void flush_sequences(struct msg_sequence **seq, int n)
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
static void test_messages(void)
static const struct message_info msg_return_verification_checked[]
static const struct message_info msg_return_press_retry[]
static void test_verification_box(void)
static const struct message_info msg_return_default_radio_button_clicking_disabled[]
static void test_progress_bar(void)
static HRESULT CALLBACK taskdialog_callback_proc_timer(HWND hwnd, UINT notification, WPARAM wParam, LPARAM lParam, LONG_PTR ref_data)
static const struct message_info msg_got_tdn_help[]
static const struct message_info msg_select_negative_id_radio_button[]
static const struct message_info msg_press_nonexistent_buttons_with_command[]
static const struct message_info msg_send_click_ok[]
static const struct message_info msg_return_press_yes[]
#define NUM_MSG_SEQUENCES
static void test_navigate_page(void)
static const struct message_info msg_return_verification_unchecked[]
static const struct message_info msg_send_close_then_ok[]
static const struct message_info msg_return_press_negative_id_radio_button[]
static int int BOOL *static const WCHAR const WCHAR const WCHAR TASKDIALOG_COMMON_BUTTON_FLAGS
#define run_test(info, expect_button, expect_radio_button, verification_checked, seq, context)
static HRESULT CALLBACK taskdialog_callback_proc(HWND hwnd, UINT notification, WPARAM wParam, LPARAM lParam, LONG_PTR ref_data)
static const struct message_info msg_return_press_no[]
static const struct message_info msg_select_first_disabled_radio_button_and_press_ok[]
static const struct message_info msg_return_press_ok[]
static const struct message_info msg_return_default_verification_checked[]
static void test_buttons(void)
static const struct message_info msg_send_all_common_button_click_with_command[]
static void test_help(void)
static void test_invalid_parameters(void)
static const struct message_info msg_send_close[]
static const struct message_info msg_uncheck_verification[]
static const struct message_info msg_handle_wm_close_without_cancel_button[]
static const struct message_info msg_return_default_radio_button_2[]
static const struct message_info msg_return_no_default_radio_button_id_and_flag[]
static const struct message_info msg_send_f1[]
static void test_wm_close(void)
static const struct message_info msg_handle_wm_close[]
#define TEST_NUM_RADIO_BUTTONS
static const struct message_info msg_return_first_radio_button[]
static int int BOOL *static HINSTANCE
static const LONG_PTR test_ref_data
static const struct message_info msg_return_no_default_radio_button_flag[]
static const struct message_info msg_send_navigate[]
static const struct message_info msg_return_default_verification_unchecked[]
static const struct message_info msg_send_return[]
static const struct message_info * current_message_info
static const struct message_info msg_return_press_custom10[]
static const struct message_info msg_send_nonexistent_radio_button_click[]
static TASKDIALOGCONFIG navigated_info
static const struct message_info msg_return_default_radio_button_3[]
static const struct message_info msg_press_nonexistent_buttons[]
static void test_callback(void)
static const struct message_info msg_return_default_radio_button_1[]
static const struct message_info msg_check_verification[]
static int int BOOL *static const WCHAR const WCHAR const WCHAR const WCHAR int *static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
static const struct message_info msg_press_nonexistent_radio_button[]
static const struct message_info msg_return_navigated_page[]
#define TASKDIALOG_SEQ_INDEX
static const struct message_info msg_select_first_radio_button[]
static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radio_button, BOOL verification_checked, const struct message_info *test_messages, const char *context, int test_messages_len, const char *file, int line)
static void init_test_message(UINT message, WPARAM wParam, LPARAM lParam, struct message *msg)
static const struct message_info msg_send_all_common_button_click[]
static const struct message_info msg_return_press_custom1[]
static void test_timer(void)
static const struct message_info msg_return_press_cancel[]
#define ID_START_RADIO_BUTTON
static const struct message_info msg_return_press_custom4[]
static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT notification, WPARAM wParam, LPARAM lParam, LONG_PTR ref_data)
static const WCHAR textW[]
struct _TASKDIALOGCONFIG TASKDIALOGCONFIG
@ TDF_NO_DEFAULT_RADIO_BUTTON
@ TDF_ALLOW_DIALOG_CANCELLATION
@ TDF_USE_COMMAND_LINKS_NO_ICON
@ TDF_SHOW_MARQUEE_PROGRESS_BAR
@ TDF_VERIFICATION_FLAG_CHECKED
@ TDM_SET_PROGRESS_BAR_RANGE
@ TDM_ENABLE_RADIO_BUTTON
@ TDM_SET_PROGRESS_BAR_POS
@ TDM_SET_PROGRESS_BAR_STATE
@ TDN_VERIFICATION_CLICKED
@ TDN_RADIO_BUTTON_CLICKED
PCWSTR pszVerificationText
const struct message_info * send
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)