static void init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; RECT rect; BOOL ret; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (pInitCommonControlsEx) { INITCOMMONCONTROLSEX iccex; iccex.dwSize = sizeof(iccex); iccex.dwICC = ICC_PROGRESS_CLASS; pInitCommonControlsEx(&iccex); } else InitCommonControls(); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = progressTestClass; wc.lpfnWndProc = progress_test_wnd_proc; RegisterClassA(&wc); SetRect(&rect, 0, 0, 400, 20); ret = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); ok(ret, "got %d\n", ret); hProgressParentWnd = CreateWindowExA(0, progressTestClass, "Progress Bar Test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0); ok(hProgressParentWnd != NULL, "failed to create parent wnd\n"); GetClientRect(hProgressParentWnd, &rect); hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE, 0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0); ok(hProgressWnd != NULL, "failed to create parent wnd\n"); progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc); ShowWindow(hProgressParentWnd, SW_SHOWNORMAL); ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n"); flush_events(); update_window(hProgressParentWnd); }
static int init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); INITCOMMONCONTROLSEX iccex; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (!pInitCommonControlsEx) { win_skip("InitCommonControlsEx() is missing.\n"); return 0; } iccex.dwSize = sizeof(iccex); /* W2K and below need ICC_INTERNET_CLASSES for the IP Address Control */ iccex.dwICC = ICC_INTERNET_CLASSES; pInitCommonControlsEx(&iccex); return 1; }
static BOOL init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; INITCOMMONCONTROLSEX iccex; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (!pInitCommonControlsEx) { win_skip("InitCommonControlsEx() is missing. Skipping the tests\n"); return FALSE; } iccex.dwSize = sizeof(iccex); iccex.dwICC = ICC_USEREX_CLASSES; pInitCommonControlsEx(&iccex); pSetWindowSubclass = (void*)GetProcAddress(hComctl32, (LPSTR)410); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = ComboExTestClass; wc.lpfnWndProc = ComboExTestWndProc; RegisterClassA(&wc); hComboExParentWnd = CreateWindowExA(0, ComboExTestClass, "ComboEx test", WS_OVERLAPPEDWINDOW|WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleA(NULL), 0); ok(hComboExParentWnd != NULL, "failed to create parent window\n"); hMainHinst = GetModuleHandleA(NULL); return hComboExParentWnd != NULL; }