Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. #include <windows.h>
  2. #include <tchar.h>
  3.  
  4. #pragma comment(lib, "user32.lib")
  5.  
  6. #define MAX_LOADSTRING 100
  7.  
  8.  
  9. HINSTANCE hInst; // current instance
  10.  
  11. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  12.  
  13. int x, y;
  14.  
  15. int APIENTRY wWinMain(_In_ HINSTANCE hInstance,HINSTANCE hPrevInstance,LPWSTR lpCmdLine,int nCmdShow){
  16.  
  17.  
  18. WCHAR szAppName[] = L"WTVLVS";
  19. WCHAR szFrameClass[] = L"cFrame";
  20.  
  21. // TODO: Place code here.
  22.  
  23. x = GetSystemMetrics(SM_CXSCREEN);
  24. y = GetSystemMetrics(SM_CYSCREEN);
  25.  
  26.  
  27. // INIT WINDOWCLASS
  28. WNDCLASSEXW wcex;
  29. wcex.cbSize = sizeof(WNDCLASSEX);
  30. wcex.style = CS_HREDRAW | CS_VREDRAW;
  31. wcex.lpfnWndProc = WndProc;
  32. wcex.cbClsExtra = 0;
  33. wcex.cbWndExtra = 0;
  34. wcex.hInstance = hInstance;
  35. wcex.hIcon = LoadIcon(hInstance, NULL);
  36. wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
  37. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  38. wcex.lpszMenuName = NULL;
  39. wcex.lpszClassName = szFrameClass;
  40. wcex.hIconSm = LoadIcon(wcex.hInstance, NULL);
  41. RegisterClassExW(&wcex);
  42. // INIT HINSTANCE
  43. hInst = hInstance; // Store instance handle in our global variable
  44. HWND hWnd = CreateWindowW(szFrameClass, szAppName, WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, CW_USEDEFAULT, 720, 480, nullptr, nullptr, hInstance, nullptr);
  45.  
  46.  
  47. ShowWindow(hWnd, nCmdShow);
  48. UpdateWindow(hWnd);
  49.  
  50. MSG msg;
  51.  
  52. while (GetMessage(&msg, nullptr, 0, 0)){
  53. TranslateMessage(&msg);
  54. DispatchMessage(&msg);
  55.  
  56. }
  57. return (int)msg.wParam;
  58. }
  59.  
  60. LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
  61. static wchar_t *lyrics = L"test";
  62.  
  63. switch (message) {
  64.  
  65. case WM_CREATE: {
  66. break;
  67. }
  68. case WM_KEYDOWN: {
  69. switch (wParam) {
  70. case 0: {
  71. break;
  72. }
  73. default: {
  74. break;
  75. }
  76. }
  77. break;
  78. }
  79.  
  80. case WM_LBUTTONDOWN: {
  81.  
  82. break;
  83. }
  84. case WM_RBUTTONDOWN: {
  85.  
  86. break;
  87. }
  88. case WM_COMMAND: {
  89. int wmId = LOWORD(wParam);
  90.  
  91. switch (wmId) {
  92. case 0: {
  93. break;
  94. }
  95.  
  96. default: {
  97. break;
  98. }
  99. }
  100. break;
  101. }
  102. case WM_PAINT: {
  103. PAINTSTRUCT ps;
  104. HDC hdc = BeginPaint(hWnd, &ps);
  105. EndPaint(hWnd, &ps);
  106. break;
  107. }
  108. case WM_DESTROY: {
  109. PostQuitMessage(0);
  110. break;
  111. }
  112. default: {
  113. return DefWindowProc(hWnd, message, wParam, lParam);
  114. }
  115.  
  116. }
  117. return 0;
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement