키보드 입력받을시 탑바 수정
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static WindowsMessageMap mm;
OutputDebugString(mm(msg, lParam, wParam).c_str());
switch (msg)
{
case WM_CLOSE:
PostQuitMessage(69);
break;
case WM_KEYDOWN:
if (wParam == 'F')
{
SetWindowText(hWnd, "Respects");
}
break;
case WM_CHAR:
{
static std::string title;
title.push_back((char)wParam);
SetWindowText(hWnd, title.c_str());
break;
}
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
마우스 포인터 받을시 탑바 수정
#include <Windows.h>
#include "WindowsMessageMap.h"
#include <sstream>
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static WindowsMessageMap mm;
OutputDebugString(mm(msg, lParam, wParam).c_str());
switch (msg)
{
case WM_CLOSE:
PostQuitMessage(69);
break;
case WM_KEYDOWN:
if (wParam == 'F')
{
SetWindowText(hWnd, "Respects");
}
break;
case WM_CHAR:
{
static std::string title;
title.push_back((char)wParam);
SetWindowText(hWnd, title.c_str());
break;
}
case WM_LBUTTONDOWN:
{
const POINTS pt = MAKEPOINTS(lParam);
std::ostringstream oss;
oss << "(" << pt.x << "," << pt.y << ")";
SetWindowText(hWnd, oss.str().c_str());
break;
}
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}