about summary refs log tree commit diff stats
path: root/Source/Main.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-28 20:51:35 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-28 20:51:35 -0700
commit5f99f9e87ef23f342e89bab029cc4fc8c5ad6663 (patch)
tree992ec1c10f001a365f4fb943a50ca6a5fc436648 /Source/Main.cpp
parent8b88d76b96cd0c2a4dcd9c777c651b204214c63b (diff)
downloadwitness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.tar.gz
witness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.tar.bz2
witness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.zip
Better UI + tried audio logs
Diffstat (limited to 'Source/Main.cpp')
-rw-r--r--Source/Main.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/Main.cpp b/Source/Main.cpp index 8a7a5bb..0081808 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp
@@ -15,7 +15,7 @@
15 15
16HINSTANCE hInst; 16HINSTANCE hInst;
17WCHAR szWindowClass[MAX_LOADSTRING]; 17WCHAR szWindowClass[MAX_LOADSTRING];
18HWND hwndSeed; 18HWND hwndSeed, hwndRandomize;
19 19
20// Forward declares 20// Forward declares
21ATOM MyRegisterClass(HINSTANCE hInstance); 21ATOM MyRegisterClass(HINSTANCE hInstance);
@@ -67,26 +67,23 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
67 67
68 WCHAR szTitle[MAX_LOADSTRING]; 68 WCHAR szTitle[MAX_LOADSTRING];
69 LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); 69 LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
70 HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, 70 HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
71 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); 71 400, 200, 500, 500, nullptr, nullptr, hInstance, nullptr);
72 72
73 if (!hWnd) 73 if (!hWnd) return FALSE;
74 {
75 return FALSE;
76 }
77 74
78 LoadLibrary(L"Msftedit.dll"); 75 LoadLibrary(L"Msftedit.dll");
79 HWND label = CreateWindow(L"BUTTON", L"Enter a seed:", 76 HWND label = CreateWindow(L"STATIC", L"Enter a seed:",
80 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 77 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
81 10, 10, 100, 26, hWnd, NULL, hInst, NULL); 78 10, 15, 90, 16, hWnd, NULL, hInst, NULL);
82 79
83 hwndSeed = CreateWindowEx(0, MSFTEDIT_CLASS, L"", 80 hwndSeed = CreateWindowEx(0, MSFTEDIT_CLASS, L"",
84 ES_MULTILINE | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP, 81 WS_TABSTOP | WS_VISIBLE | WS_CHILD | WS_BORDER,
85 120, 10, 50, 26, hWnd, NULL, hInst, NULL); 82 100, 10, 50, 26, hWnd, NULL, hInst, NULL);
86 83
87 HWND hwndRandomize = CreateWindow(L"BUTTON", L"Randomize", 84 hwndRandomize = CreateWindow(L"BUTTON", L"Randomize",
88 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 85 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
89 180, 10, 100, 26, hWnd, (HMENU)IDC_RANDOMIZE, hInst, NULL); 86 160, 10, 100, 26, hWnd, (HMENU)IDC_RANDOMIZE, hInst, NULL);
90 87
91 HDC hdc = GetDC(hWnd); 88 HDC hdc = GetDC(hWnd);
92 RECT rect; 89 RECT rect;
@@ -122,6 +119,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
122 } 119 }
123 srand(seed); 120 srand(seed);
124 Randomizer().Randomize(); 121 Randomizer().Randomize();
122 SetWindowText(hwndRandomize, L"Randomized!");
125 } 123 }
126 } 124 }
127 return DefWindowProc(hWnd, message, wParam, lParam); 125 return DefWindowProc(hWnd, message, wParam, lParam);