* strangeness, especially since most are in situations that would not
* normally be met.
*/
+#undef WINVER
+#define WINVER 0x0600 /* For NONCLIENTMETRICS with padding */
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
-#undef WINVER
-#define WINVER 0x0600 /* For NONCLIENTMETRICS with padding */
-
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
/* Create the control */
sprintf (ctrlname, "ctrl%4.4ld", p->id);
- hwnd[p->id] = CreateWindowEx (p->exstyle, TEXT(p->parent ? "static" : "GetNextDlgItemWindowClass"), TEXT(ctrlname), p->style, 10, 10, 10, 10, hwnd[p->parent], p->parent ? (HMENU) (2000 + p->id) : 0, hinst, 0);
+ hwnd[p->id] = CreateWindowExA(p->exstyle, p->parent ? "static" : "GetNextDlgItemWindowClass", ctrlname, p->style, 10, 10, 10, 10, hwnd[p->parent], p->parent ? (HMENU) (2000 + p->id) : 0, hinst, 0);
if (!hwnd[p->id])
{
trace ("Failed to create control %ld\n", p->id);
*/
if (p->parent)
{
- style = GetWindowLong (hwnd[p->id], GWL_STYLE);
- exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE);
+ style = GetWindowLongA(hwnd[p->id], GWL_STYLE);
+ exstyle = GetWindowLongA(hwnd[p->id], GWL_EXSTYLE);
if (style != p->style || exstyle != p->exstyle)
{
trace ("Style mismatch at %ld: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle);
/*
* OnMainWindowCreate
*/
-static BOOL OnMainWindowCreate (HWND hwnd, LPCREATESTRUCT lpcs)
+static BOOL OnMainWindowCreate(HWND hwnd, LPCREATESTRUCTA lpcs)
{
- g_hwndButton1 = CreateWindow (TEXT("button"), TEXT("Button &1"),
+ g_hwndButton1 = CreateWindowA("button", "Button &1",
WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON | BS_TEXT,
10, 10, 80, 80, hwnd, (HMENU)100, g_hinst, 0);
if (!g_hwndButton1) return FALSE;
- g_hwndButton2 = CreateWindow (TEXT("button"), TEXT("Button &2"),
+ g_hwndButton2 = CreateWindowA("button", "Button &2",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_TEXT,
110, 10, 80, 80, hwnd, (HMENU)200, g_hinst, 0);
if (!g_hwndButton2) return FALSE;
- g_hwndButtonCancel = CreateWindow (TEXT("button"), TEXT("Cancel"),
+ g_hwndButtonCancel = CreateWindowA("button", "Cancel",
WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_TEXT,
210, 10, 80, 80, hwnd, (HMENU)IDCANCEL, g_hinst, 0);
if (!g_hwndButtonCancel) return FALSE;
* OnTestDlgCreate
*/
-static BOOL OnTestDlgCreate (HWND hwnd, LPCREATESTRUCT lpcs)
+static BOOL OnTestDlgCreate (HWND hwnd, LPCREATESTRUCTA lpcs)
{
- g_hwndTestDlgEdit = CreateWindowEx ( WS_EX_LEFT | WS_EX_LTRREADING |
+ g_hwndTestDlgEdit = CreateWindowExA( WS_EX_LEFT | WS_EX_LTRREADING |
WS_EX_RIGHTSCROLLBAR | WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE,
- TEXT("Edit"), TEXT("Edit"),
+ "Edit", "Edit",
WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL,
16,33,184,24, hwnd, (HMENU)101, g_hinst, 0);
if (!g_hwndTestDlgEdit) return FALSE;
- g_hwndTestDlgBut1 = CreateWindowEx ( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
+ g_hwndTestDlgBut1 = CreateWindowExA( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
| WS_EX_NOPARENTNOTIFY,
- TEXT("button"), TEXT("Button &1"),
+ "button", "Button &1",
WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_TEXT,
204,33,30,24, hwnd, (HMENU)201, g_hinst, 0);
if (!g_hwndTestDlgBut1) return FALSE;
- g_hwndTestDlgBut2 = CreateWindowEx ( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
- | WS_EX_NOPARENTNOTIFY, TEXT("button"),
- TEXT("Button &2"),
+ g_hwndTestDlgBut2 = CreateWindowExA( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
+ | WS_EX_NOPARENTNOTIFY, "button",
+ "Button &2",
WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_TEXT,
90,102,80,24, hwnd, (HMENU)IDCANCEL, g_hinst, 0);
if (!g_hwndTestDlgBut2) return FALSE;
DWORD dw;
HWND hwndOk;
- dw = SendMessage(hwnd, DM_GETDEFID, 0, 0);
+ dw = SendMessageA(hwnd, DM_GETDEFID, 0, 0);
assert(DC_HASDEFID == HIWORD(dw));
hwndOk = GetDlgItem(hwnd, LOWORD(dw));
assert(hwndOk);
EnableWindow(hwndOk, FALSE);
- PostMessage(hwnd, WM_KEYDOWN, VK_RETURN, 0);
- PostMessage(hwnd, WM_COMMAND, IDCANCEL, 0);
+ PostMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0);
+ PostMessageA(hwnd, WM_COMMAND, IDCANCEL, 0);
break;
}
case WM_COMMAND:
cls.cbWndExtra = 0;
cls.hInstance = g_hinst;
cls.hIcon = NULL;
- cls.hCursor = LoadCursorA (NULL, IDC_ARROW);
+ cls.hCursor = LoadCursorA (NULL, (LPCSTR)IDC_ARROW);
cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
cls.lpszMenuName = NULL;
cls.lpszClassName = "GetNextDlgItemWindowClass";
MSG msg;
DWORD dwVal;
- g_hwndTestDlg = CreateWindowEx( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
+ g_hwndTestDlg = CreateWindowExA( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR
| WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT | WS_EX_APPWINDOW,
"WM_NEXTDLGCTLWndClass",
"WM_NEXTDLGCTL Message test window",
*/
if ( IDCANCEL == (LOWORD(dwVal)) )
{
- ok ( ((GetWindowLong( g_hwndTestDlgBut1, GWL_STYLE)) & BS_DEFPUSHBUTTON),
+ ok ( ((GetWindowLongA( g_hwndTestDlgBut1, GWL_STYLE)) & BS_DEFPUSHBUTTON),
"Button1 style not set to BS_DEFPUSHBUTTON\n" );
- ok ( !((GetWindowLong( g_hwndTestDlgBut2, GWL_STYLE)) & BS_DEFPUSHBUTTON),
+ ok ( !((GetWindowLongA( g_hwndTestDlgBut2, GWL_STYLE)) & BS_DEFPUSHBUTTON),
"Button2's style not changed to BS_PUSHBUTTON\n" );
}
*/
if ( IDCANCEL == (LOWORD(dwVal)) )
{
- ok ( ((GetWindowLong( g_hwndTestDlgBut2, GWL_STYLE)) & BS_DEFPUSHBUTTON),
+ ok ( ((GetWindowLongA( g_hwndTestDlgBut2, GWL_STYLE)) & BS_DEFPUSHBUTTON),
"Button2 style not set to BS_DEFPUSHBUTTON\n" );
- ok ( !((GetWindowLong( g_hwndTestDlgBut1, GWL_STYLE)) & BS_DEFPUSHBUTTON),
+ ok ( !((GetWindowLongA( g_hwndTestDlgBut1, GWL_STYLE)) & BS_DEFPUSHBUTTON),
"Button1's style not changed to BS_PUSHBUTTON\n" );
}
g_bReceivedCommand = FALSE;
FormEnterMsg (&msg, child3);
- ok(IsDialogMessage (g_hwndTestDlg, &msg), "Did not handle the ENTER\n");
+ ok(IsDialogMessageA(g_hwndTestDlg, &msg), "Did not handle the ENTER\n");
ok(g_bReceivedCommand, "Did not trigger the default Button action\n");
DestroyWindow(child3);
{
MSG msg;
- g_hwndMain = CreateWindow ("IsDialogMessageWindowClass", "IsDialogMessageWindowClass",
+ g_hwndMain = CreateWindowA("IsDialogMessageWindowClass", "IsDialogMessageWindowClass",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, g_hinst, 0);
* button.
*/
FormTabMsg (&msg, g_hwndMain);
- ok (IsDialogMessage (g_hwndMain, &msg), "Did not handle first TAB\n");
+ ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle first TAB\n");
ok ((GetFocus() == g_hwndButton1), "Focus did not move to first button\n");
FormTabMsg (&msg, g_hwndButton1);
- ok (IsDialogMessage (g_hwndMain, &msg), "Did not handle second TAB\n");
+ ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle second TAB\n");
ok ((GetFocus() == g_hwndButtonCancel),
"Focus did not move to cancel button\n");
FormEnterMsg (&msg, g_hwndButtonCancel);
- ok (IsDialogMessage (g_hwndMain, &msg), "Did not handle the ENTER\n");
+ ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
ok (g_terminated, "ENTER did not terminate\n");
}
g_hwndButton1 = GetDlgItem(hDlg,200);
g_hwndButton2 = GetDlgItem(hDlg,201);
g_hwndButtonCancel = GetDlgItem(hDlg,IDCANCEL);
- g_styleInitialFocusT1 = GetWindowLong(g_hwndInitialFocusGroupBox, GWL_STYLE);
+ g_styleInitialFocusT1 = GetWindowLongA(g_hwndInitialFocusGroupBox, GWL_STYLE);
/* Initially check the second radio button */
- SendMessage(g_hwndButton1, BM_SETCHECK, BST_UNCHECKED, 0);
- SendMessage(g_hwndButton2, BM_SETCHECK, BST_CHECKED , 0);
+ SendMessageA(g_hwndButton1, BM_SETCHECK, BST_UNCHECKED, 0);
+ SendMessageA(g_hwndButton2, BM_SETCHECK, BST_CHECKED , 0);
/* Continue testing after dialog initialization */
- PostMessage(hDlg, WM_USER, 0, 0);
+ PostMessageA(hDlg, WM_USER, 0, 0);
return g_bInitialFocusInitDlgResult;
case WM_COMMAND:
return FALSE;
case WM_USER:
- g_styleInitialFocusT2 = GetWindowLong(hDlg, GWL_STYLE);
+ g_styleInitialFocusT2 = GetWindowLongA(hDlg, GWL_STYLE);
g_hwndInitialFocusT1 = GetFocus();
SetFocus(hDlg);
g_hwndInitialFocusT2 = GetFocus();
- PostMessage(hDlg, WM_COMMAND, IDCANCEL, 0);
+ PostMessageA(hDlg, WM_COMMAND, IDCANCEL, 0);
return TRUE;
}
HWND hTextbox;
DWORD selectionStart = 0xdead, selectionEnd = 0xbeef;
- hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG", RT_DIALOG);
+ hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG", (LPCSTR)RT_DIALOG);
hTemplate = LoadResource(g_hinst, hResource);
pTemplate = LockResource(hTemplate);
/* Also make sure that WM_SETFOCUS selects the textbox's text */
hTextbox = GetDlgItem(hDlg, 200);
- SendMessage(hTextbox, WM_SETTEXT, 0, (LPARAM)"Hello world");
+ SendMessageA(hTextbox, WM_SETTEXT, 0, (LPARAM)"Hello world");
- SendMessage(hDlg, WM_SETFOCUS, 0, 0);
- SendMessage(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
+ SendMessageA(hDlg, WM_SETFOCUS, 0, 0);
+ SendMessageA(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
ok(selectionStart == 0 && selectionEnd == 11, "Text selection after WM_SETFOCUS is [%i, %i) expected [0, 11)\n", selectionStart, selectionEnd);
/* but WM_ACTIVATE does not */
- SendMessage(hTextbox, EM_SETSEL, 0, 0);
- SendMessage(hDlg, WM_ACTIVATE, WA_ACTIVE, 0);
- SendMessage(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
+ SendMessageA(hTextbox, EM_SETSEL, 0, 0);
+ SendMessageA(hDlg, WM_ACTIVATE, WA_ACTIVE, 0);
+ SendMessageA(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
ok(selectionStart == 0 && selectionEnd == 0, "Text selection after WM_ACTIVATE is [%i, %i) expected [0, 0)\n", selectionStart, selectionEnd);
DestroyWindow(hDlg);
DLGTEMPLATE* pTemplate;
HWND hLabel;
- hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG_2", RT_DIALOG);
+ hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG_2", (LPCSTR)RT_DIALOG);
hTemplate = LoadResource(g_hinst, hResource);
pTemplate = LockResource(hTemplate);
hLabel = GetDlgItem(hDlg, 200);
SetFocus(NULL);
- SendMessage(hDlg, WM_ACTIVATE, WA_ACTIVE, 0);
+ SendMessageA(hDlg, WM_ACTIVATE, WA_ACTIVE, 0);
ok(GetFocus() == NULL, "Focus set on WM_ACTIVATE, focus=%p dialog=%p label=%p\n", GetFocus(), hDlg, hLabel);
SetFocus(NULL);
- SendMessage(hDlg, WM_SETFOCUS, 0, 0);
+ SendMessageA(hDlg, WM_SETFOCUS, 0, 0);
ok(GetFocus() == hLabel, "Focus not set to label on WM_SETFOCUS, focus=%p dialog=%p label=%p\n", GetFocus(), hDlg, hLabel);
DestroyWindow(hDlg);
ok(child2 != NULL, "failed to create second child\n");
/* give child2 an ID */
- SetWindowLong(child2, GWLP_ID, 100);
+ SetWindowLongA(child2, GWLP_ID, 100);
hwnd2 = GetDlgItem(hwnd, 100);
ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2);
/* make the ID of child2 public with a WS_EX_CONTROLPARENT parent */
- SetWindowLong(child1, GWL_EXSTYLE, WS_EX_CONTROLPARENT);
+ SetWindowLongA(child1, GWL_EXSTYLE, WS_EX_CONTROLPARENT);
hwnd2 = GetDlgItem(hwnd, 100);
ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2);
switch (uiMsg)
{
case WM_INITDIALOG:
- PostMessage(hDlg, WM_CLOSE, 0, 0);
+ PostMessageA(hDlg, WM_CLOSE, 0, 0);
return TRUE;
case WM_CLOSE:
DestroyWindow(hDlg);
"Expected wParam to be the handle to the first tabstop control (%p), got %p\n",
expected, (HWND)wParam);
- EndDialog(hDlg, LOWORD(SendMessage(hDlg, DM_GETDEFID, 0, 0)));
+ EndDialog(hDlg, LOWORD(SendMessageA(hDlg, DM_GETDEFID, 0, 0)));
return TRUE;
}
return FALSE;
switch (uiMsg)
{
case WM_INITDIALOG:
- EndDialog(hDlg, LOWORD(SendMessage(hDlg, DM_GETDEFID, 0, 0)));
+ EndDialog(hDlg, LOWORD(SendMessageA(hDlg, DM_GETDEFID, 0, 0)));
return TRUE;
}
return FALSE;
MSG msg = {hDlg, WM_KEYDOWN, VK_RETURN, 0x011c0001};
received_idok = -1;
- IsDialogMessage(hDlg, &msg);
+ IsDialogMessageA(hDlg, &msg);
ok(received_idok == 0xdead, "WM_COMMAND/0xdead not received\n");
received_idok = -2;
- IsDialogMessage(hDlg, &msg);
+ IsDialogMessageA(hDlg, &msg);
ok(received_idok == IDOK, "WM_COMMAND/IDOK not received\n");
EndDialog(hDlg, 0);
{
HWND hwnd = GetDlgItem(hDlg, 0xdead);
ok(!hwnd, "dialog item with ID 0xdead should not exist\n");
- SetWindowLong(hDlg, DWLP_MSGRESULT, MAKELRESULT(0xdead, DC_HASDEFID));
+ SetWindowLongA(hDlg, DWLP_MSGRESULT, MAKELRESULT(0xdead, DC_HASDEFID));
return TRUE;
}
return FALSE;
case WM_INITDIALOG:
control = GetDlgItem(hdlg, 7);
ok(control != 0, "dialog control with id 7 not found\n");
- style = GetWindowLong(control, GWL_STYLE);
+ style = GetWindowLongA(control, GWL_STYLE);
ok(style == (WS_CHILD|WS_VISIBLE), "expected WS_CHILD|WS_VISIBLE, got %#x\n", style);
- exstyle = GetWindowLong(control, GWL_EXSTYLE);
+ exstyle = GetWindowLongA(control, GWL_EXSTYLE);
ok(exstyle == (WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE), "expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE, got %#x\n", exstyle);
buf[0] = 0;
- GetWindowText(control, buf, sizeof(buf));
- ok(lstrcmp(buf, "bump7") == 0, "expected bump7, got %s\n", buf);
+ GetWindowTextA(control, buf, sizeof(buf));
+ ok(strcmp(buf, "bump7") == 0, "expected bump7, got %s\n", buf);
control = GetDlgItem(hdlg, 8);
ok(control != 0, "dialog control with id 8 not found\n");
- style = GetWindowLong(control, GWL_STYLE);
+ style = GetWindowLongA(control, GWL_STYLE);
ok(style == (WS_CHILD|WS_VISIBLE), "expected WS_CHILD|WS_VISIBLE, got %#x\n", style);
- exstyle = GetWindowLong(control, GWL_EXSTYLE);
+ exstyle = GetWindowLongA(control, GWL_EXSTYLE);
ok(exstyle == (WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT), "expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT, got %#x\n", exstyle);
buf[0] = 0;
- GetWindowText(control, buf, sizeof(buf));
- ok(lstrcmp(buf, "bump8") == 0, "expected bump8, got %s\n", buf);
+ GetWindowTextA(control, buf, sizeof(buf));
+ ok(strcmp(buf, "bump8") == 0, "expected bump8, got %s\n", buf);
EndDialog(hdlg, -7);
return TRUE;
INT_PTR ret;
HWND hwnd_invalid = (HWND)0x4444;
- ret = DialogBoxParamA(GetModuleHandle(0), "TEST_DLG_CHILD_POPUP", 0, TestControlStyleDlgProc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_DLG_CHILD_POPUP", 0, TestControlStyleDlgProc, 0);
ok(ret == -7, "expected -7, got %ld\n", ret);
SetLastError(0xdeadbeef);
- ret = DialogBoxParamA(GetModuleHandle(NULL), "IDD_DIALOG" , hwnd_invalid, 0 , 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "IDD_DIALOG" , hwnd_invalid, 0 , 0);
ok(0 == ret || broken(ret == -1), "DialogBoxParamA returned %ld, expected 0\n", ret);
ok(ERROR_INVALID_WINDOW_HANDLE == GetLastError() ||
broken(GetLastError() == 0xdeadbeef),
/* Test a dialog which destroys itself on WM_INITDIALOG. */
SetLastError(0xdeadbeef);
- ret = DialogBoxParamA(GetModuleHandle(NULL), "IDD_DIALOG", 0, DestroyDlgWinProc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "IDD_DIALOG", 0, DestroyDlgWinProc, 0);
ok(-1 == ret, "DialogBoxParamA returned %ld, expected -1\n", ret);
ok(ERROR_INVALID_WINDOW_HANDLE == GetLastError() ||
GetLastError() == ERROR_SUCCESS ||
"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n",GetLastError());
/* Test a dialog which destroys itself on WM_CLOSE. */
- ret = DialogBoxParamA(GetModuleHandle(NULL), "IDD_DIALOG", 0, DestroyOnCloseDlgWinProc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "IDD_DIALOG", 0, DestroyOnCloseDlgWinProc, 0);
ok(0 == ret, "DialogBoxParamA returned %ld, expected 0\n", ret);
SetLastError(0xdeadbeef);
- ret = DialogBoxParamA(GetModuleHandle(NULL), "RESOURCE_INVALID" , 0, 0, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "RESOURCE_INVALID" , 0, 0, 0);
ok(-1 == ret, "DialogBoxParamA returned %ld, expected -1\n", ret);
ok(ERROR_RESOURCE_NAME_NOT_FOUND == GetLastError() ||
broken(GetLastError() == 0xdeadbeef),
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
- ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestInitDialogHandleProc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestInitDialogHandleProc, 0);
ok(ret == IDOK, "Expected IDOK\n");
- ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
ok(ret == IDOK, "Expected IDOK\n");
- DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestReturnKeyDlgProc, 0);
+ DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestReturnKeyDlgProc, 0);
}
static void test_DisabledDialogTest(void)
{
g_terminated = FALSE;
- DialogBoxParam(g_hinst, "IDD_DIALOG", NULL, disabled_test_proc, 0);
+ DialogBoxParamA(g_hinst, "IDD_DIALOG", NULL, disabled_test_proc, 0);
ok(FALSE == g_terminated, "dialog with disabled ok button has been terminated\n");
}
* we want, because passing such a template to CreateDialogIndirectParamA would crash
* anyway.
*/
- hDlg = CreateDialogIndirectParamW(g_hinst, (LPCDLGTEMPLATE)dlgTemplate, NULL, messageBoxFontDlgWinProc, 0);
+ hDlg = CreateDialogIndirectParamW(g_hinst, (LPCDLGTEMPLATEW)dlgTemplate, NULL, messageBoxFontDlgWinProc, 0);
if (!hDlg)
{
win_skip("dialog wasn't created\n");
HWND foundHwnd;
/* create the dialog */
- hResource = FindResourceA(g_hinst, "MULTI_EDIT_DIALOG", RT_DIALOG);
+ hResource = FindResourceA(g_hinst, "MULTI_EDIT_DIALOG", (LPCSTR)RT_DIALOG);
hTemplate = LoadResource(g_hinst, hResource);
pTemplate = LockResource(hTemplate);
hDlg = CreateDialogIndirectParamA(g_hinst, pTemplate, NULL, messageBoxFontDlgWinProc, 0);
ok (hDlg != 0, "Failed to create test dialog.\n");
- foundId = GetWindowLongPtr(GetFocus(), GWLP_ID);
+ foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
ok (foundId == 1000, "First edit box should have gained focus on dialog creation. Expected: %d, Found: %ld\n", 1000, foundId);
/* de- then reactivate the dialog */
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
- foundId = GetWindowLongPtr(GetFocus(), GWLP_ID);
+ foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
ok (foundId == 1000, "First edit box should have regained focus after dialog reactivation. Expected: %d, Found: %ld\n", 1000, foundId);
/* select the next tabbable item */
SetFocus(GetNextDlgTabItem(hDlg, GetFocus(), FALSE));
- foundId = GetWindowLongPtr(GetFocus(), GWLP_ID);
+ foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
ok (foundId == 1001, "Second edit box should have gained focus. Expected: %d, Found: %ld\n", 1001, foundId);
/* de- then reactivate the dialog */
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
- foundId = GetWindowLongPtr(GetFocus(), GWLP_ID);
+ foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
ok (foundId == 1001, "Second edit box should have gained focus after dialog reactivation. Expected: %d, Found: %ld\n", 1001, foundId);
/* disable the 2nd box */
ok (foundHwnd == NULL, "Second edit box should have lost focus after being disabled. Expected: %p, Found: %p\n", NULL, foundHwnd);
/* de- then reactivate the dialog */
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
- SendMessage(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), 0);
+ SendMessageA(hDlg, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
foundHwnd = GetFocus();
ok (foundHwnd == NULL, "No controls should have gained focus after dialog reactivation. Expected: %p, Found: %p\n", NULL, foundHwnd);
switch (msg)
{
case WM_INITDIALOG:
- visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
ok(!visible, "Dialog should not be visible.\n");
SetTimer(wnd, 1, 100, NULL);
Sleep(200);
case WM_TIMER:
if (wparam != 1) return FALSE;
- visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
if (!count++)
{
ok(!visible, "Dialog should not be visible.\n");
- PostMessage(wnd, WM_USER, 0, 0);
+ PostMessageA(wnd, WM_USER, 0, 0);
}
else
{
ok(visible, "Dialog should be visible.\n");
- PostMessage(wnd, WM_COMMAND, IDCANCEL, 0);
+ PostMessageA(wnd, WM_COMMAND, IDCANCEL, 0);
}
return TRUE;
case WM_USER:
- visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
ok(visible, "Dialog should be visible.\n");
return TRUE;
{
/* test cases related to bug 12319 */
case 0:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 1:
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 2:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
/* test cases for pressing enter */
case 3:
num_ok_commands = 0;
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
default:
{
/* from bug 11841 */
case 0:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
break;
case 1:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
break;
case 2:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
/* more test cases for WM_CHAR */
case 3:
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 4:
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 5:
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
/* more test cases for WM_KEYDOWN + WM_CHAR */
case 6:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 7:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
case 8:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
/* multiple tab tests */
case 9:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 2);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 2);
break;
case 10:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 2);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 2);
break;
default:
switch (lparam)
{
case 0:
- len = SendMessage(hedit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hedit, WM_GETTEXTLENGTH, 0, 0);
if (len == 0)
EndDialog(hdlg, 444);
else
break;
case 1:
- len = SendMessage(hedit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hedit, WM_GETTEXTLENGTH, 0, 0);
if ((hfocus == hok) && len == 0)
EndDialog(hdlg, 444);
else
{
/* test cases for WM_KEYDOWN */
case 0:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
break;
case 1:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
break;
case 2:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
/* test cases for WM_CHAR */
case 3:
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 4:
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 5:
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
/* test cases for WM_KEYDOWN + WM_CHAR */
case 6:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
break;
case 7:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
break;
case 8:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
default:
HWND hok = GetDlgItem(hdlg, IDOK);
HWND hedit = GetDlgItem(hdlg, 1000);
HWND hfocus = GetFocus();
- int len = SendMessage(hedit, WM_GETTEXTLENGTH, 0, 0);
+ int len = SendMessageA(hedit, WM_GETTEXTLENGTH, 0, 0);
if (wparam != 0xdeadbeef)
break;
{
/* test cases for WM_KEYDOWN */
case 0:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
break;
case 1:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 2:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
/* test cases for WM_CHAR */
case 3:
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 4:
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 2);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 2);
break;
case 5:
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
/* test cases for WM_KEYDOWN + WM_CHAR */
case 6:
- PostMessage(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
- PostMessage(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 0);
+ PostMessageA(hedit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ PostMessageA(hedit, WM_CHAR, VK_ESCAPE, 0x10001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 0);
break;
case 7:
- PostMessage(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
- PostMessage(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 2);
+ PostMessageA(hedit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ PostMessageA(hedit, WM_CHAR, VK_RETURN, 0x1c0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 2);
break;
case 8:
- PostMessage(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
- PostMessage(hedit, WM_CHAR, VK_TAB, 0xf0001);
- PostMessage(hdlg, WM_USER, 0xdeadbeef, 1);
+ PostMessageA(hedit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ PostMessageA(hedit, WM_CHAR, VK_TAB, 0xf0001);
+ PostMessageA(hdlg, WM_USER, 0xdeadbeef, 1);
break;
default:
HWND hok = GetDlgItem(hdlg, IDOK);
HWND hedit = GetDlgItem(hdlg, 1000);
HWND hfocus = GetFocus();
- int len = SendMessage(hedit, WM_GETTEXTLENGTH, 0, 0);
+ int len = SendMessageA(hedit, WM_GETTEXTLENGTH, 0, 0);
if (wparam != 0xdeadbeef)
break;
{
HWND handle;
- handle = CreateWindowEx(exstyle,
+ handle = CreateWindowExA(exstyle,
"EDIT",
"Test Text",
style,
b = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
ok(b, "AdjustWindowRect failed\n");
- parentWnd = CreateWindowEx(0,
+ parentWnd = CreateWindowExA(0,
szEditTextPositionClass,
"Edit Test",
WS_OVERLAPPEDWINDOW,
ok (parentWnd != NULL, "CreateWindow EDIT Test failed\n");
assert(parentWnd);
- editWnd = CreateWindowEx(exstyle,
+ editWnd = CreateWindowExA(exstyle,
"EDIT",
"Test Text",
WS_CHILD | style,
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
}
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
}
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
}
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
}
POINT cpos;
/* Create main and edit windows. */
- hwndMain = CreateWindow(szEditTest2Class, "ET2", WS_OVERLAPPEDWINDOW,
+ hwndMain = CreateWindowA(szEditTest2Class, "ET2", WS_OVERLAPPEDWINDOW,
0, 0, 200, 200, NULL, NULL, hinst, NULL);
assert(hwndMain);
if (winetest_interactive)
ShowWindow (hwndMain, SW_SHOW);
- hwndET2 = CreateWindow("EDIT", NULL,
+ hwndET2 = CreateWindowA("EDIT", NULL,
WS_CHILD|WS_BORDER|ES_LEFT|ES_AUTOHSCROLL,
0, 0, w, h, /* important this not be 0 size. */
hwndMain, (HMENU) ID_EDITTEST2, hinst, NULL);
trace("EDIT: SETTEXT atomicity\n");
/* Send messages to "type" in the word 'foo'. */
- r = SendMessage(hwndET2, WM_CHAR, 'f', 1);
+ r = SendMessageA(hwndET2, WM_CHAR, 'f', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- r = SendMessage(hwndET2, WM_CHAR, 'o', 1);
+ r = SendMessageA(hwndET2, WM_CHAR, 'o', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- r = SendMessage(hwndET2, WM_CHAR, 'o', 1);
+ r = SendMessageA(hwndET2, WM_CHAR, 'o', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* 'foo' should have been changed to 'bar' by the UPDATE handler. */
- GetWindowText(hwndET2, szLocalString, MAXLEN);
- ok(lstrcmp(szLocalString, "bar")==0,
+ GetWindowTextA(hwndET2, szLocalString, MAXLEN);
+ ok(strcmp(szLocalString, "bar")==0,
"Wrong contents of edit: %s\n", szLocalString);
/* try setting the caret before it's visible */
static void ET2_check_change(void) {
char szLocalString[MAXLEN];
/* This EN_UPDATE handler changes any 'foo' to 'bar'. */
- GetWindowText(hwndET2, szLocalString, MAXLEN);
- if (lstrcmp(szLocalString, "foo")==0) {
- lstrcpy(szLocalString, "bar");
- SendMessage(hwndET2, WM_SETTEXT, 0, (LPARAM) szLocalString);
+ GetWindowTextA(hwndET2, szLocalString, MAXLEN);
+ if (strcmp(szLocalString, "foo")==0) {
+ strcpy(szLocalString, "bar");
+ SendMessageA(hwndET2, WM_SETTEXT, 0, (LPARAM) szLocalString);
}
/* always leave the cursor at the end. */
- SendMessage(hwndET2, EM_SETSEL, MAXLEN - 1, MAXLEN - 1);
+ SendMessageA(hwndET2, EM_SETSEL, MAXLEN - 1, MAXLEN - 1);
}
static void ET2_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
ET2_OnCommand(hwnd, LOWORD(wParam), (HWND)lParam, HIWORD(wParam));
break;
}
- return DefWindowProc(hwnd, iMsg, wParam, lParam);
+ return DefWindowProcA(hwnd, iMsg, wParam, lParam);
}
static void zero_notify(void)
len = SendMessageA(hWnd, EM_GETSEL, 0, 0);
ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len));
- SendMessage(hParent, WM_SETFOCUS, 0, (LPARAM)hWnd);
+ SendMessageA(hParent, WM_SETFOCUS, 0, (LPARAM)hWnd);
len = SendMessageA(hWnd, EM_GETSEL, 0, 0);
ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len));
trace("EDIT: Test EM_CHARFROMPOS and EM_POSFROMCHAR\n");
hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(0 == ret, "expected 0 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(ES_RIGHT | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(0 == ret, "expected 0 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(ES_CENTER | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(0 == ret, "expected 0 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2 +1;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(ES_MULTILINE | ES_RIGHT | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2 +1;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(ES_MULTILINE | ES_CENTER | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- SendMessage(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
- lo = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 0, 0));
- hi = LOWORD(SendMessage(hwEdit, EM_POSFROMCHAR, 1, 0));
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM) "aa");
+ lo = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 0, 0));
+ hi = LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 1, 0));
mid = lo + (hi - lo) / 2 +1;
for (i = lo; i < mid; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
}
for (i = mid; i <= hi; i++) {
- ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
+ ret = LOWORD(SendMessageA(hwEdit, EM_CHARFROMPOS, 0, i));
ok(1 == ret, "expected 1 got %d\n", ret);
}
- ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
+ ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
}
RECT rc;
/* first show that a non-child won't do for this test */
- hWnd = CreateWindowEx(0,
+ hWnd = CreateWindowExA(0,
"EDIT",
str,
0,
rc.right - rc.left);
DestroyWindow(hWnd);
/* so create a parent, and give it edit controls children to test with */
- parentWnd = CreateWindowEx(0,
+ parentWnd = CreateWindowExA(0,
szEditTextPositionClass,
"Edit Test", WS_VISIBLE |
WS_OVERLAPPEDWINDOW,
assert(parentWnd);
ShowWindow( parentWnd, SW_SHOW);
/* single line */
- hWnd = CreateWindowEx(0,
+ hWnd = CreateWindowExA(0,
"EDIT",
str, WS_VISIBLE | WS_BORDER |
WS_CHILD,
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
DestroyWindow(hWnd);
/* multi line */
- hWnd = CreateWindowEx(0,
+ hWnd = CreateWindowExA(0,
"EDIT",
str,
WS_CHILD | ES_MULTILINE,
LONG ret;
HWND hWnd;
- hWnd = CreateWindowEx(0,
+ hWnd = CreateWindowExA(0,
"EDIT",
"Test",
0,
ret = SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)str);
ok(ret == TRUE, "Expected %d, got %d\n", TRUE, ret);
ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
- ok(ret == lstrlen(str), "Expected %s, got len %d\n", str, ret);
- ok(!lstrcmp(buf, str), "Expected %s, got %s\n", str, buf);
+ ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret);
+ ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
buf[0] = 0;
ret = SendMessageA(hWnd, WM_DESTROY, 0, 0);
ok(ret == 0, "Expected 0, got %d\n", ret);
ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
- ok(ret == lstrlen(str), "Expected %s, got len %d\n", str, ret);
- ok(!lstrcmp(buf, str), "Expected %s, got %s\n", str, buf);
+ ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret);
+ ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
buf[0] = 0;
ret = SendMessageA(hWnd, WM_NCDESTROY, 0, 0);
ok(ret == 0, "Expected 0, got %d\n", ret);
ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
ok(ret == 0, "Expected 0, got len %d\n", ret);
- ok(!lstrcmp(buf, ""), "Expected empty string, got %s\n", buf);
+ ok(!strcmp(buf, ""), "Expected empty string, got %s\n", buf);
DestroyWindow(hWnd);
}
/* Test default limit for single-line control */
trace("EDIT: buffer limit for single-line\n");
hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- r = SendMessage(hwEdit, EM_GETLIMITTEXT, 0, 0);
+ r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r);
- SendMessage(hwEdit, EM_SETLIMITTEXT, 0, 0);
- r = SendMessage(hwEdit, EM_GETLIMITTEXT, 0, 0);
+ SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0);
+ r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
ok( r == 2147483646, "got limit %u (expected 2147483646)\n", r);
DestroyWindow(hwEdit);
/* Test default limit for multi-line control */
trace("EDIT: buffer limit for multi-line\n");
hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
- r = SendMessage(hwEdit, EM_GETLIMITTEXT, 0, 0);
+ r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r);
- SendMessage(hwEdit, EM_SETLIMITTEXT, 0, 0);
- r = SendMessage(hwEdit, EM_GETLIMITTEXT, 0, 0);
+ SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0);
+ r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
ok( r == 4294967295U, "got limit %u (expected 4294967295)\n", r);
DestroyWindow(hwEdit);
}
/* Check the return value when EM_SCROLL doesn't scroll
* anything. Should not return true unless any lines were actually
* scrolled. */
- hwEdit = CreateWindow(
+ hwEdit = CreateWindowA(
"EDIT",
single_line_str,
WS_VSCROLL | ES_MULTILINE,
assert(hwEdit);
- ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
+ ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
ok(!ret, "Returned %x, expected 0.\n", ret);
- ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEUP, 0);
+ ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEUP, 0);
ok(!ret, "Returned %x, expected 0.\n", ret);
- ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEUP, 0);
+ ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEUP, 0);
ok(!ret, "Returned %x, expected 0.\n", ret);
- ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEDOWN, 0);
+ ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEDOWN, 0);
ok(!ret, "Returned %x, expected 0.\n", ret);
DestroyWindow (hwEdit);
/* SB_PAGEDOWN while at the beginning of a buffer with few lines
should not cause EM_SCROLL to return a negative value of
scrolled lines that would put us "before" the beginning. */
- hwEdit = CreateWindow(
+ hwEdit = CreateWindowA(
"EDIT",
multiline_str,
WS_VSCROLL | ES_MULTILINE,
NULL, NULL, hinst, NULL);
assert(hwEdit);
- ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
+ ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
ok(!ret, "Returned %x, expected 0.\n", ret);
DestroyWindow (hwEdit);
DWORD old_margins, new_margins;
hwEdit = create_editcontrol(WS_BORDER | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
-
- old_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+
+ old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
old_right_margin = HIWORD(old_margins);
-
+
/* Check if setting the margins works */
-
- SendMessage(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN, MAKELONG(10, 0));
- new_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN, MAKELONG(10, 0));
+ new_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(new_margins) == 10, "Wrong left margin: %d\n", LOWORD(new_margins));
ok(HIWORD(new_margins) == old_right_margin, "Wrong right margin: %d\n", HIWORD(new_margins));
-
- SendMessage(hwEdit, EM_SETMARGINS, EC_RIGHTMARGIN, MAKELONG(0, 10));
- new_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_RIGHTMARGIN, MAKELONG(0, 10));
+ new_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(new_margins) == 10, "Wrong left margin: %d\n", LOWORD(new_margins));
ok(HIWORD(new_margins) == 10, "Wrong right margin: %d\n", HIWORD(new_margins));
-
-
+
/* The size of the rectangle must decrease if we increase the margin */
-
- SendMessage(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(5, 5));
- SendMessage(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
- SendMessage(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(15, 20));
- SendMessage(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(5, 5));
+ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(15, 20));
+ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
ok(new_rect.left == old_rect.left + 10, "The left border of the rectangle is wrong\n");
ok(new_rect.right == old_rect.right - 15, "The right border of the rectangle is wrong\n");
ok(new_rect.top == old_rect.top, "The top border of the rectangle must not change\n");
ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle must not change\n");
-
-
+
/* If we set the margin to same value as the current margin,
the rectangle must not change */
-
- SendMessage(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
+
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
old_rect.left = 1;
old_rect.right = 99;
old_rect.top = 1;
old_rect.bottom = 99;
- SendMessage(hwEdit, EM_SETRECT, 0, (LPARAM)&old_rect);
- SendMessage(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
- SendMessage(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
- SendMessage(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+ SendMessageA(hwEdit, EM_SETRECT, 0, (LPARAM)&old_rect);
+ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
+ SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
+ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
ok(new_rect.left == old_rect.left, "The left border of the rectangle has changed\n");
ok(new_rect.right == old_rect.right, "The right border of the rectangle has changed\n");
ok(new_rect.top == old_rect.top, "The top border of the rectangle has changed\n");
DestroyWindow (hwEdit);
}
-static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam)
+static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
{
return 0;
}
{
HWND hwEdit;
DWORD margins, font_margins;
- LOGFONT lf;
+ LOGFONTA lf;
HFONT hfont, hfont2;
HDC hdc = GetDC(0);
hfont2 = CreateFontIndirectA(&lf);
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- font_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ font_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(font_margins) != 0, "got %d\n", LOWORD(font_margins));
ok(HIWORD(font_margins) != 0, "got %d\n", HIWORD(font_margins));
SetWindowPos(hwEdit, NULL, 10, 10, 16, 100, SWP_NOZORDER | SWP_NOACTIVATE);
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 0 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 0 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 0 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */
"got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */
"got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1 || broken(LOWORD(margins) != 1 && LOWORD(margins) != LOWORD(font_margins)), /* win95 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1 || broken(HIWORD(margins) != 1 && HIWORD(margins) != HIWORD(font_margins)), /* win95 */
SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE);
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
- margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
+ margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) != LOWORD(font_margins) || broken(LOWORD(margins) == LOWORD(font_margins)), /* win98 */
"got %d\n", LOWORD(margins));
ok(HIWORD(margins) != HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, 0, 0);
-
+
DeleteObject(hfont2);
DeleteObject(hfont);
destroy_child_editcontrol(hwEdit);
RECT format_rect; \
int left_margin; \
set_client_height(hwEdit, set_height); \
- SendMessage(hwEdit, EM_GETRECT, 0, (LPARAM) &format_rect); \
- left_margin = LOWORD(SendMessage(hwEdit, EM_GETMARGINS, 0, 0)); \
+ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM) &format_rect); \
+ left_margin = LOWORD(SendMessageA(hwEdit, EM_GETMARGINS, 0, 0)); \
edit_pos_ok(test_top, format_rect.top, vertical position); \
edit_pos_ok((int)test_height, format_rect.bottom - format_rect.top, height); \
edit_pos_ok(test_left, format_rect.left - left_margin, left); \
HWND hwEdit;
HFONT font, oldFont;
HDC dc;
- TEXTMETRIC metrics;
+ TEXTMETRICA metrics;
INT b, bm, b2, b3;
BOOL xb, single_line = !(style & ES_MULTILINE);
b2 = 2 * b;
b3 = 3 * b;
bm = b2 - 1;
-
+
/* Get a stock font for which we can determine the metrics */
font = GetStockObject(SYSTEM_FONT);
ok (font != NULL, "GetStockObjcet SYSTEM_FONT failed\n");
dc = GetDC(NULL);
ok (dc != NULL, "GetDC() failed\n");
oldFont = SelectObject(dc, font);
- xb = GetTextMetrics(dc, &metrics);
+ xb = GetTextMetricsA(dc, &metrics);
ok (xb, "GetTextMetrics failed\n");
SelectObject(dc, oldFont);
ReleaseDC(NULL, dc);
-
+
/* Windows' edit control has some bugs in multi-line mode:
* - Sometimes the format rectangle doesn't get updated
* (see workaround in set_client_height())
* line, the format rectangle is still as high as a text line
* (higher than the client rectangle) and the caret is not shown
*/
-
+
/* Edit controls that are in a parent window */
-
+
hwEdit = create_child_editcontrol(style | WS_VISIBLE, 0);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 0);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 0);
destroy_child_editcontrol(hwEdit);
hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, 0);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, b);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , b);
destroy_child_editcontrol(hwEdit);
hwEdit = create_child_editcontrol(style | WS_VISIBLE, WS_EX_CLIENTEDGE);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1);
destroy_child_editcontrol(hwEdit);
hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, WS_EX_CLIENTEDGE);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1);
/* Edit controls that are popup windows */
-
+
hwEdit = create_editcontrol(style | WS_POPUP, 0);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 0);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 0);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, 0);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, b);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , b);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(style | WS_POPUP, WS_EX_CLIENTEDGE);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1);
DestroyWindow(hwEdit);
hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, WS_EX_CLIENTEDGE);
- SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
if (single_line)
check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1);
check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1);
r = get_edit_style(hwEdit);
ok(r == ES_PASSWORD, "Wrong style expected ES_PASSWORD got: 0x%x\n", r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) password);
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) password);
ok(r == TRUE, "Expected: %d, got: %d\n", TRUE, r);
/* select all, cut (ctrl-x) */
- SendMessage(hwEdit, EM_SETSEL, 0, -1);
- r = SendMessage(hwEdit, WM_CHAR, 24, 0);
+ SendMessageA(hwEdit, EM_SETSEL, 0, -1);
+ r = SendMessageA(hwEdit, WM_CHAR, 24, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
- r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
ok(r == strlen(password), "Expected: %s, got len %d\n", password, r);
ok(strcmp(buffer, password) == 0, "expected %s, got %s\n", password, buffer);
ok(r == TRUE, "expected %d, got %d\n", TRUE, r);
/* select all, copy (ctrl-c) and paste (ctrl-v) */
- SendMessage(hwEdit, EM_SETSEL, 0, -1);
- r = SendMessage(hwEdit, WM_CHAR, 3, 0);
+ SendMessageA(hwEdit, EM_SETSEL, 0, -1);
+ r = SendMessageA(hwEdit, WM_CHAR, 3, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- r = SendMessage(hwEdit, WM_CHAR, 22, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, 22, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
ok(r == 0, "Expected: 0, got: %d\n", r);
ok(strcmp(buffer, "") == 0, "expected empty string, got %s\n", buffer);
ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) text);
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) text);
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
/* select all, */
cpMin = cpMax = 0xdeadbeef;
- SendMessage(hwEdit, EM_SETSEL, 0, -1);
- r = SendMessage(hwEdit, EM_GETSEL, (WPARAM) &cpMin, (LPARAM) &cpMax);
+ SendMessageA(hwEdit, EM_SETSEL, 0, -1);
+ r = SendMessageA(hwEdit, EM_GETSEL, (WPARAM) &cpMin, (LPARAM) &cpMax);
ok((strlen(text) << 16) == r, "Unexpected length %d\n", r);
ok(0 == cpMin, "Expected: %d, got %d\n", 0, cpMin);
ok(9 == cpMax, "Expected: %d, got %d\n", 9, cpMax);
/* cut (ctrl-x) */
- r = SendMessage(hwEdit, WM_CHAR, 24, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, 24, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
ok(0 == r, "Expected: %d, got len %d\n", 0, r);
ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
/* undo (ctrl-z) */
- r = SendMessage(hwEdit, WM_CHAR, 26, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, 26, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
ok(strlen(text) == r, "Unexpected length %d\n", r);
ok(0 == strcmp(buffer, text), "expected %s, got %s\n", text, buffer);
/* undo again (ctrl-z) */
- r = SendMessage(hwEdit, WM_CHAR, 26, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, 26, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
ok(r == 0, "Expected: %d, got len %d\n", 0, r);
ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
ok(2 == r, "Expected: %d, got len %d\n", 2, r);
ok(0 == strcmp(buffer, "\r\n"), "expected \"\\r\\n\", got \"%s\"\n", buffer);
ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
ok(0 == r, "Expected: %d, got len %d\n", 0, r);
ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
ok(ES_WANTRETURN == r, "Wrong style expected ES_WANTRETURN got: 0x%x\n", r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
ok(0 == r, "Expected: %d, got len %d\n", 0, r);
ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
- r = SendMessage(hwEdit, WM_CHAR, VK_TAB, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
ok(1 == r, "Expected: %d, got len %d\n", 1, r);
ok(0 == strcmp(buffer, "\t"), "expected \"\\t\", got \"%s\"\n", buffer);
ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
/* set text */
- r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
+ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
- r = SendMessage(hwEdit, WM_CHAR, VK_TAB, 0);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
/* get text */
buffer[0] = 0;
- r = SendMessage(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
+ r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
ok(0 == r, "Expected: %d, got len %d\n", 0, r);
ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
int r;
/* from bug 11841 */
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 0);
ok(333 == r, "Expected %d, got %d\n", 333, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 1);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 2);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* more tests for WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 3);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 4);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 4);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 5);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 5);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* more tests for WM_KEYDOWN + WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 6);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 6);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 7);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 7);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 8);
+ r = DialogBoxParamA(hinst, "EDIT_READONLY_DIALOG", NULL, edit_dialog_proc, 8);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests with an editable edit control */
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 0);
ok(333 == r, "Expected %d, got %d\n", 333, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 1);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 2);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 3);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 4);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 4);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 5);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 5);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN + WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 6);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 6);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 7);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 7);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 8);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 8);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* multiple tab tests */
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 9);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 9);
ok(22 == r, "Expected %d, got %d\n", 22, r);
- r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 10);
+ r = DialogBoxParamA(hinst, "EDIT_DIALOG", NULL, edit_dialog_proc, 10);
ok(33 == r, "Expected %d, got %d\n", 33, r);
}
int r;
/* test for multiple edit dialogs (bug 12319) */
- r = DialogBoxParam(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 0);
ok(2222 == r, "Expected %d, got %d\n", 2222, r);
- r = DialogBoxParam(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 1);
ok(1111 == r, "Expected %d, got %d\n", 1111, r);
- r = DialogBoxParam(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 2);
ok(2222 == r, "Expected %d, got %d\n", 2222, r);
- r = DialogBoxParam(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "MULTI_EDIT_DIALOG", NULL, multi_edit_dialog_proc, 3);
ok(11 == r, "Expected %d, got %d\n", 11, r);
}
int r;
/* tests for WM_KEYDOWN */
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 0);
ok(333 == r, "Expected %d, got %d\n", 333, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 1);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 2);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 3);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 4);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 4);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 5);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 5);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN + WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 6);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 6);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 7);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 7);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 8);
+ r = DialogBoxParamA(hinst, "EDIT_WANTRETURN_DIALOG", NULL, edit_wantreturn_dialog_proc, 8);
ok(444 == r, "Expected %d, got %d\n", 444, r);
}
int r;
/* tests for WM_KEYDOWN */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 0);
ok(222 == r, "Expected %d, got %d\n", 222, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 1);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 2);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 3);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 4);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 4);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 5);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 5);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN + WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 6);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 6);
ok(222 == r, "Expected %d, got %d\n", 222, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 7);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 7);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 8);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_DIALOG", NULL, edit_singleline_dialog_proc, 8);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 0);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 0);
ok(222 == r, "Expected %d, got %d\n", 222, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 1);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 1);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 2);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 2);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 3);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 3);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 4);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 4);
ok(444 == r, "Expected %d, got %d\n", 444, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 5);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 5);
ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN + WM_CHAR */
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 6);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 6);
ok(222 == r, "Expected %d, got %d\n", 222, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 7);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 7);
ok(111 == r, "Expected %d, got %d\n", 111, r);
- r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 8);
+ r = DialogBoxParamA(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, edit_singleline_dialog_proc, 8);
ok(444 == r, "Expected %d, got %d\n", 444, r);
}
hwEdit = create_child_editcontrol(0, 0);
hwParent = GetParent(hwEdit);
- SetWindowLongPtr(hwParent, GWLP_WNDPROC, (LONG_PTR)child_edit_wmkeydown_proc);
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ SetWindowLongPtrA(hwParent, GWLP_WNDPROC, (LONG_PTR)child_edit_wmkeydown_proc);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
ok(0 == child_edit_wmkeydown_num_messages, "expected 0, got %d\n", child_edit_wmkeydown_num_messages);
destroy_child_editcontrol(hwEdit);
{
HWND hwndMain, hwndEdit;
- hwndMain = CreateWindow(szEditTest4Class, "ET4", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
+ hwndMain = CreateWindowA(szEditTest4Class, "ET4", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
0, 0, 200, 200, NULL, NULL, hinst, NULL);
assert(hwndMain);
- hwndEdit = CreateWindow("EDIT", NULL,
+ hwndEdit = CreateWindowA("EDIT", NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|ES_LEFT|ES_AUTOHSCROLL,
0, 0, 150, 50, /* important this not be 0 size. */
hwndMain, (HMENU) ID_EDITTEST2, hinst, NULL);
SetFocus(NULL);
SetCapture(hwndMain);
- SendMessage(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
+ SendMessageA(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
ok(got_en_setfocus, "edit box didn't get focused\n");
ok(got_wm_capturechanged, "main window capture did not change\n");
if (pGetMenuBarInfo)
{
- p_edit_proc = (void*)SetWindowLongPtr(hwndEdit, GWLP_WNDPROC, (ULONG_PTR)edit_proc_proxy);
- SendMessage(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
+ p_edit_proc = (void*)SetWindowLongPtrA(hwndEdit, GWLP_WNDPROC, (ULONG_PTR)edit_proc_proxy);
+ SendMessageA(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
}
DestroyWindow (hwndEdit);
WNDCLASSA test3;
WNDCLASSA test4;
WNDCLASSA text_position;
-
+
test2.style = 0;
test2.lpfnWndProc = ET2_WndProc;
test2.cbClsExtra = 0;
test2.cbWndExtra = 0;
test2.hInstance = hinst;
test2.hIcon = NULL;
- test2.hCursor = LoadCursorA (NULL, IDC_ARROW);
+ test2.hCursor = LoadCursorA (NULL, (LPCSTR)IDC_ARROW);
test2.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
test2.lpszMenuName = NULL;
test2.lpszClassName = szEditTest2Class;
test3.cbWndExtra = 0;
test3.hInstance = hinst;
test3.hIcon = 0;
- test3.hCursor = LoadCursorA(0, IDC_ARROW);
+ test3.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
test3.hbrBackground = GetStockObject(WHITE_BRUSH);
test3.lpszMenuName = NULL;
test3.lpszClassName = szEditTest3Class;
if (!RegisterClassA(&test3)) return FALSE;
-
+
test4.style = 0;
test4.lpfnWndProc = edit4_wnd_procA;
test4.cbClsExtra = 0;
test4.cbWndExtra = 0;
test4.hInstance = hinst;
test4.hIcon = NULL;
- test4.hCursor = LoadCursorA (NULL, IDC_ARROW);
+ test4.hCursor = LoadCursorA (NULL, (LPCSTR)IDC_ARROW);
test4.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
test4.lpszMenuName = NULL;
test4.lpszClassName = szEditTest4Class;
text_position.cbWndExtra = 0;
text_position.hInstance = hinst;
text_position.hIcon = NULL;
- text_position.hCursor = LoadCursorA(NULL, IDC_ARROW);
+ text_position.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
text_position.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
text_position.lpszMenuName = NULL;
text_position.lpszClassName = szEditTextPositionClass;
- text_position.lpfnWndProc = DefWindowProc;
+ text_position.lpfnWndProc = DefWindowProcA;
if (!RegisterClassA(&text_position)) return FALSE;
return TRUE;
HWND hwEdit;
HFONT hfont;
HDC hDC;
- LOGFONT lf;
+ LOGFONTA lf;
LONG r;
char szLocalString[MAXLEN];
int dpi;
strcpy(lf.lfFaceName,"Arial");
lf.lfHeight = -300; /* taller than the edit box */
lf.lfWeight = 500;
- hfont = CreateFontIndirect(&lf);
+ hfont = CreateFontIndirectA(&lf);
trace("EDIT: Oversized font (Multi line)\n");
- hwEdit= CreateWindow("EDIT", NULL, ES_MULTILINE|ES_AUTOHSCROLL,
+ hwEdit= CreateWindowA("EDIT", NULL, ES_MULTILINE|ES_AUTOHSCROLL,
0, 0, (150 * dpi) / 96, (50 * dpi) / 96, NULL, NULL,
hinst, NULL);
- SendMessage(hwEdit,WM_SETFONT,(WPARAM)hfont,0);
+ SendMessageA(hwEdit,WM_SETFONT,(WPARAM)hfont,0);
if (winetest_interactive)
ShowWindow (hwEdit, SW_SHOW);
- r = SendMessage(hwEdit, WM_CHAR, 'A', 1);
+ r = SendMessageA(hwEdit, WM_CHAR, 'A', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- r = SendMessage(hwEdit, WM_CHAR, 'B', 1);
+ r = SendMessageA(hwEdit, WM_CHAR, 'B', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- r = SendMessage(hwEdit, WM_CHAR, 'C', 1);
+ r = SendMessageA(hwEdit, WM_CHAR, 'C', 1);
ok(1 == r, "Expected: %d, got: %d\n", 1, r);
- GetWindowText(hwEdit, szLocalString, MAXLEN);
- ok(lstrcmp(szLocalString, "ABC")==0,
+ GetWindowTextA(hwEdit, szLocalString, MAXLEN);
+ ok(strcmp(szLocalString, "ABC")==0,
"Wrong contents of edit: %s\n", szLocalString);
- r = SendMessage(hwEdit, EM_POSFROMCHAR,0,0);
+ r = SendMessageA(hwEdit, EM_POSFROMCHAR,0,0);
ok(r != -1,"EM_POSFROMCHAR failed index 0\n");
- r = SendMessage(hwEdit, EM_POSFROMCHAR,1,0);
+ r = SendMessageA(hwEdit, EM_POSFROMCHAR,1,0);
ok(r != -1,"EM_POSFROMCHAR failed index 1\n");
- r = SendMessage(hwEdit, EM_POSFROMCHAR,2,0);
+ r = SendMessageA(hwEdit, EM_POSFROMCHAR,2,0);
ok(r != -1,"EM_POSFROMCHAR failed index 2\n");
- r = SendMessage(hwEdit, EM_POSFROMCHAR,3,0);
+ r = SendMessageA(hwEdit, EM_POSFROMCHAR,3,0);
ok(r == -1,"EM_POSFROMCHAR succeeded index 3\n");
DestroyWindow (hwEdit);
break;
}
- return DefWindowProc(hwnd, iMsg, wParam, lParam);
+ return DefWindowProcA(hwnd, iMsg, wParam, lParam);
}
static void test_dialogmode(void)
int len, r;
hwEdit = create_child_editcontrol(ES_MULTILINE, 0);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(11 == len, "expected 11, got %d\n", len);
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, 0);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, 0);
ok(0x8d == r, "expected 0x8d, got 0x%x\n", r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(13 == len, "expected 13, got %d\n", len);
- r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
ok(0x8d == r, "expected 0x8d, got 0x%x\n", r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(13 == len, "expected 13, got %d\n", len);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(13 == len, "expected 13, got %d\n", len);
destroy_child_editcontrol(hwEdit);
hwEdit = create_editcontrol(ES_MULTILINE, 0);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(11 == len, "expected 11, got %d\n", len);
msg.hwnd = hwEdit;
msg.message = WM_KEYDOWN;
msg.wParam = VK_BACK;
msg.lParam = 0xe0001;
- r = SendMessage(hwEdit, WM_GETDLGCODE, VK_BACK, (LPARAM)&msg);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, VK_BACK, (LPARAM)&msg);
ok(0x8d == r, "expected 0x8d, got 0x%x\n", r);
- r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
- len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0);
+ len = SendMessageA(hwEdit, WM_GETTEXTLENGTH, 0, 0);
ok(11 == len, "expected 11, got %d\n", len);
DestroyWindow(hwEdit);
hwEdit = create_child_editcontrol(0, 0);
hwParent = GetParent(hwEdit);
- SetWindowLongPtr(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
+ SetWindowLongPtrA(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.message = WM_KEYDOWN;
msg.wParam = VK_TAB;
msg.lParam = 0xf0001;
- r = SendMessage(hwEdit, WM_GETDLGCODE, VK_TAB, (LPARAM)&msg);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, VK_TAB, (LPARAM)&msg);
ok(0x89 == r, "expected 0x89, got 0x%x\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
hwEdit = create_child_editcontrol(ES_MULTILINE, 0);
hwParent = GetParent(hwEdit);
- SetWindowLongPtr(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
+ SetWindowLongPtrA(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.message = WM_KEYDOWN;
msg.wParam = VK_ESCAPE;
msg.lParam = 0x10001;
- r = SendMessage(hwEdit, WM_GETDLGCODE, VK_ESCAPE, (LPARAM)&msg);
+ r = SendMessageA(hwEdit, WM_GETDLGCODE, VK_ESCAPE, (LPARAM)&msg);
ok(0x8d == r, "expected 0x8d, got 0x%x\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 1);
zero_dm_messages();
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 1, 0);
zero_dm_messages();
- hwButton = CreateWindow("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
+ hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
100, 100, 50, 20, hwParent, (HMENU)ID_EDITTESTDBUTTON, hinst, NULL);
ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
- r = SendMessage(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
+ r = SendMessageA(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 1, 1);
zero_dm_messages();
hEdit = create_editcontrol(WS_BORDER, 0);
ok(hEdit != NULL, "got %p (expected != NULL)\n", hEdit);
- hmem = (HGLOBAL) SendMessage(hEdit, EM_GETHANDLE, 0, 0);
+ hmem = (HGLOBAL) SendMessageA(hEdit, EM_GETHANDLE, 0, 0);
ok(hmem == NULL, "got %p (expected NULL)\n", hmem);
DestroyWindow(hEdit);
ok((r == lstrlenA(str1)) && !lstrcmpA(current, str1),
"got %d and \"%s\" (expected %d and \"%s\")\n", r, current, lstrlenA(str1), str1);
- hmem = (HGLOBAL) SendMessage(hEdit, EM_GETHANDLE, 0, 0);
+ hmem = (HGLOBAL) SendMessageA(hEdit, EM_GETHANDLE, 0, 0);
ok(hmem != NULL, "got %p (expected != NULL)\n", hmem);
/* The buffer belongs to the app now. According to MSDN, the app has to LocalFree the
buffer, LocalAlloc a new buffer and pass it to the edit control with EM_SETHANDLE. */
hmem2 = LocalAlloc(LMEM_MOVEABLE, 42);
ok(hmem2 != NULL, "got %p (expected != NULL)\n", hmem2);
- SendMessage(hEdit, EM_SETHANDLE, (WPARAM)halloc, 0);
+ SendMessageA(hEdit, EM_SETHANDLE, (WPARAM)halloc, 0);
len = SendMessageA(hEdit, WM_GETTEXTLENGTH, 0, 0);
ok(len == lstrlenA(str2), "got %d (expected %d)\n", len, lstrlenA(str2));
len = SendMessageA(hEdit, WM_GETTEXTLENGTH, 0, 0);
ok((r == 1) && (len == lstrlenA(str1)), "got %d and %d (expected 1 and %d)\n", r, len, lstrlenA(str1));
- /* everything is normal upto EM_GETHANDLE */
- hmem = (HGLOBAL) SendMessage(hEdit, EM_GETHANDLE, 0, 0);
+ /* everything is normal up to EM_GETHANDLE */
+ hmem = (HGLOBAL) SendMessageA(hEdit, EM_GETHANDLE, 0, 0);
/* Some messages still work while other messages fail.
After LocalFree the memory handle, messages can crash the app */
/* A buggy editor used EM_GETHANDLE twice */
- hmem2 = (HGLOBAL) SendMessage(hEdit, EM_GETHANDLE, 0, 0);
+ hmem2 = (HGLOBAL) SendMessageA(hEdit, EM_GETHANDLE, 0, 0);
ok(hmem2 == hmem, "got %p (expected %p)\n", hmem2, hmem);
/* Let the edit control free the memory handle */
- SendMessage(hEdit, EM_SETHANDLE, (WPARAM)hmem2, 0);
+ SendMessageA(hEdit, EM_SETHANDLE, (WPARAM)hmem2, 0);
DestroyWindow(hEdit);
}
#define WM_LBTRACKPOINT 0x0131
#endif
+#ifdef __i386__
+#define ARCH "x86"
+#elif defined __x86_64__
+#define ARCH "amd64"
+#else
+#define ARCH "none"
+#endif
+
+static BOOL (WINAPI *pActivateActCtx)(HANDLE,ULONG_PTR*);
+static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW);
+static BOOL (WINAPI *pDeactivateActCtx)(DWORD,ULONG_PTR);
+static BOOL (WINAPI *pGetCurrentActCtx)(HANDLE *);
+static void (WINAPI *pReleaseActCtx)(HANDLE);
+
/* encoded DRAWITEMSTRUCT into an LPARAM */
typedef struct
{
while (diff > 0)
{
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
diff = time - GetTickCount();
}
}
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(0);
cls.hIcon = 0;
- cls.hCursor = LoadCursorA(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "MDI_frame_class";
/* test maximization of MDI child with invisible parent */
client_cs.hWindowMenu = 0;
- mdi_client = CreateWindow("MDI_client_class",
+ mdi_client = CreateWindowA("MDI_client_class",
NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
0, 0, 660, 430,
mdi_client, 0, GetModuleHandleA(0), NULL);
ok_sequence(WmCreateMDIchildInvisibleParentSeq, "Create MDI child window with invisible parent", FALSE);
- SendMessage(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0);
+ SendMessageA(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0);
ok_sequence(WmMaximizeMDIchildInvisibleParentSeq, "Maximize MDI child window with invisible parent", TRUE);
zoomed = IsZoomed(mdi_child);
ok(zoomed, "wrong zoomed state %d\n", zoomed);
-
+
ShowWindow(mdi_client, SW_SHOW);
ok_sequence(WmShowMDIclientSeq, "Show MDI client window", FALSE);
flush_sequence();
test_def_id = 1;
- SendMessage(hwnd, WM_NULL, 0, 0);
+ SendMessageA(hwnd, WM_NULL, 0, 0);
flush_sequence();
after_end_dialog = 1;
UpdateWindow(hwnd);
flush_events();
flush_sequence();
- SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION));
+ SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION));
ok_sequence(WmSetIcon_1, "WM_SETICON for shown window with caption", FALSE);
ShowWindow(hwnd, SW_HIDE);
flush_events();
flush_sequence();
- SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION));
+ SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION));
ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window with caption", FALSE);
DestroyWindow(hwnd);
flush_sequence();
UpdateWindow(hwnd);
flush_events();
flush_sequence();
- SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION));
+ SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION));
ok_sequence(WmSetIcon_2, "WM_SETICON for shown window without caption", FALSE);
ShowWindow(hwnd, SW_HIDE);
flush_events();
flush_sequence();
- SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION));
+ SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION));
ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window without caption", FALSE);
flush_sequence();
- res = SendMessage(hwnd, 0x3B, 0x8000000b, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x8000000b, 0);
if (!res)
{
todo_wine win_skip( "Message 0x3b not supported\n" );
}
ok_sequence(WmInitEndSession, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x8000000b", TRUE);
ok(res == 1, "SendMessage(hwnd, 0x3B, 0x8000000b, 0) should have returned 1 instead of %ld\n", res);
- res = SendMessage(hwnd, 0x3B, 0x0000000b, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x0000000b, 0);
ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000b", TRUE);
ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000b, 0) should have returned 1 instead of %ld\n", res);
- res = SendMessage(hwnd, 0x3B, 0x0000000f, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x0000000f, 0);
ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000f", TRUE);
ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000f, 0) should have returned 1 instead of %ld\n", res);
flush_sequence();
- res = SendMessage(hwnd, 0x3B, 0x80000008, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x80000008, 0);
ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000008", TRUE);
ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000008, 0) should have returned 2 instead of %ld\n", res);
- res = SendMessage(hwnd, 0x3B, 0x00000008, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x00000008, 0);
ok_sequence(WmInitEndSession_4, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x00000008", TRUE);
ok(res == 2, "SendMessage(hwnd, 0x3B, 0x00000008, 0) should have returned 2 instead of %ld\n", res);
- res = SendMessage(hwnd, 0x3B, 0x80000004, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x80000004, 0);
ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000004", TRUE);
ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000004, 0) should have returned 2 instead of %ld\n", res);
- res = SendMessage(hwnd, 0x3B, 0x80000001, 0);
+ res = SendMessageA(hwnd, 0x3B, 0x80000001, 0);
ok_sequence(WmInitEndSession_5, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000001", TRUE);
ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000001, 0) should have returned 2 instead of %ld\n", res);
old_button_proc = cls.lpfnWndProc;
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.lpfnWndProc = button_hook_proc;
cls.lpszClassName = "my_button_class";
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
if (!RegisterClassA(&cls)) assert(0);
}
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
SetFocus(hwnd);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE);
SetFocus(0);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE);
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
- SendMessage(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].setstyle, "BM_SETSTYLE on a button", FALSE);
style = GetWindowLongA(hwnd, GWL_STYLE);
/* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */
ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
- state = SendMessage(hwnd, BM_GETSTATE, 0, 0);
+ state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
ok(state == 0, "expected state 0, got %04x\n", state);
flush_sequence();
- SendMessage(hwnd, BM_SETSTATE, TRUE, 0);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, BM_SETSTATE, TRUE, 0);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].setstate, "BM_SETSTATE/TRUE on a button", FALSE);
- state = SendMessage(hwnd, BM_GETSTATE, 0, 0);
+ state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
ok(state == 0x0004, "expected state 0x0004, got %04x\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE);
flush_sequence();
- SendMessage(hwnd, BM_SETSTATE, FALSE, 0);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, BM_SETSTATE, FALSE, 0);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].clearstate, "BM_SETSTATE/FALSE on a button", FALSE);
- state = SendMessage(hwnd, BM_GETSTATE, 0, 0);
+ state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
ok(state == 0, "expected state 0, got %04x\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE);
style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
- state = SendMessage(hwnd, BM_GETCHECK, 0, 0);
+ state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
flush_sequence();
- SendMessage(hwnd, BM_SETCHECK, BST_UNCHECKED, 0);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, BM_SETCHECK, BST_UNCHECKED, 0);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmSetCheckIgnoredSeq, "BM_SETCHECK on a button", FALSE);
- state = SendMessage(hwnd, BM_GETCHECK, 0, 0);
+ state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE);
flush_sequence();
- SendMessage(hwnd, BM_SETCHECK, BST_CHECKED, 0);
- SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ SendMessageA(hwnd, BM_SETCHECK, BST_CHECKED, 0);
+ SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(button[i].setcheck, "BM_SETCHECK on a button", FALSE);
- state = SendMessage(hwnd, BM_GETCHECK, 0, 0);
+ state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
if (button[i].style == BS_PUSHBUTTON ||
button[i].style == BS_DEFPUSHBUTTON ||
button[i].style == BS_GROUPBOX ||
old_static_proc = cls.lpfnWndProc;
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.lpfnWndProc = static_hook_proc;
cls.lpszClassName = "my_static_class";
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
if (!RegisterClassA(&cls)) assert(0);
}
flush_sequence();
trace("static style %08x\n", static_ctrl[i].style);
- SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE);
+ SendMessageA(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE);
ok_sequence(static_ctrl[i].setfont, "WM_SETFONT on a static", FALSE);
DestroyWindow(hwnd);
old_combobox_proc = cls.lpfnWndProc;
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.lpfnWndProc = combobox_hook_proc;
cls.lpszClassName = "my_combobox_class";
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
if (!RegisterClassA(&cls)) assert(0);
}
ok(parent != 0, "Failed to create parent window\n");
flush_sequence();
- combo = CreateWindowEx(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS,
+ combo = CreateWindowExA(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS,
0, 0, 100, 150, parent, (HMENU)ID_COMBOBOX, 0, NULL);
ok(combo != 0, "Failed to create combobox window\n");
UpdateWindow(combo);
- ret = SendMessage(combo, WM_GETDLGCODE, 0, 0);
+ ret = SendMessageA(combo, WM_GETDLGCODE, 0, 0);
ok(ret == (DLGC_WANTCHARS | DLGC_WANTARROWS), "wrong dlg_code %08lx\n", ret);
- ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 0");
+ ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 0");
ok(ret == 0, "expected 0, got %ld\n", ret);
- ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 1");
+ ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 1");
ok(ret == 1, "expected 1, got %ld\n", ret);
- ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 2");
+ ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 2");
ok(ret == 2, "expected 2, got %ld\n", ret);
- SendMessage(combo, CB_SETCURSEL, 0, 0);
+ SendMessageA(combo, CB_SETCURSEL, 0, 0);
SetFocus(combo);
flush_sequence();
log_all_parent_messages++;
- SendMessage(combo, WM_KEYDOWN, VK_DOWN, 0);
- SendMessage(combo, WM_KEYUP, VK_DOWN, 0);
+ SendMessageA(combo, WM_KEYDOWN, VK_DOWN, 0);
+ SendMessageA(combo, WM_KEYUP, VK_DOWN, 0);
log_all_parent_messages--;
ok_sequence(WmKeyDownComboSeq, "WM_KEYDOWN/VK_DOWN on a ComboBox", FALSE);
flush_events();
flush_sequence();
- SendMessage(hwnd, WM_IME_KEYDOWN, VK_RETURN, 0x1c0001);
- SendMessage(hwnd, WM_CHAR, 'A', 1);
+ SendMessageA(hwnd, WM_IME_KEYDOWN, VK_RETURN, 0x1c0001);
+ SendMessageA(hwnd, WM_CHAR, 'A', 1);
ok_sequence(WmImeKeydownMsgSeq_0, "WM_IME_KEYDOWN 0", FALSE);
- while ( PeekMessage(&msg, 0, 0, 0, PM_REMOVE) )
+ while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmImeKeydownMsgSeq_1, "WM_IME_KEYDOWN 1", FALSE);
flush_sequence();
SetRectRgn( hrgn, -4, -4, -1, -1 );
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
{
if (msg.hwnd == hwnd && msg.message == WM_PAINT)
{
ret = GetUpdateRect( hwnd, &rect, TRUE );
ok( !ret, "Invalid GetUpdateRect result %d\n", ret );
}
- DispatchMessage( &msg );
+ DispatchMessageA( &msg );
}
ok_sequence( WmGetUpdateRect, "GetUpdateRect", FALSE );
RedrawWindow( hparent, NULL, 0, RDW_ERASENOW | RDW_ALLCHILDREN );
ok_sequence( WmInvalidateParentChild2, "InvalidateParentChild2", FALSE );
- SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) | WS_CLIPCHILDREN );
+ SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) | WS_CLIPCHILDREN );
flush_sequence();
RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN );
RedrawWindow( hparent, NULL, 0, RDW_ERASENOW );
/* flush all paint messages */
flush_events();
- SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN );
+ SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN );
flush_sequence();
/* RDW_UPDATENOW on child without WS_CLIPCHILDREN will validate corresponding parent area */
SetRectRgn( hrgn, 20, 20, 30, 30 );
check_update_rgn( hparent, hrgn );
/* no WM_PAINT in child while parent still pending */
- while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
- while (PeekMessage( &msg, hparent, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, hparent, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmParentErasePaint, "WmParentErasePaint", FALSE );
flush_sequence();
RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
/* no WM_PAINT in child while parent still pending */
- while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
RedrawWindow( hparent, &rect, 0, RDW_VALIDATE | RDW_NOERASE | RDW_NOCHILDREN );
/* now that parent is valid child should get WM_PAINT */
- while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE );
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmEmptySeq, "No other message", FALSE );
/* same thing with WS_CLIPCHILDREN in parent */
flush_sequence();
- SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) | WS_CLIPCHILDREN );
+ SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) | WS_CLIPCHILDREN );
ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE );
/* changing style invalidates non client area, but we need to invalidate something else to see it */
RedrawWindow( hparent, &rect, 0, RDW_UPDATENOW );
SetRectRgn( hrgn, 20, 20, 30, 30 );
check_update_rgn( hparent, hrgn );
/* no WM_PAINT in child while parent still pending */
- while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
/* WM_PAINT in parent first */
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence( WmParentPaintNc, "WmParentPaintNc2", FALSE );
/* no RDW_ERASE in parent still causes RDW_ERASE and RDW_FRAME in child */
flush_events();
ok_sequence( WmParentOnlyPaint, "WmParentOnlyPaint", FALSE );
- assert( GetWindowLong(hparent, GWL_STYLE) & WS_CLIPCHILDREN );
+ assert( GetWindowLongA(hparent, GWL_STYLE) & WS_CLIPCHILDREN );
UpdateWindow( hparent );
flush_events();
flush_sequence();
flush_events();
ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE );
- SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN );
+ SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN );
ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE );
RedrawWindow( hparent, NULL, 0, RDW_INTERNALPAINT );
flush_events();
ok_sequence( WmParentPaint, "WmParentPaint", FALSE );
- assert( !(GetWindowLong(hparent, GWL_STYLE) & WS_CLIPCHILDREN) );
+ assert( !(GetWindowLongA(hparent, GWL_STYLE) & WS_CLIPCHILDREN) );
UpdateWindow( hparent );
flush_events();
flush_sequence();
flush_events();
ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE );
- ok(GetWindowLong( hparent, GWL_STYLE ) & WS_VISIBLE, "parent should be visible\n");
- ok(GetWindowLong( hchild, GWL_STYLE ) & WS_VISIBLE, "child should be visible\n");
+ ok(GetWindowLongA( hparent, GWL_STYLE ) & WS_VISIBLE, "parent should be visible\n");
+ ok(GetWindowLongA( hchild, GWL_STYLE ) & WS_VISIBLE, "child should be visible\n");
UpdateWindow( hparent );
flush_events();
SetEvent(wnd_event->start_event);
- while (GetMessage(&msg, 0, 0, 0))
+ while (GetMessageA(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok(IsWindow(wnd_event->hwnd), "window should still exist\n");
{
MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_ALLINPUT);
if (!IsWindow( hchild )) break; /* will be destroyed when parent thread exits */
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
}
return 0;
}
{
DWORD ret = MsgWaitForMultipleObjects(1, &child_event.start_event, FALSE, 1000, QS_SENDMESSAGE);
if (ret != 1) break;
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
}
ret = WaitForSingleObject( wnd_event->stop_event, 5000 );
ok( !ret, "WaitForSingleObject failed %x\n", ret );
return 0;
}
+static const char manifest_dep[] =
+"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
+"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" processorArchitecture=\"" ARCH "\"/>"
+" <file name=\"testdep.dll\" />"
+"</assembly>";
+
+static const char manifest_main[] =
+"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
+"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\" />"
+"<dependency>"
+" <dependentAssembly>"
+" <assemblyIdentity type=\"win32\" name=\"testdep1\" version=\"1.2.3.4\" processorArchitecture=\"" ARCH "\" />"
+" </dependentAssembly>"
+"</dependency>"
+"</assembly>";
+
+static void create_manifest_file(const char *filename, const char *manifest)
+{
+ WCHAR path[MAX_PATH];
+ HANDLE file;
+ DWORD size;
+
+ MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH );
+ file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
+ WriteFile(file, manifest, strlen(manifest), &size, NULL);
+ CloseHandle(file);
+}
+
+static HANDLE test_create(const char *file)
+{
+ WCHAR path[MAX_PATH];
+ ACTCTXW actctx;
+ HANDLE handle;
+
+ MultiByteToWideChar(CP_ACP, 0, file, -1, path, MAX_PATH);
+ memset(&actctx, 0, sizeof(ACTCTXW));
+ actctx.cbSize = sizeof(ACTCTXW);
+ actctx.lpSource = path;
+
+ handle = pCreateActCtxW(&actctx);
+ ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError());
+
+ ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize);
+ ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags);
+ ok(actctx.lpSource == path, "lpSource=%p\n", actctx.lpSource);
+ ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture);
+ ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId);
+ ok(actctx.lpAssemblyDirectory == NULL, "lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory);
+ ok(actctx.lpResourceName == NULL, "lpResourceName=%p\n", actctx.lpResourceName);
+ ok(actctx.lpApplicationName == NULL, "lpApplicationName=%p\n", actctx.lpApplicationName);
+ ok(actctx.hModule == NULL, "hModule=%p\n", actctx.hModule);
+
+ return handle;
+}
+
static void test_interthread_messages(void)
{
- HANDLE hThread;
+ HANDLE hThread, context, handle, event;
+ ULONG_PTR cookie;
DWORD tid;
WNDPROC proc;
MSG msg;
{
ret = MsgWaitForMultipleObjects(1, &wnd_event.start_event, FALSE, 1000, QS_SENDMESSAGE);
if (ret != 1) break;
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
}
ok( !ret, "MsgWaitForMultipleObjects failed %x\n", ret );
/* now wait for the thread without processing messages; this shouldn't deadlock */
ok_sequence(WmExitThreadSeq, "destroy child on thread exit", FALSE);
log_all_parent_messages--;
DestroyWindow( wnd_event.hwnd );
+
+ /* activation context tests */
+ if (!pActivateActCtx)
+ {
+ win_skip("Activation contexts are not supported, skipping\n");
+ return;
+ }
+
+ create_manifest_file("testdep1.manifest", manifest_dep);
+ create_manifest_file("main.manifest", manifest_main);
+
+ context = test_create("main.manifest");
+ DeleteFileA("testdep1.manifest");
+ DeleteFileA("main.manifest");
+
+ handle = (void*)0xdeadbeef;
+ ret = pGetCurrentActCtx(&handle);
+ ok(ret, "GetCurentActCtx failed: %u\n", GetLastError());
+ ok(handle == 0, "active context %p\n", handle);
+
+ wnd_event.start_event = CreateEventW(NULL, 0, 0, NULL);
+ hThread = CreateThread(NULL, 0, thread_proc, &wnd_event, 0, &tid);
+ ok(hThread != NULL, "CreateThread failed, error %d\n", GetLastError());
+ ok(WaitForSingleObject(wnd_event.start_event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
+ CloseHandle(wnd_event.start_event);
+
+ /* context is activated after thread creation, so it doesn't inherit it by default */
+ ret = pActivateActCtx(context, &cookie);
+ ok(ret, "activation failed: %u\n", GetLastError());
+
+ handle = 0;
+ ret = pGetCurrentActCtx(&handle);
+ ok(ret, "GetCurentActCtx failed: %u\n", GetLastError());
+ ok(handle != 0, "active context %p\n", handle);
+
+ /* destination window will test for active context */
+ ret = SendMessageA(wnd_event.hwnd, WM_USER+10, 0, 0);
+ ok(ret, "thread window returned %d\n", ret);
+
+ event = CreateEventW(NULL, 0, 0, NULL);
+ ret = PostMessageA(wnd_event.hwnd, WM_USER+10, 0, (LPARAM)event);
+ ok(ret, "thread window returned %d\n", ret);
+ ok(WaitForSingleObject(event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
+ CloseHandle(event);
+
+ ret = PostMessageA(wnd_event.hwnd, WM_QUIT, 0, 0);
+ ok(ret, "PostMessageA(WM_QUIT) error %d\n", GetLastError());
+
+ ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
+ CloseHandle(hThread);
+
+ ret = pDeactivateActCtx(0, cookie);
+ ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
+ pReleaseActCtx(context);
}
log_msg.descr = "accel";
add_message(&log_msg);
- if (!hAccel || !TranslateAccelerator(hwnd, hAccel, &msg))
+ if (!hAccel || !TranslateAcceleratorA(hwnd, hAccel, &msg))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
}
}
state = GetKeyState(VK_CAPITAL);
ok(state == 0, "wrong CapsLock state %04x\n", state);
- hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(1));
+ hAccel = LoadAcceleratorsA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1));
assert(hAccel != 0);
flush_events();
ret = DestroyAcceleratorTable(hAccel);
ok( ret, "DestroyAcceleratorTable error %d\n", GetLastError());
- hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(2));
+ hAccel = LoadAcceleratorsA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(2));
assert(hAccel != 0);
trace("testing VK_N press/release\n");
case WM_NCHITTEST:
return HTCLIENT;
+ case WM_USER+10:
+ {
+ HANDLE handle, event = (HANDLE)lParam;
+ BOOL ret;
+
+ handle = (void*)0xdeadbeef;
+ ret = pGetCurrentActCtx(&handle);
+ ok(ret, "failed to get current context, %u\n", GetLastError());
+ ok(handle == 0, "got active context %p\n", handle);
+ if (event) SetEvent(event);
+ return 1;
+ }
+
/* ignore */
case WM_MOUSEMOVE:
case WM_MOUSEACTIVATE:
static INT_PTR CALLBACK StopQuitMsgCheckProcA(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
{
if (message == WM_CREATE)
- PostMessage(hwnd, WM_CLOSE, 0, 0);
+ PostMessageA(hwnd, WM_CLOSE, 0, 0);
else if (message == WM_CLOSE)
{
/* Only the first WM_QUIT will survive the window destruction */
- PostMessage(hwnd, WM_USER, 0x1234, 0x5678);
- PostMessage(hwnd, WM_QUIT, 0x1234, 0x5678);
- PostMessage(hwnd, WM_QUIT, 0x4321, 0x8765);
+ PostMessageA(hwnd, WM_USER, 0x1234, 0x5678);
+ PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678);
+ PostMessageA(hwnd, WM_QUIT, 0x4321, 0x8765);
}
return DefWindowProcA(hwnd, message, wp, lp);
if (PeekMessageA(&msg2, 0, 0, 0, 1))
{
TranslateMessage(&msg2);
- DispatchMessage(&msg2);
+ DispatchMessageA(&msg2);
}
i--;
}
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(0);
cls.hIcon = 0;
- cls.hCursor = LoadCursorA(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "TestWindowClass";
DWORD id;
MSG msg;
- info.hWnd = CreateWindow ("TestWindowClass", NULL,
+ info.hWnd = CreateWindowA("TestWindowClass", NULL,
WS_OVERLAPPEDWINDOW ,
CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
NULL, NULL, 0);
info.id = SetTimer(info.hWnd,TIMER_ID,10000,tfunc);
ok(info.id, "SetTimer failed\n");
ok(info.id==TIMER_ID, "SetTimer timer ID different\n");
- info.handles[0] = CreateEvent(NULL,0,0,NULL);
+ info.handles[0] = CreateEventW(NULL,0,0,NULL);
info.handles[1] = CreateThread(NULL,0,timer_thread_proc,&info,0,&id);
WaitForMultipleObjects(2, info.handles, FALSE, INFINITE);
ok(id != 0, "did not get id from SetTimer.\n");
ok(id==TIMER_ID, "SetTimer timer ID different\n");
start = GetTickCount();
- while (GetTickCount()-start < 1001 && GetMessage(&msg, info.hWnd, 0, 0))
- DispatchMessage(&msg);
+ while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0))
+ DispatchMessageA(&msg);
ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE
|| broken(abs(count-43) < TIMER_COUNT_TOLERANCE) /* w2k3 */,
"did not get expected count for minimum timeout (%d != ~%d).\n",
ok(id != 0, "did not get id from SetSystemTimer.\n");
ok(id==TIMER_ID, "SetTimer timer ID different\n");
start = GetTickCount();
- while (GetTickCount()-start < 1001 && GetMessage(&msg, info.hWnd, 0, 0))
+ while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0))
{
if (msg.message == WM_SYSTIMER)
syscount++;
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok(abs(syscount-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE,
"did not get expected count for minimum timeout (%d != ~%d).\n",
id2 = SetTimer(NULL, id, 200, callback_count);
ok(id2 == id, "did not get same id from SetTimer when replacing (%li expected %li).\n", id2, id);
Sleep(150);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(count == 0, "did not get zero count as expected (%i).\n", count);
Sleep(150);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(count == 1, "did not get one count as expected (%i).\n", count);
KillTimer(NULL, id);
Sleep(250);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(count == 1, "killing replaced timer did not work (%i).\n", count);
/* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms,
id = SetTimer(NULL, 0, 0, callback_count);
ok(id != 0, "did not get id from SetTimer.\n");
start = GetTickCount();
- while (GetTickCount()-start < 1001 && GetMessage(&msg, NULL, 0, 0))
- DispatchMessage(&msg);
+ while (GetTickCount()-start < 1001 && GetMessageA(&msg, NULL, 0, 0))
+ DispatchMessageA(&msg);
ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE,
"did not get expected count for minimum timeout (%d != ~%d).\n",
count, TIMER_COUNT_EXPECTED);
pNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_ALERT, 0);
SetEvent(hevent);
- while (GetMessage(&msg, 0, 0, 0))
+ while (GetMessageA(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
return 0;
}
SetEvent(hevent);
- while (GetMessage(&msg, 0, 0, 0))
+ while (GetMessageA(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
return 0;
}
mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0);
SetEvent(hevent);
- while (GetMessage(&msg, 0, 0, 0))
+ while (GetMessageA(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
return 0;
}
ok(hthread != NULL, "CreateThread failed, error %d\n", GetLastError());
while (WaitForSingleObject(hevent, 100) == WAIT_TIMEOUT)
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
ok_sequence(WmMouseLLHookSeq, "MOUSE_LL hook other thread", FALSE);
flush_sequence();
SetRect( &rect, -5, -5, 5, 5 );
RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME );
count = 0;
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
{
- if (msg.message != WM_PAINT) DispatchMessage( &msg );
+ if (msg.message != WM_PAINT) DispatchMessageA( &msg );
else
{
flush_sequence();
- DispatchMessage( &msg );
+ DispatchMessageA( &msg );
/* DispatchMessage will send WM_NCPAINT if non client area is still invalid after WM_PAINT */
if (!count) ok_sequence( WmDispatchPaint, "WmDispatchPaint", FALSE );
else ok_sequence( WmEmptySeq, "WmEmpty", FALSE );
flush_sequence();
RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME );
count = 0;
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
{
- if (msg.message != WM_PAINT) DispatchMessage( &msg );
+ if (msg.message != WM_PAINT) DispatchMessageA( &msg );
else
{
HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
flush_sequence();
RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME );
count = 0;
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
{
- if (msg.message != WM_PAINT) DispatchMessage( &msg );
+ if (msg.message != WM_PAINT) DispatchMessageA( &msg );
else
{
HDC hdc;
while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_SENDMESSAGE) != WAIT_OBJECT_0)
{
MSG msg;
- while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage(&msg);
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA(&msg);
}
}
{ WM_COMMAND, sent|parent|wparam, MAKEWPARAM(ID_EDIT, EN_SETFOCUS) },
{ 0 }
};
+static const struct message sl_edit_invisible[] =
+{
+ { HCBT_SETFOCUS, hook },
+ { WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
+ { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
+ { WM_KILLFOCUS, sent|parent },
+ { WM_SETFOCUS, sent },
+ { WM_COMMAND, sent|parent|wparam, MAKEWPARAM(ID_EDIT, EN_SETFOCUS) },
+ { 0 }
+};
static const struct message ml_edit_setfocus[] =
{
{ HCBT_SETFOCUS, hook },
old_edit_proc = cls.lpfnWndProc;
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.lpfnWndProc = edit_hook_proc;
cls.lpszClassName = "my_edit_class";
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
if (!RegisterClassA(&cls)) assert(0);
}
dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
ok(dlg_code == (DLGC_WANTCHARS|DLGC_HASSETSEL|DLGC_WANTARROWS), "wrong dlg_code %08x\n", dlg_code);
+ flush_sequence();
+ SetFocus(hwnd);
+ ok_sequence(sl_edit_invisible, "SetFocus(hwnd) on an invisible edit", FALSE);
+
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
SetFocus(0);
}
if (qstatus & QS_POSTMESSAGE)
{
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) /* nothing */ ;
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) /* nothing */ ;
qstatus = GetQueueStatus(qs_all_input);
}
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus);
x1 = y1 = x2 = y2 = x3 = y3 = 0;
/* Initialise window and make sure it is ready for events */
- hwnd = CreateWindow("TestWindowClass", "PeekMessage2", WS_OVERLAPPEDWINDOW,
+ hwnd = CreateWindowA("TestWindowClass", "PeekMessage2", WS_OVERLAPPEDWINDOW,
10, 10, 800, 800, NULL, NULL, NULL, NULL);
assert(hwnd);
trace("Window for test_PeekMessage2 %p\n", hwnd);
switch (message)
{
case WM_INITDIALOG:
- PostMessage(hwnd, WM_QUIT, 0x1234, 0x5678);
- PostMessage(hwnd, WM_USER, 0xdead, 0xbeef);
+ PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678);
+ PostMessageA(hwnd, WM_USER, 0xdead, 0xbeef);
return 0;
case WM_GETDLGCODE:
flush_events();
PostQuitMessage(0xbeef);
- ret = PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
+ ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
ok(ret, "PeekMessage failed with error %d\n", GetLastError());
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0xbeef, "wParam was 0x%lx instead of 0xbeef\n", msg.wParam);
- ret = PostThreadMessage(GetCurrentThreadId(), WM_USER, 0, 0);
+ ret = PostThreadMessageA(GetCurrentThreadId(), WM_USER, 0, 0);
ok(ret, "PostMessage failed with error %d\n", GetLastError());
- ret = GetMessage(&msg, NULL, 0, 0);
+ ret = GetMessageA(&msg, NULL, 0, 0);
ok(ret > 0, "GetMessage failed with error %d\n", GetLastError());
ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message);
/* note: WM_QUIT message received after WM_USER message */
- ret = GetMessage(&msg, NULL, 0, 0);
+ ret = GetMessageA(&msg, NULL, 0, 0);
ok(!ret, "GetMessage return %d with error %d instead of FALSE\n", ret, GetLastError());
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0xbeef, "wParam was 0x%lx instead of 0xbeef\n", msg.wParam);
- ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
+ ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE);
ok( !ret || msg.message != WM_QUIT, "Received WM_QUIT again\n" );
/* now test with PostThreadMessage - different behaviour! */
- PostThreadMessage(GetCurrentThreadId(), WM_QUIT, 0xdead, 0);
+ PostThreadMessageA(GetCurrentThreadId(), WM_QUIT, 0xdead, 0);
- ret = PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
+ ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
ok(ret, "PeekMessage failed with error %d\n", GetLastError());
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0xdead, "wParam was 0x%lx instead of 0xdead\n", msg.wParam);
- ret = PostThreadMessage(GetCurrentThreadId(), WM_USER, 0, 0);
+ ret = PostThreadMessageA(GetCurrentThreadId(), WM_USER, 0, 0);
ok(ret, "PostMessage failed with error %d\n", GetLastError());
/* note: we receive the WM_QUIT message first this time */
- ret = GetMessage(&msg, NULL, 0, 0);
+ ret = GetMessageA(&msg, NULL, 0, 0);
ok(!ret, "GetMessage return %d with error %d instead of FALSE\n", ret, GetLastError());
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0xdead, "wParam was 0x%lx instead of 0xdead\n", msg.wParam);
- ret = GetMessage(&msg, NULL, 0, 0);
+ ret = GetMessageA(&msg, NULL, 0, 0);
ok(ret > 0, "GetMessage failed with error %d\n", GetLastError());
ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message);
flush_events();
flush_sequence();
- ret = DialogBoxParam(GetModuleHandle(0), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0);
ok(ret == 1, "expected 1, got %d\n", ret);
ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", FALSE);
memset(&msg, 0xab, sizeof(msg));
- ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
+ ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE);
ok(ret, "PeekMessage failed\n");
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0x1234, "wParam was 0x%lx instead of 0x1234\n", msg.wParam);
CreateWindowExA(0, "StopQuitClass", "Stop Quit Test", WS_OVERLAPPEDWINDOW,
0, 0, 100, 100, NULL, NULL, NULL, NULL);
flush_sequence();
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
struct recvd_message rmsg;
rmsg.hwnd = msg.hwnd;
/* The hwnd can only be checked here */
ok(!msg.hwnd, "The WM_QUIT hwnd was %p instead of NULL\n", msg.hwnd);
add_message(&rmsg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmStopQuitSeq, "WmStopQuitSeq", FALSE);
}
do
{
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
/* Timer proc messages are not dispatched to the window proc,
* and therefore not logged.
s_msg.descr = "msg_loop";
add_message(&s_msg);
}
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
end_ticks = GetTickCount();
default_hover_time = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = SystemParametersInfo(SPI_GETMOUSEHOVERTIME, 0, &default_hover_time, 0);
+ ret = SystemParametersInfoA(SPI_GETMOUSEHOVERTIME, 0, &default_hover_time, 0);
ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
"SystemParametersInfo(SPI_GETMOUSEHOVERTIME) error %u\n", GetLastError());
if (!ret) default_hover_time = 400;
trace("SPI_GETMOUSEHOVERTIME returned %u ms\n", default_hover_time);
SetLastError(0xdeadbeef);
- ret = SystemParametersInfo(SPI_GETMOUSEHOVERWIDTH, 0, &hover_width, 0);
+ ret = SystemParametersInfoA(SPI_GETMOUSEHOVERWIDTH, 0, &hover_width, 0);
ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
"SystemParametersInfo(SPI_GETMOUSEHOVERWIDTH) error %u\n", GetLastError());
if (!ret) hover_width = 4;
SetLastError(0xdeadbeef);
- ret = SystemParametersInfo(SPI_GETMOUSEHOVERHEIGHT, 0, &hover_height, 0);
+ ret = SystemParametersInfoA(SPI_GETMOUSEHOVERHEIGHT, 0, &hover_height, 0);
ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
"SystemParametersInfo(SPI_GETMOUSEHOVERHEIGHT) error %u\n", GetLastError());
if (!ret) hover_height = 4;
trace("hover rect is %u x %d\n", hover_width, hover_height);
- hwnd = CreateWindowEx(0, "TestWindowClass", NULL,
+ hwnd = CreateWindowExA(0, "TestWindowClass", NULL,
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
NULL, NULL, 0);
assert(hwnd);
- hchild = CreateWindowEx(0, "TestWindowClass", NULL,
+ hchild = CreateWindowExA(0, "TestWindowClass", NULL,
WS_CHILD | WS_BORDER | WS_VISIBLE,
50, 50, 200, 200, hwnd,
NULL, NULL, 0);
RECT win_rc, work_rc = {0, 0, 0, 0};
#define WS_BASE (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_POPUP|WS_CLIPSIBLINGS)
- hwnd = CreateWindowEx(0, "ShowWindowClass", NULL, WS_BASE,
+ hwnd = CreateWindowExA(0, "ShowWindowClass", NULL, WS_BASE,
120, 120, 90, 90,
0, 0, 0, NULL);
assert(hwnd);
- style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_BASE;
+ style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE;
ok(style == 0, "expected style 0, got %08x\n", style);
flush_events();
idx = (sw[i].cmd == SW_NORMALNA) ? 12 : sw[i].cmd;
- style = GetWindowLong(hwnd, GWL_STYLE);
+ style = GetWindowLongA(hwnd, GWL_STYLE);
trace("%d: sending %s, current window style %08x\n", i+1, sw_cmd_name[idx], style);
ret = ShowWindow(hwnd, sw[i].cmd);
ok(!ret == !sw[i].ret, "%d: cmd %s: expected ret %lu, got %lu\n", i+1, sw_cmd_name[idx], sw[i].ret, ret);
- style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_BASE;
+ style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE;
ok(style == sw[i].style, "%d: expected style %08x, got %08x\n", i+1, sw[i].style, style);
sprintf(comment, "%d: ShowWindow(%s)", i+1, sw_cmd_name[idx]);
static void test_dialog_messages(void)
{
- WNDCLASS cls;
+ WNDCLASSA cls;
HWND hdlg, hedit1, hedit2, hfocus;
LRESULT ret;
#define set_selection(hctl, start, end) \
- ret = SendMessage(hctl, EM_SETSEL, start, end); \
+ ret = SendMessageA(hctl, EM_SETSEL, start, end); \
ok(ret == 1, "EM_SETSEL returned %ld\n", ret);
#define check_selection(hctl, start, end) \
- ret = SendMessage(hctl, EM_GETSEL, 0, 0); \
+ ret = SendMessageA(hctl, EM_GETSEL, 0, 0); \
ok(ret == MAKELRESULT(start, end), "wrong selection (%d - %d)\n", LOWORD(ret), HIWORD(ret));
subclass_edit();
- hdlg = CreateWindowEx(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL,
+ hdlg = CreateWindowExA(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL,
WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_DLGFRAME,
0, 0, 100, 100, 0, 0, 0, NULL);
ok(hdlg != 0, "Failed to create custom dialog window\n");
- hedit1 = CreateWindowEx(0, "my_edit_class", NULL,
+ hedit1 = CreateWindowExA(0, "my_edit_class", NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|WS_TABSTOP,
0, 0, 80, 20, hdlg, (HMENU)1, 0, NULL);
ok(hedit1 != 0, "Failed to create edit control\n");
- hedit2 = CreateWindowEx(0, "my_edit_class", NULL,
+ hedit2 = CreateWindowExA(0, "my_edit_class", NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|WS_TABSTOP,
0, 40, 80, 20, hdlg, (HMENU)2, 0, NULL);
ok(hedit2 != 0, "Failed to create edit control\n");
- SendMessage(hedit1, WM_SETTEXT, 0, (LPARAM)"hello");
- SendMessage(hedit2, WM_SETTEXT, 0, (LPARAM)"bye");
+ SendMessageA(hedit1, WM_SETTEXT, 0, (LPARAM)"hello");
+ SendMessageA(hedit2, WM_SETTEXT, 0, (LPARAM)"bye");
hfocus = GetFocus();
ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
ok(hfocus == 0, "wrong focus %p\n", hfocus);
flush_sequence();
- ret = DefDlgProc(hdlg, WM_SETFOCUS, 0, 0);
+ ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0);
ok(ret == 0, "WM_SETFOCUS returned %ld\n", ret);
ok_sequence(WmDefDlgSetFocus_1, "DefDlgProc(WM_SETFOCUS) 1", FALSE);
check_selection(hedit2, 0, 3);
flush_sequence();
- ret = DefDlgProc(hdlg, WM_SETFOCUS, 0, 0);
+ ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0);
ok(ret == 0, "WM_SETFOCUS returned %ld\n", ret);
ok_sequence(WmDefDlgSetFocus_2, "DefDlgProc(WM_SETFOCUS) 2", FALSE);
#undef set_selection
#undef check_selection
- ok(GetClassInfo(0, "#32770", &cls), "GetClassInfo failed\n");
+ ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
cls.lpszClassName = "MyDialogClass";
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
/* need a cast since a dlgproc is used as a wndproc */
cls.lpfnWndProc = test_dlg_proc;
- if (!RegisterClass(&cls)) assert(0);
+ if (!RegisterClassA(&cls)) assert(0);
- hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0);
+ hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE);
EndDialog(hdlg, 0);
DestroyWindow(hdlg);
flush_sequence();
- hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", 0, NULL, 0);
+ hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, NULL, 0);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
ok_sequence(WmCreateDialogParamSeq_2, "CreateDialogParam_2", FALSE);
EndDialog(hdlg, 0);
DestroyWindow(hdlg);
flush_sequence();
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
}
static void test_EndDialog(void)
{
HWND hparent, hother, hactive, hdlg;
- WNDCLASS cls;
+ WNDCLASSA cls;
hparent = CreateWindowExA(0, "TestParentClass", "Test parent",
WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_DISABLED,
100, 100, 200, 200, 0, 0, 0, NULL);
ok (hother != 0, "Failed to create parent window\n");
- ok(GetClassInfo(0, "#32770", &cls), "GetClassInfo failed\n");
+ ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
cls.lpszClassName = "MyDialogClass";
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.lpfnWndProc = test_dlg_proc;
- if (!RegisterClass(&cls)) assert(0);
+ if (!RegisterClassA(&cls)) assert(0);
flush_sequence();
SetForegroundWindow(hother);
/* create a dialog where the parent is disabled, this parent should still
receive the focus when the dialog exits (even though "normally" a
disabled window should not receive the focus) */
- hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", hparent, test_dlg_proc, 0);
+ hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", hparent, test_dlg_proc, 0);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
SetForegroundWindow(hdlg);
hactive = GetForegroundWindow();
DestroyWindow( hother );
DestroyWindow( hparent );
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
}
static void test_nullCallback(void)
return;
}
- hkl_greek = LoadKeyboardLayout( "00000408", 0 );
+ hkl_greek = LoadKeyboardLayoutA( "00000408", 0 );
if (!hkl_greek || hkl_greek == hkl_orig /* win2k */)
{
skip( "Unable to load Greek keyboard layout\n" );
check_lb_state(listbox, 0, LB_ERR, 0, 0);
- ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
+ ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
ok(ret == 0, "expected 0, got %ld\n", ret);
- ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
+ ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
ok(ret == 1, "expected 1, got %ld\n", ret);
- ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
+ ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
ok(ret == 2, "expected 2, got %ld\n", ret);
check_lb_state(listbox, 3, LB_ERR, 0, 0);
log_all_parent_messages++;
trace("selecting item 0\n");
- ret = SendMessage(listbox, LB_SETCURSEL, 0, 0);
+ ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0);
ok(ret == 0, "expected 0, got %ld\n", ret);
ok_sequence(wm_lb_setcursel_0, "LB_SETCURSEL 0", FALSE );
check_lb_state(listbox, 3, 0, 0, 0);
flush_sequence();
trace("selecting item 1\n");
- ret = SendMessage(listbox, LB_SETCURSEL, 1, 0);
+ ret = SendMessageA(listbox, LB_SETCURSEL, 1, 0);
ok(ret == 1, "expected 1, got %ld\n", ret);
ok_sequence(wm_lb_setcursel_1, "LB_SETCURSEL 1", FALSE );
check_lb_state(listbox, 3, 1, 1, 0);
trace("selecting item 2\n");
- ret = SendMessage(listbox, LB_SETCURSEL, 2, 0);
+ ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0);
ok(ret == 2, "expected 2, got %ld\n", ret);
ok_sequence(wm_lb_setcursel_2, "LB_SETCURSEL 2", FALSE );
check_lb_state(listbox, 3, 2, 2, 0);
trace("clicking on item 0\n");
- ret = SendMessage(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(1, 1));
+ ret = SendMessageA(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(1, 1));
ok(ret == LB_OKAY, "expected LB_OKAY, got %ld\n", ret);
- ret = SendMessage(listbox, WM_LBUTTONUP, 0, 0);
+ ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
ok(ret == LB_OKAY, "expected LB_OKAY, got %ld\n", ret);
ok_sequence(wm_lb_click_0, "WM_LBUTTONDOWN 0", FALSE );
check_lb_state(listbox, 3, 0, 0, 0);
flush_sequence();
trace("deleting item 0\n");
- ret = SendMessage(listbox, LB_DELETESTRING, 0, 0);
+ ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
ok(ret == 2, "expected 2, got %ld\n", ret);
ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE );
check_lb_state(listbox, 2, -1, 0, 0);
flush_sequence();
trace("deleting item 0\n");
- ret = SendMessage(listbox, LB_DELETESTRING, 0, 0);
+ ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
ok(ret == 1, "expected 1, got %ld\n", ret);
ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE );
check_lb_state(listbox, 1, -1, 0, 0);
flush_sequence();
trace("deleting item 0\n");
- ret = SendMessage(listbox, LB_DELETESTRING, 0, 0);
+ ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
ok(ret == 0, "expected 0, got %ld\n", ret);
ok_sequence(wm_lb_deletestring_reset, "LB_DELETESTRING 0", FALSE );
check_lb_state(listbox, 0, -1, 0, 0);
flush_sequence();
trace("deleting item 0\n");
- ret = SendMessage(listbox, LB_DELETESTRING, 0, 0);
+ ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
ok(ret == LB_ERR, "expected LB_ERR, got %ld\n", ret);
check_lb_state(listbox, 0, -1, 0, 0);
flush_sequence();
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(0);
cls.hIcon = 0;
- cls.hCursor = LoadCursorA(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "TestMenuClass";
- UnregisterClass(cls.lpszClassName, cls.hInstance);
+ UnregisterClassA(cls.lpszClassName, cls.hInstance);
if (!RegisterClassA(&cls)) assert(0);
SetLastError(0xdeadbeef);
ok(hwnd != 0, "LoadMenuA error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- hmenu = LoadMenuA(GetModuleHandle(0), MAKEINTRESOURCE(1));
+ hmenu = LoadMenuA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1));
ok(hmenu != 0, "LoadMenuA error %u\n", GetLastError());
SetMenu(hwnd, hmenu);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_RETURN, 0, 0, 0);
keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
if (!sequence_cnt) /* we didn't get any message */
{
keybd_event(VK_RIGHT, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_RETURN, 0, 0, 0);
keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(wm_popup_menu_2, "submenu of a popup menu command", FALSE);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_ESCAPE, 0, 0, 0);
keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(wm_single_menu_item, "single menu item command", FALSE);
keybd_event(VK_RIGHT, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_RETURN, 0, 0, 0);
keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(wm_popup_menu_3, "submenu of a popup menu command", FALSE);
if (PeekMessageA(&msg, 0, 0, 0, 1))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
}
DestroyWindow(hwnd);
flush_events();
- PostMessage(hwnd, WM_USER+1, 0x1234, 0x5678);
- PostMessage(0, WM_USER+2, 0x5678, 0x1234);
+ PostMessageA(hwnd, WM_USER+1, 0x1234, 0x5678);
+ PostMessageA(0, WM_USER+2, 0x5678, 0x1234);
for (i = 0; i < sizeof(data)/sizeof(data[0]); i++)
{
{
MSG msg;
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
Sleep( 200 );
MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT );
return 0;
static void do_wait_idle_child( int arg )
{
- WNDCLASS cls;
+ WNDCLASSA cls;
MSG msg;
HWND hwnd = 0;
HANDLE thread;
HANDLE end_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_end" );
memset( &cls, 0, sizeof(cls) );
- cls.lpfnWndProc = DefWindowProc;
+ cls.lpfnWndProc = DefWindowProcA;
cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
- cls.hCursor = LoadCursor(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.lpszClassName = "TestClass";
- RegisterClass( &cls );
+ RegisterClassA( &cls );
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */
ok( start_event != 0, "failed to create start event, error %u\n", GetLastError() );
ok( end_event != 0, "failed to create end event, error %u\n", GetLastError() );
case 1:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, 0, 0, 0, PM_REMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
break;
case 2:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );
- PostThreadMessage( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd );
- PeekMessage( &msg, 0, 0, 0, PM_REMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
+ PostThreadMessageA( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd );
+ PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
break;
case 3:
SetEvent( start_event );
Sleep( 200 );
- SendMessage( HWND_BROADCAST, WM_WININICHANGE, 0, 0 );
+ SendMessageA( HWND_BROADCAST, WM_WININICHANGE, 0, 0 );
break;
case 4:
SetEvent( start_event );
Sleep( 200 );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
break;
case 5:
SetEvent( start_event );
Sleep( 200 );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
break;
case 6:
SetEvent( start_event );
Sleep( 200 );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
- while (PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ))
+ while (PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ))
{
- GetMessage( &msg, 0, 0, 0 );
- DispatchMessage( &msg );
+ GetMessageA( &msg, 0, 0, 0 );
+ DispatchMessageA( &msg );
}
break;
case 7:
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
SetTimer( hwnd, 3, 1, NULL );
Sleep( 200 );
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
break;
case 8:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT );
break;
case 9:
SetEvent( start_event );
Sleep( 200 );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
- for (;;) GetMessage( &msg, 0, 0, 0 );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
+ for (;;) GetMessageA( &msg, 0, 0, 0 );
break;
case 10:
SetEvent( start_event );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
SetTimer( hwnd, 3, 1, NULL );
Sleep( 200 );
- while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
break;
case 11:
SetEvent( start_event );
Sleep( 200 );
return; /* exiting the process makes WaitForInputIdle return success too */
case 12:
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
Sleep( 200 );
MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT );
SetEvent( start_event );
break;
case 13:
SetEvent( start_event );
- PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
Sleep( 200 );
thread = CreateThread( NULL, 0, do_wait_idle_child_thread, NULL, 0, &id );
WaitForSingleObject( thread, 10000 );
case 14:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE );
break;
case 15:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE );
break;
case 16:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE );
break;
case 17:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE );
break;
case 18:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE );
break;
case 19:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE );
break;
case 20:
SetEvent( start_event );
Sleep( 200 );
- PeekMessage( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE );
+ PeekMessageA( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE );
break;
}
WaitForSingleObject( end_event, 2000 );
static DWORD CALLBACK wait_idle_thread( void *arg )
{
- WNDCLASS cls;
+ WNDCLASSA cls;
MSG msg;
HWND hwnd;
memset( &cls, 0, sizeof(cls) );
cls.lpfnWndProc = wait_idle_proc;
cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
- cls.hCursor = LoadCursor(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.lpszClassName = "TestClass";
- RegisterClass( &cls );
+ RegisterClassA( &cls );
hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
- while (GetMessage( &msg, 0, 0, 0 )) DispatchMessage( &msg );
+ while (GetMessageA( &msg, 0, 0, 0 )) DispatchMessageA( &msg );
DestroyWindow(hwnd);
return 0;
}
}
}
CloseHandle( start_event );
- PostThreadMessage( id, WM_QUIT, 0, 0 );
+ PostThreadMessageA( id, WM_QUIT, 0, 0 );
WaitForSingleObject( thread, 10000 );
CloseHandle( thread );
}
HWND parent1, parent2, child, popup;
RECT rc, rc_old;
- parent1 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
+ parent1 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
100, 100, 200, 200, 0, 0, 0, NULL);
ok(parent1 != 0, "Failed to create parent1 window\n");
- parent2 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
+ parent2 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
400, 100, 200, 200, 0, 0, 0, NULL);
ok(parent2 != 0, "Failed to create parent2 window\n");
/* WS_CHILD window */
- child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE,
+ child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE,
10, 10, 150, 150, parent1, 0, 0, NULL);
ok(child != 0, "Failed to create child window\n");
rc.left, rc.top, rc.right, rc.bottom );
/* WS_POPUP window */
- popup = CreateWindowEx(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE,
+ popup = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE,
20, 20, 100, 100, 0, 0, 0, NULL);
ok(popup != 0, "Failed to create popup window\n");
BYTE keyboard_state[256];
MSG msg;
- test_window = CreateWindowEx(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ test_window = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
100, 100, 200, 200, 0, 0, 0, NULL);
flush_events();
/* keyup without a keydown */
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyReleaseOnly, "key release only", TRUE);
key_state = GetAsyncKeyState(0x41);
/* keydown */
keybd_event(0x41, 0, 0, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyPressNormal, "key press only", FALSE);
key_state = GetAsyncKeyState(0x41);
/* keydown repeat */
keybd_event(0x41, 0, 0, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyPressRepeat, "key press repeat", FALSE);
key_state = GetAsyncKeyState(0x41);
/* keyup */
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyReleaseNormal, "key release repeat", FALSE);
key_state = GetAsyncKeyState(0x41);
/* keydown */
keybd_event(0x41, 0, 0, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyPressRepeat, "key press after setkeyboardstate", TRUE);
key_state = GetAsyncKeyState(0x41);
/* keyup */
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmKeyReleaseOnly, "key release after setkeyboardstate", TRUE);
key_state = GetAsyncKeyState(0x41);
return;
}
- test_window = CreateWindowEx(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ test_window = CreateWindowExA(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
100, 100, 200, 200, 0, 0, 0, NULL);
flush_sequence();
goto end;
}
- hKBD_hook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, GetModuleHandle(NULL), 0);
+ hKBD_hook = SetWindowsHookExA(WH_KEYBOARD_LL, KeyboardHookProc, GetModuleHandleA(NULL), 0);
if (!hKBD_hook) win_skip("WH_KEYBOARD_LL is not supported\n");
/* Same key combination, different id */
/* Inject the appropriate key sequence */
keybd_event(VK_LWIN, 0, 0, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmHotkeyPressLWIN, "window hotkey press LWIN", FALSE);
keybd_event(hotkey_letter, 0, 0, 0);
queue_status = GetQueueStatus(QS_HOTKEY);
ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_HOTKEY)
{
ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam);
}
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyPress, "window hotkey press", FALSE);
ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmHotkeyRelease, "window hotkey release", TRUE);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmHotkeyReleaseLWIN, "window hotkey release LWIN", FALSE);
/* normal posted WM_HOTKEY messages set QS_HOTKEY */
- PostMessage(test_window, WM_HOTKEY, 0, 0);
+ PostMessageA(test_window, WM_HOTKEY, 0, 0);
queue_status = GetQueueStatus(QS_HOTKEY);
ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status);
queue_status = GetQueueStatus(QS_POSTMESSAGE);
ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %x\n", queue_status);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
+ DispatchMessageA(&msg);
flush_sequence();
/* Send and process all messages at once */
- PostMessage(test_window, WM_APP, 0, 0);
+ PostMessageA(test_window, WM_APP, 0, 0);
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(hotkey_letter, 0, 0, 0);
keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_HOTKEY)
{
ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam);
}
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyCombined, "window hotkey combined", FALSE);
keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
+ DispatchMessageA(&msg);
ok_sequence(WmHotkeyPrevious, "window hotkey previous", FALSE);
/* New key combination works */
keybd_event(hotkey_letter, 0, 0, 0);
keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_HOTKEY)
{
ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
ok(msg.lParam == MAKELPARAM(0, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam);
}
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyNew, "window hotkey new", FALSE);
/* Inject the appropriate key sequence */
keybd_event(VK_LWIN, 0, 0, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyPressLWIN, "thread hotkey press LWIN", FALSE);
keybd_event(hotkey_letter, 0, 0, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_HOTKEY)
{
}
else
ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyPress, "thread hotkey press", FALSE);
keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyRelease, "thread hotkey release", TRUE);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
- DispatchMessage(&msg);
+ DispatchMessageA(&msg);
}
ok_sequence(WmHotkeyReleaseLWIN, "thread hotkey release LWIN", FALSE);
HANDLE hthread;
DWORD ret, tid;
- wnd_event.start_event = CreateEvent(NULL, 0, 0, NULL);
+ wnd_event.start_event = CreateEventW(NULL, 0, 0, NULL);
ok(wnd_event.start_event != 0, "CreateEvent error %d\n", GetLastError());
hthread = CreateThread(NULL, 0, thread_proc, &wnd_event, 0, &tid);
ok(hthread != 0, "CreateThread error %d\n", GetLastError());
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
CloseHandle(wnd_event.start_event);
- parent = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
+ parent = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
0, 0, 0, 0, 0, 0, 0, NULL);
ok(parent != 0, "failed to create parent window\n");
- child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD,
+ child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD,
0, 0, 0, 0, parent, 0, 0, NULL);
ok(child != 0, "failed to create child window\n");
log_all_parent_messages++;
old_focus = SetFocus(child);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmSetFocus_1, "SetFocus on a child window", TRUE);
ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == child, "expected focus %p, got %p\n", child, GetFocus());
old_focus = SetFocus(parent);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmSetFocus_2, "SetFocus on a parent window", FALSE);
ok(old_focus == child, "expected old focus %p, got %p\n", child, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_focus = SetFocus((HWND)0xdeadbeef);
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef),
"expected ERROR_INVALID_WINDOW_HANDLE, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetFocus on an invalid window", FALSE);
ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_focus = SetFocus(GetDesktopWindow());
ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ ||
broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetFocus on a desktop window", TRUE);
ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_focus = SetFocus(wnd_event.hwnd);
ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ ||
broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetFocus on another thread window", TRUE);
ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_active = SetActiveWindow((HWND)0xdeadbeef);
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef),
"expected ERROR_INVALID_WINDOW_HANDLE, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetActiveWindow on an invalid window", FALSE);
ok(old_active == 0, "expected old focus 0, got %p\n", old_active);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_active = SetActiveWindow(GetDesktopWindow());
todo_wine
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetActiveWindow on a desktop window", TRUE);
ok(old_active == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
old_active = SetActiveWindow(wnd_event.hwnd);
todo_wine
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetActiveWindow on another thread window", TRUE);
ok(old_active == 0, "expected old focus 0, got %p\n", old_active);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
flush_sequence();
old_focus = SetFocus(wnd_event.hwnd);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(old_focus == wnd_event.hwnd, "expected old focus %p, got %p\n", wnd_event.hwnd, old_focus);
ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow());
ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus());
old_focus = SetFocus(parent);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
flush_sequence();
old_active = SetActiveWindow(wnd_event.hwnd);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(old_active == parent, "expected old focus %p, got %p\n", parent, old_active);
ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow());
ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus());
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
old_focus = SetFocus(parent);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
ok(GetLastError() == ERROR_INVALID_PARAMETER /* Vista+ */ ||
broken(GetLastError() == 0) /* XP */ ||
broken(GetLastError() == 0xdeadbeef), "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmSetFocus_3, "SetFocus on a child window", TRUE);
ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
SetLastError(0xdeadbeef);
old_active = SetActiveWindow(child);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(WmEmptySeq, "SetActiveWindow on a child window", FALSE);
ok(old_active == parent, "expected old active %p, got %p\n", parent, old_active);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
DestroyWindow(child);
DestroyWindow(parent);
- ret = PostMessage(wnd_event.hwnd, WM_QUIT, 0, 0);
+ ret = PostMessageA(wnd_event.hwnd, WM_QUIT, 0, 0);
ok(ret, "PostMessage(WM_QUIT) error %d\n", GetLastError());
ret = WaitForSingleObject(hthread, INFINITE);
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
- SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
+ SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE );
ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
ok( rect.right == client.right - 150 && rect.bottom == client.bottom - 50,
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
- SetWindowLong( hwnd, GWL_STYLE,
- GetWindowLong(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) );
+ SetWindowLongA( hwnd, GWL_STYLE,
+ GetWindowLongA(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) );
ok_sequence( WmSetLayeredStyle2, "WmSetLayeredStyle2", FALSE );
size.cx = 200;
ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
- SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
+ SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE );
GetWindowRect( hwnd, &rect );
ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450,
broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50),
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
- SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
+ SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
info.hwnd = hwnd;
info.hdc = hdc;
info.size.cx = 250;
DeleteObject( bmp );
}
+static void init_funcs(void)
+{
+ HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");
+
+#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f)
+ X(ActivateActCtx);
+ X(CreateActCtxW);
+ X(DeactivateActCtx);
+ X(GetCurrentActCtx);
+ X(ReleaseActCtx);
+#undef X
+}
+
START_TEST(msg)
{
char **test_argv;
BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, "IsWinEventHookInstalled");*/
HMODULE hModuleImm32;
BOOL (WINAPI *pImmDisableIME)(DWORD);
+ int argc;
+
+ init_funcs();
- int argc = winetest_get_mainargs( &test_argv );
+ argc = winetest_get_mainargs( &test_argv );
if (argc >= 3)
{
unsigned int arg;
init_procs();
- hModuleImm32 = LoadLibrary("imm32.dll");
+ hModuleImm32 = LoadLibraryA("imm32.dll");
if (hModuleImm32) {
pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME");
if (pImmDisableIME)
assert(hdc);
SetLastError(0xdeadbeef);
- ret = DrawState(hdc, GetStockObject(DKGRAY_BRUSH), NULL, (LPARAM)text, strlen(text),
+ ret = DrawStateA(hdc, GetStockObject(DKGRAY_BRUSH), NULL, (LPARAM)text, strlen(text),
0, 0, 10, 10, DST_TEXT);
ok(ret, "DrawState error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- ret = DrawState(hdc, GetStockObject(DKGRAY_BRUSH), NULL, (LPARAM)text, 0,
+ ret = DrawStateA(hdc, GetStockObject(DKGRAY_BRUSH), NULL, (LPARAM)text, 0,
0, 0, 10, 10, DST_TEXT);
ok(ret, "DrawState error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- ret = DrawState(hdc, GetStockObject(DKGRAY_BRUSH), NULL, 0, strlen(text),
+ ret = DrawStateA(hdc, GetStockObject(DKGRAY_BRUSH), NULL, 0, strlen(text),
0, 0, 10, 10, DST_TEXT);
ok(!ret || broken(ret) /* win98 */, "DrawState succeeded\n");
ok(GetLastError() == 0xdeadbeef, "not expected error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- ret = DrawState(hdc, GetStockObject(DKGRAY_BRUSH), NULL, 0, 0,
+ ret = DrawStateA(hdc, GetStockObject(DKGRAY_BRUSH), NULL, 0, 0,
0, 0, 10, 10, DST_TEXT);
ok(!ret || broken(ret) /* win98 */, "DrawState succeeded\n");
ok(GetLastError() == 0xdeadbeef, "not expected error %u\n", GetLastError());