[Windows 8 General] windowsrtc:
Hello

I have read http://xdaforums.com/showthread.php?t=1944675,and Im able to to compile single cpp file using cl.exe with /D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE

Here are my questions:

1.how can I compile arm project by VS2012 IDE?

2.how can I create arm version lib such as gdi32.lib that doesnt come with VS2012?

Here is my win32 cretewindow example :

#pragma comment(lib, "kernel32.lib")

#pragma comment(lib, "user32.lib")

#include <windows.h>

#include <string.h>

#include <iostream>

MainWndProc (HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam)

{

static HWND hwndButton = 0;

static HWND hEdit = 0;

static int cx, cy;

HDC hdc;

PAINTSTRUCT ps;

RECT rc;

switch (nMsg)

{

case WM_CREATE:

{

TEXTMETRIC tm;

hdc = GetDC (hwnd);

//SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT));

//GetTextMetrics (hdc, &tm);

cx = tm.tmAveCharWidth * 30;

cy = (tm.tmHeight + tm.tmExternalLeading) * 2;

ReleaseDC (hwnd, hdc);

hwndButton = CreateWindow (

"button",

"Click Here",

WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,

0, 0, cx, cy,

hwnd,

(HMENU) 1,

((LPCREATESTRUCT) lParam)->hInstance,

NULL

);

hEdit = CreateWindow( //edit控件

"edit",

"create",

WS_VISIBLE|WS_CHILD|WS_BORDER/*|DT_CENTER*/|DT_VCENTER,

100,70,100,25,

hwnd,

NULL,

NULL,

NULL);

return 0;

break;

}

case WM_DESTROY:

PostQuitMessage (0);

return 0;

break;

case WM_PAINT:

hdc = BeginPaint (hwnd, &ps);

GetClientRect (hwnd, &rc);

rc.bottom = rc.bottom / 2;

DrawText (hdc, "Hello, World!", -1, &rc,

DT_SINGLELINE | DT_CENTER | DT_VCENTER);

EndPaint (hwnd, &ps);

return 0;

break;

case WM_SIZE:

if (hwndButton &&

(wParam == SIZEFULLSCREEN ||

wParam == SIZENORMAL)

)

{

rc.left = (LOWORD(lParam) - cx) / 2;

rc.top = HIWORD(lParam) * 3 / 4 - cy / 2;

MoveWindow (

hwndButton,

rc.left, rc.top, cx, cy, TRUE);

}

break;

case WM_COMMAND:

if (LOWORD(wParam) == 1 &&

HIWORD(wParam) == BN_CLICKED &&

(HWND) lParam == hwndButton)

{

DestroyWindow (hwnd);

}

return 0;

break;

}

return DefWindowProc (hwnd, nMsg, wParam, lParam);

}

int WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)

{

HWND hwndMain;

MSG msg;

WNDCLASSEX wndclass;

char*szMainWndClass = "WinTestWin";

memset (&wndclass, 0, sizeof(WNDCLASSEX));

wndclass.lpszClassName = szMainWndClass;

wndclass.cbSize = sizeof(WNDCLASSEX);

wndclass.style = CS_HREDRAW | CS_VREDRAW;

wndclass.lpfnWndProc = MainWndProc;

wndclass.hInstance = hInst;

wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);

wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION);

wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);

//wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);

RegisterClassEx (&wndclass);

hwndMain = CreateWindow (

szMainWndClass,

"Hello",

WS_OVERLAPPEDWINDOW,

CW_USEDEFAULT,

CW_USEDEFAULT,

CW_USEDEFAULT,

CW_USEDEFAULT,

NULL,

NULL,

hInst,

NULL

);

ShowWindow (hwndMain, nShow);

UpdateWindow (hwndMain);

while (GetMessage (&msg, NULL, 0, 0))

{

TranslateMessage (&msg);

DispatchMessage (&msg);

}

return msg.wParam;

}

its able to run on my surface. GetStockObject,SelectObject and GetTextMetrics is in gdi32.lib but i dont have it so the running exe looks strange after redraw.

Im a beginner .Please help.