Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <tchar.h>
- #pragma comment(lib, "user32.lib")
- #define MAX_LOADSTRING 100
- HINSTANCE hInst; // current instance
- LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
- int x, y;
- int APIENTRY wWinMain(_In_ HINSTANCE hInstance,HINSTANCE hPrevInstance,LPWSTR lpCmdLine,int nCmdShow){
- WCHAR szAppName[] = L"WTVLVS";
- WCHAR szFrameClass[] = L"cFrame";
- // TODO: Place code here.
- x = GetSystemMetrics(SM_CXSCREEN);
- y = GetSystemMetrics(SM_CYSCREEN);
- // INIT WINDOWCLASS
- WNDCLASSEXW 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, NULL);
- wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
- wcex.lpszMenuName = NULL;
- wcex.lpszClassName = szFrameClass;
- wcex.hIconSm = LoadIcon(wcex.hInstance, NULL);
- RegisterClassExW(&wcex);
- // INIT HINSTANCE
- hInst = hInstance; // Store instance handle in our global variable
- HWND hWnd = CreateWindowW(szFrameClass, szAppName, WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, CW_USEDEFAULT, 720, 480, nullptr, nullptr, hInstance, nullptr);
- ShowWindow(hWnd, nCmdShow);
- UpdateWindow(hWnd);
- MSG msg;
- while (GetMessage(&msg, nullptr, 0, 0)){
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- return (int)msg.wParam;
- }
- LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
- static wchar_t *lyrics = L"test";
- switch (message) {
- case WM_CREATE: {
- break;
- }
- case WM_KEYDOWN: {
- switch (wParam) {
- case 0: {
- break;
- }
- default: {
- break;
- }
- }
- break;
- }
- case WM_LBUTTONDOWN: {
- break;
- }
- case WM_RBUTTONDOWN: {
- break;
- }
- case WM_COMMAND: {
- int wmId = LOWORD(wParam);
- switch (wmId) {
- case 0: {
- break;
- }
- default: {
- break;
- }
- }
- break;
- }
- case WM_PAINT: {
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hWnd, &ps);
- EndPaint(hWnd, &ps);
- break;
- }
- case WM_DESTROY: {
- PostQuitMessage(0);
- break;
- }
- default: {
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement