다들 짤 줄 알지만 막상 짜려면 귀찮은 그 코드이다.
필요할때마다 복붙해서 쓰려고 그냥 올려놓았다.
|
#include <windows.h>
#define CLASSNAME TEXT("TestModule")
LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message) {
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, Message, wParam, lParam);
}
int __stdcall WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nShowCmd)
{
WNDCLASS wc;
HWND hWnd;
MSG Message;
wc.hInstance = hInst;
wc.lpszClassName = CLASSNAME;
wc.lpfnWndProc = WndProc;
wc.hbrBackground = CreateSolidBrush(RGB(0, 0, 0));
wc.hCursor = LoadCursor(hInst, IDC_ARROW);
wc.hIcon = LoadIcon(hInst, IDI_APPLICATION);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpszMenuName = NULL;
wc.cbClsExtra = NULL;
wc.cbWndExtra = NULL;
RegisterClass(&wc);
hWnd = CreateWindow(CLASSNAME, CLASSNAME, WS_OVERLAPPEDWINDOW, 0, 0, 600, 400, NULL, NULL, hInst, NULL);
ShowWindow(hWnd, TRUE);
while (GetMessage(&Message, NULL, NULL, NULL)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return (int)Message.wParam;
}
|
cs |
'뻘짓' 카테고리의 다른 글
스타크래프트 리마스터 간이 맵핵 시연 (0) | 2020.12.15 |
---|---|
WIFI 데이터 스니퍼를 만들던 중 발생한 문제. [비표준 비콘] (2) | 2020.11.17 |
로우소켓을 통한 스타크래프트 유저 IP추적기 만들기 (0) | 2020.09.23 |
Winmm을 통한 사운드 입출력장치 얻어오기 (0) | 2020.09.13 |
libvpx를 통한 인코딩 예제 (0) | 2020.09.07 |