<commit_before>// windowEtc.cpp :  α׷   մϴ.
//

#include "stdafx.h"
#include "windowEtc.h"

#define MAX_LOADSTRING 100

#define CUSTOM_MESSAGE (WM_USER + 1)



//  :
HINSTANCE hInst;								//  νϽԴϴ.
TCHAR szTitle[MAX_LOADSTRING];					//  ǥ ؽƮԴϴ.
TCHAR szWindowClass[MAX_LOADSTRING];			// ⺻ â Ŭ ̸Դϴ.
HWND g_hWnd;

//  ڵ ⿡  ִ Լ  Դϴ.
ATOM				MyRegisterClass(HINSTANCE hInstance);
BOOL				InitInstance(HINSTANCE, int);
LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK	About(HWND, UINT, WPARAM, LPARAM);

VOID CALLBACK TimerProc(
	_In_  HWND hwnd,
	_In_  UINT uMsg,
	_In_  UINT_PTR idEvent,
	_In_  DWORD dwTime
	);


int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

 	// TODO: ⿡ ڵ带 Էմϴ.
	MSG msg;
	HACCEL hAccelTable;

	//  ڿ ʱȭմϴ.
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_WINDOWETC, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	//  α׷ ʱȭ մϴ.
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	SetTimer(g_hWnd, 11, 1000, TimerProc);

	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINDOWETC));

	// ⺻ ޽ Դϴ.
	while (GetMessage(&msg, NULL, 0, 0))
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

	return (int) msg.wParam;
}



//
//  Լ: MyRegisterClass()
//
//  : â Ŭ մϴ.
//
//  :
//
//    Windows 95 ߰ 'RegisterClassEx' Լ 
//    ش ڵ尡 Win32 ý۰ ȣȯǵ
//    Ϸ 쿡  Լ մϴ.  Լ ȣؾ
//    ش  α׷ 
//    'ùٸ '     ֽϴ.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX);

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINDOWETC));
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
	wcex.lpszMenuName	= MAKEINTRESOURCE(IDC_WINDOWETC);
	wcex.lpszClassName	= szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

	return RegisterClassEx(&wcex);
}

//
//   Լ: InitInstance(HINSTANCE, int)
//
//   : νϽ ڵ ϰ  â ϴ.
//
//   :
//
//         Լ  νϽ ڵ   ϰ
//         α׷ â   ǥմϴ.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // νϽ ڵ   մϴ.

   g_hWnd = hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

//
//  Լ: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  :  â ޽ óմϴ.
//
//  WM_COMMAND	-  α׷ ޴ óմϴ.
//  WM_PAINT	-  â ׸ϴ.
//  WM_DESTROY	-  ޽ Խϰ ȯմϴ.
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// ޴   мմϴ.
		switch (wmId)
		{
		case IDM_ABOUT:
			DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			break;
		case IDM_EXIT:
			DestroyWindow(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		// TODO: ⿡ ׸ ڵ带 ߰մϴ.
		EndPaint(hWnd, &ps);
		break;
		
	case WM_KEYDOWN:
		{
			switch (wParam)
			{
			case VK_SPACE: // ̽ Ű  ȣȴ.
				// ޼ ڽ . Yes/No ư µȴ.
				if (IDYES == ::MessageBoxA(hWnd, "msg", "confirm", MB_YESNO))
				{
					// Yes ư  ٽ ޼ڽ .
					::MessageBoxA(hWnd, "yes", "ok", MB_OK);
				}
				break;

			case VK_RETURN:
				//SendMessage(hWnd, CUSTOM_MESSAGE, 0, 0);
				PostMessage(hWnd, CUSTOM_MESSAGE, 0, 0);
				break;
			}
		}
		break;

	case CUSTOM_MESSAGE:
		{
			int a = 0;
		}
		break;

	case WM_TIMER:
		if (wParam == 0)
		{

		}
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);<commit_msg>update window message<commit_after>// windowEtc.cpp :  α׷   մϴ.
//

#include "stdafx.h"
#include "windowEtc.h"

#define MAX_LOADSTRING 100

#define CUSTOM_MESSAGE (WM_USER + 1)



//  :
HINSTANCE hInst;								//  νϽԴϴ.
TCHAR szTitle[MAX_LOADSTRING];					//  ǥ ؽƮԴϴ.
TCHAR szWindowClass[MAX_LOADSTRING];			// ⺻ â Ŭ ̸Դϴ.
HWND g_hWnd;

//  ڵ ⿡  ִ Լ  Դϴ.
ATOM				MyRegisterClass(HINSTANCE hInstance);
BOOL				InitInstance(HINSTANCE, int);
LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK	About(HWND, UINT, WPARAM, LPARAM);

VOID CALLBACK TimerProc(
	_In_  HWND hwnd,
	_In_  UINT uMsg,
	_In_  UINT_PTR idEvent,
	_In_  DWORD dwTime
	);


int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

 	// TODO: ⿡ ڵ带 Էմϴ.
	MSG msg;
	HACCEL hAccelTable;

	//  ڿ ʱȭմϴ.
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_WINDOWETC, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	//  α׷ ʱȭ մϴ.
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	SetTimer(g_hWnd, 11, 1000, TimerProc);

	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINDOWETC));

	// ⺻ ޽ Դϴ.
	while (GetMessage(&msg, NULL, 0, 0))
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

	return (int) msg.wParam;
}



