about summary refs log tree commit diff stats
path: root/Source/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Main.cpp')
-rw-r--r--Source/Main.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/Source/Main.cpp b/Source/Main.cpp index c7b4e69..b4aba0d 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp
@@ -1,12 +1,10 @@
1// Source.cpp : Defines the entry point for the application.
2//
3
4#include "resource.h" 1#include "resource.h"
5#include <Richedit.h> 2#include <Richedit.h>
6#include <ctime> 3#include <ctime>
7#include <string> 4#include <string>
8#include "Randomizer.h" 5#include "Randomizer.h"
9#include "windows.h" 6#include "windows.h"
7#include "Version.h"
10 8
11#define IDC_RANDOMIZE 0x401 9#define IDC_RANDOMIZE 0x401
12#define IDC_TOGGLESPEED 0x402 10#define IDC_TOGGLESPEED 0x402
@@ -65,34 +63,25 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
65 63
66int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) 64int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
67{ 65{
68 #define MAX_LOADSTRING 100 66 LoadLibrary(L"Msftedit.dll");
69 WCHAR szWindowClass[MAX_LOADSTRING];
70 LoadStringW(hInstance, IDC_SOURCE, szWindowClass, MAX_LOADSTRING);
71 67
72 WNDCLASSEXW wcex = { 68 WNDCLASSW wndClass = {
73 sizeof(WNDCLASSEX),
74 CS_HREDRAW | CS_VREDRAW, 69 CS_HREDRAW | CS_VREDRAW,
75 WndProc, 70 WndProc,
76 0, 71 0,
77 0, 72 0,
78 hInstance, 73 hInstance,
79 LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SOURCE)), 74 NULL,
80 LoadCursor(nullptr, IDC_ARROW), 75 LoadCursor(nullptr, IDC_ARROW),
81 (HBRUSH)(COLOR_WINDOW+1), 76 (HBRUSH)(COLOR_WINDOW+1),
82 MAKEINTRESOURCEW(IDC_SOURCE), 77 WINDOW_CLASS,
83 szWindowClass, 78 WINDOW_CLASS,
84 LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)),
85 }; 79 };
86 RegisterClassExW(&wcex); 80 RegisterClassW(&wndClass);
87 81
88 WCHAR szTitle[MAX_LOADSTRING]; 82 HWND hwnd = CreateWindow(WINDOW_CLASS, PRODUCT_NAME, WS_OVERLAPPEDWINDOW,
89 LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
90 HWND hwnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
91 400, 200, 500, 500, nullptr, nullptr, hInstance, nullptr); 83 400, 200, 500, 500, nullptr, nullptr, hInstance, nullptr);
92 84
93 LoadLibrary(L"Msftedit.dll");
94
95
96 CreateWindow(L"STATIC", L"Enter a seed:", 85 CreateWindow(L"STATIC", L"Enter a seed:",
97 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 86 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
98 10, 15, 90, 16, hwnd, NULL, hInstance, NULL); 87 10, 15, 90, 16, hwnd, NULL, hInstance, NULL);