00001
00002
00003
#include "aw.h"
00004
00005 ULONGLONG
AW(msProfPeekMessage)(HDC hdc, ULONG Iter)
00006 {
00007
00008 MSG
msg;
00009
INIT_TIMER;
00010
00011
START_TIMER;
00012
00013
while (ix--)
00014 {
00015
AW(PeekMessage)(&
msg,
NULL, 0, 0, PM_REMOVE);
00016 }
00017
00018
END_TIMER;
00019 }
00020
00021 ULONGLONG
AW(msProfDispatchMessage)(HDC hdc, ULONG Iter)
00022 {
00023
00024 HWND hwnd;
00025 MSG
msg;
00026
INIT_TIMER;
00027
AW(WNDCLASS) wc;
00028
00029 wc.style = 0;
00030 wc.lpfnWndProc = CreateDestroyWndProc;
00031 wc.cbClsExtra = 0;
00032 wc.cbWndExtra = 0;
00033 wc.hInstance = ghinst;
00034 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH);
00035 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00036 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
00037 wc.lpszMenuName = NULL;
00038 wc.lpszClassName = L("CreateDestroyWindow");
00039
00040 if (!AW(RegisterClass)(&wc)) {
00041 MessageBox(
GetParent(ghwndMDIClient),
"14RegisterClass call failed.",
00042
"ERROR!", MB_OK);
00043
return (ULONGLONG)(0);
00044 }
00045
00046 hwnd =
AW(CreateWindow)(
L(
"CreateDestroyWindow"),
NULL, WS_CHILD,
00047 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00048
ghwndMDIClient,
NULL,
ghinst,
NULL);
00049
00050
msg.hwnd = hwnd;
00051
msg.message = WM_MOUSEMOVE;
00052
msg.wParam = 1;
00053
msg.lParam = 2;
00054
msg.time = 3;
00055
msg.pt.x = 4;
00056
msg.pt.y = 5;
00057
00058
START_TIMER;
00059
00060
while (ix--)
00061 {
00062
AW(DispatchMessage)(&
msg);
00063 }
00064
00065
END_TIMER_NO_RETURN;
00066
00067
DestroyWindow(hwnd);
00068
AW(UnregisterClass)(
L(
"CreateDestroyWindow"),
ghinst);
00069
00070
RETURN_STOP_TIME;
00071
00072 }
00073
00074 ULONGLONG
AW(msProfCharXXX)(HDC hDC, ULONG Iter,
00075
BOOL (WINAPI *tester)(
IF(
char,WCHAR)))
00076 {
00077
static const IF(
char,WCHAR) sample[] =
00078 L("The quick brown fox jumps over the lazy dog")
00079 L("0123456789")
00080 L("Jackdaws love my big sphinx of quartz");
00081 INIT_TIMER;
00082
00083 START_TIMER;
00084 while (ix--) {
00085
const IF(
char,WCHAR)* p = sample;
00086
while (*p) {
00087 tester(*p++);
00088 }
00089 }
00090
END_TIMER;
00091 }
00092
00093
00094 ULONGLONG
AW(msProfCharUpper)(HDC hDC, ULONG Iter)
00095 {
00096
return AW(msProfCharXXX)(hDC, Iter,
AW(IsCharUpper));
00097 }
00098
00099 ULONGLONG
AW(msProfCharLower)(HDC hDC, ULONG Iter)
00100 {
00101
return AW(msProfCharXXX)(hDC, Iter,
AW(IsCharLower));
00102 }
00103
00104 ULONGLONG
AW(msProfCharNext)(HDC hDC, ULONG Iter)
00105 {
00106
static const IF(
char,WCHAR) sample[] =
00107 L("The quick brown fox jumps over the lazy dog")
00108 L("0123456789")
00109 L("Jackdaws love my big sphinx of quartz");
00110 INIT_TIMER;
00111
00112 START_TIMER;
00113 while (ix--) {
00114
const IF(
char,WCHAR)* p = sample;
00115
while (*p) {
00116
AW(CharNext)(p++);
00117 }
00118 }
00119
END_TIMER;
00120 }
00121
00122 ULONGLONG
AW(msProfGetMessage)(HDC hDC, ULONG Iter)
00123 {
00124 MSG
msg;
00125
AW(WNDCLASS) wc;
00126 HWND hwnd;
00127 RECT rect;
00128 static const IF(
char, WCHAR)* className = L("GetMessageTest");
00129 INIT_TIMER;
00130
00131 wc.style = 0;
00132 wc.lpfnWndProc = IF(CreateDestroyWndProc, CreateDestroyWndProcW);
00133 wc.cbClsExtra = 0;
00134 wc.cbWndExtra = 0;
00135 wc.hInstance = ghinst;
00136 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH);
00137 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00138 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
00139 wc.lpszMenuName = NULL;
00140 wc.lpszClassName = className;
00141
00142 if (!AW(RegisterClass)(&wc)) {
00143 MessageBox(
GetParent(ghwndMDIClient),
"RegisterClass call failed.",
00144
"ERROR!", MB_OK);
00145
return FALSE;
00146 }
00147
00148 hwnd =
AW(CreateWindow)(className,
NULL,
00149 WS_OVERLAPPEDWINDOW,
00150 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00151
NULL,
NULL,
ghinst,
NULL);
00152
if (hwnd ==
NULL) {
00153 MessageBox(
GetParent(ghwndMDIClient),
"CreateWindow call failed.",
00154
"ERROR!", MB_OK);
00155
return 0;
00156 }
00157
00158
START_TIMER;
00159
while (ix--) {
00160
START_OVERHEAD;
00161
AW(PostMessage)(hwnd, WM_MOUSEMOVE, 0, 0);
00162
END_OVERHEAD;
00163
AW(GetMessage)(&
msg, hwnd, 0, 0);
00164 }
00165
END_TIMER_NO_RETURN;
00166
00167
DestroyWindow(hwnd);
00168
AW(UnregisterClass)(className,
ghinst);
00169
00170
RETURN_STOP_TIME;
00171 }
00172
00173 ULONGLONG
AW(msProfGetWindowTextLength)(HDC hdc, ULONG Iter)
00174 {
00175
INIT_TIMER;
00176
static const IF(CHAR, WCHAR)* className =
L(
"GetWindowTextLengthTest");
00177
AW(WNDCLASS) wc;
00178 HWND hwnd;
00179
00180 wc.style = 0;
00181 wc.lpfnWndProc = AW(DefWindowProc);
00182 wc.cbClsExtra = 0;
00183 wc.cbWndExtra = 0;
00184 wc.hInstance = ghinst;
00185 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH);
00186 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00187 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
00188 wc.lpszMenuName = NULL;
00189 wc.lpszClassName = className;
00190
00191 if (!AW(RegisterClass)(&wc)) {
00192
DispErrorMsg(
"RegisterClass");
00193
return FALSE;
00194 }
00195
00196 hwnd =
AW(CreateWindow)(className,
NULL,
00197 WS_OVERLAPPEDWINDOW,
00198 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00199
NULL,
NULL,
ghinst,
NULL);
00200
if (hwnd ==
NULL) {
00201
DispErrorMsg(
"CreateWindow");
00202 }
00203
00204
AW(SetWindowText)(hwnd,
L(
"The quick brown fox jumps over the lazy dog"));
00205
00206
START_TIMER;
00207
00208
while (ix--)
00209 {
00210
AW(GetWindowTextLength)(hwnd);
00211 }
00212
00213
END_TIMER_NO_RETURN;
00214
00215
DestroyWindow(hwnd);
00216
AW(UnregisterClass)(className,
ghinst);
00217
00218
RETURN_STOP_TIME;
00219 }