LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
static LPCTSTR TEST_STR[2]={_T("文字1"),_T("文字2")};
switch (message)
{
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
SelectObject(hdc, hFont); //フォントの選択
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 10, 10, TEST_STR[0], (int)_tcslen(TEST_STR[0]));
TextOut(hdc, 10, 32, TEST_STR[1], (int)_tcslen(TEST_STR[1]));
EndPaint(hWnd, &ps);
break;
}
}
[tips]
TextOut(
HDC hdc, //デバイスコンテキスト(書出し先)
int xp, //描画X座標
int yp; //描画Y座標
LPCTSTR text, //描画文字列
int length //textの長さ
);
|