From 3ef50b71d80683dc60c83153c48fb6c14915bf04 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Tue, 30 Oct 2018 19:33:40 -0700 Subject: On to actual stuff now --- Source/Main.cpp | 29 +++++++++-------------------- Source/Version.h | 3 ++- Source/Version.rc | 1 - 3 files changed, 11 insertions(+), 22 deletions(-) (limited to 'Source') 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 @@ -// Source.cpp : Defines the entry point for the application. -// - #include "resource.h" #include #include #include #include "Randomizer.h" #include "windows.h" +#include "Version.h" #define IDC_RANDOMIZE 0x401 #define IDC_TOGGLESPEED 0x402 @@ -65,34 +63,25 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { - #define MAX_LOADSTRING 100 - WCHAR szWindowClass[MAX_LOADSTRING]; - LoadStringW(hInstance, IDC_SOURCE, szWindowClass, MAX_LOADSTRING); + LoadLibrary(L"Msftedit.dll"); - WNDCLASSEXW wcex = { - sizeof(WNDCLASSEX), + WNDCLASSW wndClass = { CS_HREDRAW | CS_VREDRAW, WndProc, 0, - 0, + 0, hInstance, - LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SOURCE)), + NULL, LoadCursor(nullptr, IDC_ARROW), (HBRUSH)(COLOR_WINDOW+1), - MAKEINTRESOURCEW(IDC_SOURCE), - szWindowClass, - LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)), + WINDOW_CLASS, + WINDOW_CLASS, }; - RegisterClassExW(&wcex); + RegisterClassW(&wndClass); - WCHAR szTitle[MAX_LOADSTRING]; - LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - HWND hwnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + HWND hwnd = CreateWindow(WINDOW_CLASS, PRODUCT_NAME, WS_OVERLAPPEDWINDOW, 400, 200, 500, 500, nullptr, nullptr, hInstance, nullptr); - LoadLibrary(L"Msftedit.dll"); - - CreateWindow(L"STATIC", L"Enter a seed:", WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 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 @@ #define TO_STRING(s) #s #define VERSION_STR TO_STRING(MAJOR) "." TO_STRING(MINOR) "." TO_STRING(PATCH) ".0" -#define PRODUCT_NAME "Witness Randomizer" +#define PRODUCT_NAME L"Witness Randomizer" +#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 @@ STRINGTABLE BEGIN - IDS_APP_TITLE "Witness Randomizer" IDC_SOURCE "SOURCE" END -- cgit 1.4.1