//
//  Լ: MyRegisterClass()
//
//  : â Ŭ մϴ.
//
//  :
//
//    Windows 95 ߰ 'RegisterClassEx' Լ 
//    ش ڵ尡 Win32 ý۰ ȣȯǵ
//    Ϸ 쿡  Լ մϴ.  Լ ȣؾ
//    ش  α׷ 
//    'ùٸ '     ֽϴ.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX);

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINDOWETC));
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
	wcex.lpszMenuName	= MAKEINTRESOURCE(IDC_WINDOWETC);
	wcex.lpszClassName	= szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

	return RegisterClassEx(&wcex);
}

//
//   Լ: InitInstance(HINSTANCE, int)
//
//   : νϽ ڵ ϰ  â ϴ.
//
//   :
//
//         Լ  νϽ ڵ   ϰ
//         α׷ â   ǥմϴ.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // νϽ ڵ   մϴ.

   g_hWnd = hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

//
//  Լ: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  :  â ޽ óմϴ.
//
//  WM_COMMAND	-  α׷ ޴ óմϴ.
//  WM_PAINT	-  â ׸ϴ.
//  WM_DESTROY	-  ޽ Խϰ ȯմϴ.
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// ޴   мմϴ.
		switch (wmId)
		{
		case IDM_ABOUT:
			DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			break;
		case IDM_EXIT:
			DestroyWindow(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		// TODO: ⿡ ׸ ڵ带 ߰մϴ.
		EndPaint(hWnd, &ps);
		break;
		
	case WM_KEYDOWN:
		{
			switch (wParam)
			{
			case VK_SPACE: // ̽ Ű  ȣȴ.
				// ޼ ڽ . Yes/No ư µȴ.
				if (IDYES == ::MessageBoxA(hWnd, "msg", "confirm", MB_YESNO))
				{
					// Yes ư  ٽ ޼ڽ .
					::MessageBoxA(hWnd, "yes", "ok", MB_OK);
				}
				break;

			case VK_RETURN:
				//SendMessage(hWnd, CUSTOM_MESSAGE, 0, 0);
				//PostMessage(hWnd, CUSTOM_MESSAGE, 0, 0);
				//SendMessage(hWnd, WM_PAINT, 0, 0);
				break;
			}
		}
		break;

	case CUSTOM_MESSAGE:
		{
			int a = 0;
		}
		break;

	case WM_TIMER:
		if (wParam == 0)
		{

		}
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
{'fraction_non_alphanumeric': 0.1352346999405823, 'fraction_numerical': 0.0071301247771836, 'mean_word_length': 2.775684163301929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4217430', 'n_tokens_mistral': 4364, 'n_tokens_neox': 3994, 'n_words': 771}