2006.12.14 Thursday
16:22 | posted by
gardener
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
int xPos;
int yPos;
char str[256];
switch ( message ) {
case WM_MOUSEMOVE:
xPos = ( int )LOWORD( lParam );
yPos = ( int )HIWORD( lParam );
wsprintf( str, "x=%03d y=%03d", xPos, yPos );
hdc = GetDC( hWnd ); // デバイスコンテキスト生成
TextOut( hdc, 1, 1, str, lstrlen( str ) );
ReleaseDC( hWnd, hdc ); // デバイスコンテキスト解放
break;
}
return 0;
}
Trackbacks
Trackback URL : http://gardener.hustle.ne.jp/programming/sb.cgi/66
Comments