1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
//Window class declaration
static TCHAR szAppName[] = TEXT ("Gaze Tracker program");
MSG msg;
WNDCLASS GazeTrackerMouse;
long Screen_Res_X = GetSystemMetrics ( SM_CXSCREEN ); //Screen size in x-axis
long Screen_Res_Y = GetSystemMetrics ( SM_CYSCREEN ); //Screen size in y-axis
GazeTrackerMouse.cbClsExtra = 0;
GazeTrackerMouse.cbWndExtra = 0;
GazeTrackerMouse.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
GazeTrackerMouse.hCursor = LoadCursor (NULL, IDC_ARROW);
GazeTrackerMouse.hIcon = LoadIcon (NULL, IDI_APPLICATION);
GazeTrackerMouse.hInstance = hInstance;
GazeTrackerMouse.lpfnWndProc = WndProc;
GazeTrackerMouse.lpszClassName = szAppName;
GazeTrackerMouse.lpszMenuName = NULL;
GazeTrackerMouse.style = CS_HREDRAW | CS_VREDRAW;
if (!RegisterClass (&GazeTrackerMouse))
{
MessageBox (NULL, TEXT ("Did not register window class"), szAppName, MB_ICONERROR);
return 0;
}
ehwnd = CreateWindowEx (
WS_EX_TOPMOST,
szAppName,
TEXT ("Gaze Tracker Mouse v2"),
WS_OVERLAPPEDWINDOW,
Screen_Res_X - 200,
Screen_Res_Y - (Screen_Res_Y - 50),
200,
Screen_Res_Y - 150,
NULL,
NULL,
hInstance,
NULL
);
hInst = hInstance;
ShowWindow (ehwnd, iCmdShow);
UpdateWindow (ehwnd);
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}
|