From efad3bdc35f7e18713938b0bba8bb09228aae996 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Sun, 28 Oct 2018 15:45:08 -0700 Subject: Remove useless menu bar --- Source/Main.cpp | 30 ++++------------ Source/Resource.h | 38 +++++++++----------- Source/Source.rc | 84 ++++++++++++------------------------------- Source/Source.vcxproj | 16 +++++++-- Source/Source.vcxproj.filters | 6 ++++ 5 files changed, 64 insertions(+), 110 deletions(-) diff --git a/Source/Main.cpp b/Source/Main.cpp index 5c7cefa..8a7a5bb 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -16,7 +16,6 @@ HINSTANCE hInst; WCHAR szWindowClass[MAX_LOADSTRING]; HWND hwndSeed; -std::shared_ptr randomizer; // Forward declares ATOM MyRegisterClass(HINSTANCE hInstance); @@ -31,10 +30,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd if (!InitInstance(hInstance, nCmdShow)) { return FALSE; } - randomizer = std::make_shared(); - if (randomizer == nullptr) { - return FALSE; - } MSG msg; while (!GetMessage(&msg, nullptr, 0, 0) == 0) @@ -107,18 +102,12 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - if (WM_COMMAND == WM_DESTROY) { - PostQuitMessage(0); - } else { + if (message == WM_DESTROY) { + PostQuitMessage(0); + } else if (message == WM_COMMAND) { int wmId = LOWORD(wParam); // Parse the menu selections: - switch (wmId) - { - case IDM_ABOUT: - DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); - break; - case IDC_RANDOMIZE: - { + if (wmId == IDC_RANDOMIZE) { std::wstring text(100, '\0'); GetWindowText(hwndSeed, &text[0], 100); int seed = 0; @@ -131,15 +120,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } else { seed = _wtoi(text.c_str()); } - randomizer->Randomize(seed); - - break; - } - case IDM_EXIT: - DestroyWindow(hWnd); - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); + srand(seed); + Randomizer().Randomize(); } } return DefWindowProc(hWnd, message, wParam, lParam); diff --git a/Source/Resource.h b/Source/Resource.h index d5c5cef..426abc1 100644 --- a/Source/Resource.h +++ b/Source/Resource.h @@ -1,30 +1,26 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Source.rc +// +#define IDC_MYICON 2 +#define IDD_SOURCE_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_SOURCE 107 +#define IDI_SMALL 108 +#define IDC_SOURCE 109 +#define IDR_MAINFRAME 128 +#define IDC_STATIC -1 -#define IDS_APP_TITLE 103 - -#define IDR_MAINFRAME 128 -#define IDD_SOURCE_DIALOG 102 -#define IDD_ABOUTBOX 103 -#define IDM_ABOUT 104 -#define IDM_EXIT 105 -#define IDI_SOURCE 107 -#define IDI_SMALL 108 -#define IDC_SOURCE 109 -#define IDC_MYICON 2 -#ifndef IDC_STATIC -#define IDC_STATIC -1 -#endif // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS - -#define _APS_NO_MFC 130 -#define _APS_NEXT_RESOURCE_VALUE 129 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 #endif #endif diff --git a/Source/Source.rc b/Source/Source.rc index 92f755d..7e2ce4e 100644 --- a/Source/Source.rc +++ b/Source/Source.rc @@ -1,11 +1,11 @@ -//Microsoft Visual C++ generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // -// Generated from the TEXTINCLUDE resource. +// Generated from the TEXTINCLUDE 2 resource. // #ifndef APSTUDIO_INVOKED #include "targetver.h" @@ -13,11 +13,16 @@ #define APSTUDIO_HIDDEN_SYMBOLS #include "windows.h" #undef APSTUDIO_HIDDEN_SYMBOLS + ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) ///////////////////////////////////////////////////////////////////////////// // @@ -26,26 +31,16 @@ LANGUAGE 9, 1 // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. +IDI_SOURCE ICON "Source.ico" + +IDI_SMALL ICON "small.ico" -IDI_SOURCE ICON "Source.ico" -IDI_SMALL ICON "small.ico" ///////////////////////////////////////////////////////////////////////////// // // Menu // -IDC_SOURCE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "E&xit", IDM_EXIT - END - POPUP "&Help" - BEGIN - MENUITEM "&About ...", IDM_ABOUT - END -END ///////////////////////////////////////////////////////////////////////////// @@ -53,58 +48,20 @@ END // Accelerator // -IDC_SOURCE ACCELERATORS -BEGIN - "?", IDM_ABOUT, ASCII, ALT - "/", IDM_ABOUT, ASCII, ALT -END -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About Source" -FONT 8, "MS Shell Dlg" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20 - LTEXT "Source, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX - LTEXT "Copyright (c) 2018",IDC_STATIC,42,26,114,8 - DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP -END - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_ABOUTBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 163 - TOPMARGIN, 7 - BOTTOMMARGIN, 55 - END -END -#endif // APSTUDIO_INVOKED - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // -1 TEXTINCLUDE + +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#ifndef APSTUDIO_INVOKED\r\n" "#include ""targetver.h""\r\n" @@ -115,7 +72,7 @@ BEGIN "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -123,6 +80,7 @@ END #endif // APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// // // String Table @@ -130,11 +88,11 @@ END STRINGTABLE BEGIN - IDC_SOURCE "SOURCE" - IDS_APP_TITLE "Source" + IDS_APP_TITLE "Witness Randomizer" + IDC_SOURCE "SOURCE" END -#endif +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// @@ -142,8 +100,10 @@ END #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // -// Generated from the TEXTINCLUDE resource. +// Generated from the TEXTINCLUDE 3 resource. // + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED + diff --git a/Source/Source.vcxproj b/Source/Source.vcxproj index 55d54d9..12d0270 100644 --- a/Source/Source.vcxproj +++ b/Source/Source.vcxproj @@ -84,12 +84,14 @@ - Use + NotUsing Level3 Disabled true WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true + true + stdcpp17 Windows @@ -98,12 +100,14 @@ - Use + NotUsing Level3 Disabled true _DEBUG;_WINDOWS;%(PreprocessorDefinitions) true + true + stdcpp17 Windows @@ -112,7 +116,7 @@ - Use + NotUsing Level3 MaxSpeed true @@ -120,6 +124,9 @@ true WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true + true + EditAndContinue + stdcpp17 Windows @@ -140,6 +147,7 @@ true true stdcpp17 + EditAndContinue Windows @@ -152,6 +160,7 @@ + @@ -160,6 +169,7 @@ + Create Create diff --git a/Source/Source.vcxproj.filters b/Source/Source.vcxproj.filters index b650d44..7e15255 100644 --- a/Source/Source.vcxproj.filters +++ b/Source/Source.vcxproj.filters @@ -33,6 +33,9 @@ Header Files + + Header Files + @@ -47,6 +50,9 @@ Source Files + + Source Files + -- cgit 1.4.1