*
*/
+/* TODO: AppBar */
#include "magnifier.h"
+#include <winbase.h>
+#include <winuser.h>
+#include <wingdi.h>
+#include <winnls.h>
+
+#include "resource.h"
+
const TCHAR szWindowClass[] = TEXT("MAGNIFIER");
#define MAX_LOADSTRING 100
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
+ switch (GetUserDefaultUILanguage())
+ {
+ case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+ SetProcessDefaultLayout(LAYOUT_RTL);
+ break;
+
+ default:
+ break;
+ }
+
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
MyRegisterClass(hInstance);
*/
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
+ RECT rcWorkArea;
hInst = hInstance; // Store instance handle in our global variable
- // Create the Window
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
+
+ /* Create the Window */
hMainWnd = CreateWindowEx(
- WS_EX_TOPMOST,
+ WS_EX_TOPMOST | WS_EX_PALETTEWINDOW,
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
+ (rcWorkArea.right - rcWorkArea.left) * 2 / 3,
+ 200,
NULL,
NULL,
hInstance,
HDC HdcStrech;
HANDLE hOld;
HBITMAP HbmpStrech;
-
+
RECT R;
RECT appRect;
DWORD rop = SRCCOPY;
/* Select our bitmap in memory DC and save the old one.*/
hOld = SelectObject (HdcStrech , HbmpStrech);
-
+
/* Paint the screen bitmap to our in memory DC */
BitBlt(
HdcStrech,
0,
0,
SRCCOPY);
-
+
/* Draw the mouse pointer in the right position */
DrawIcon(
HdcStrech ,
blitAreaY,
blitAreaWidth,
blitAreaHeight,
- rop);
-
+ rop | NOMIRRORBITMAP);
+
+
/* Cleanup.*/
if (iinfo.hbmMask)
DeleteObject(iinfo.hbmMask);
//Update to new position
pMouse = pNewMouse;
cp = pNewMouse;
- Refresh();
}
else if (((pCaret.x != pNewCaret.x) || (pCaret.y != pNewCaret.y)) && bFollowCaret)
{
//Update to new position
pCaret = pNewCaret;
cp = pNewCaret;
- Refresh();
}
else if (((pFocus.x != pNewFocus.x) || (pFocus.y != pNewFocus.y)) && bFollowFocus)
{
//Update to new position
pFocus = pNewFocus;
cp = pNewFocus;
- Refresh();
}
+ Refresh();
}
break;
case WM_COMMAND: