about summary refs log tree commit diff stats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Main.cpp29
-rw-r--r--Source/Version.h3
-rw-r--r--Source/Version.rc1
3 files changed, 11 insertions, 22 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);
diff --git a/Source/Version.h b/Source/Version.h index 088b618..cd79def 100644 --- a/Source/Version.h +++ b/Source/Version.h
@@ -9,4 +9,5 @@
9#define TO_STRING(s) #s 9#define TO_STRING(s) #s
10#define VERSION_STR TO_STRING(MAJOR) "." TO_STRING(MINOR) "." TO_STRING(PATCH) ".0" 10#define VERSION_STR TO_STRING(MAJOR) "." TO_STRING(MINOR) "." TO_STRING(PATCH) ".0"
11 11
12#define PRODUCT_NAME "Witness Randomizer" 12#define PRODUCT_NAME L"Witness Randomizer"
13#define WINDOW_CLASS L"WitnessRandomizer"
diff --git a/Source/Version.rc b/Source/Version.rc index 6ee5076..fe44a47 100644 --- a/Source/Version.rc +++ b/Source/Version.rc
@@ -5,7 +5,6 @@
5 5
6STRINGTABLE 6STRINGTABLE
7BEGIN 7BEGIN
8 IDS_APP_TITLE "Witness Randomizer"
9 IDC_SOURCE "SOURCE" 8 IDC_SOURCE "SOURCE"
10END 9END
11 10