1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
#include <windows.h>
#include <iostream>
#include <string>
#include <math.h>
#include "REDXWin.h"
bool REDXCURSOR = false;
std::string MODE = "NULL";
std::string OpenOrClosed = "";
const COLORREF crefText = RGB( 0, 0, 255);
const COLORREF crefBkgnd = RGB(250, 235, 215);
static HBRUSH s_hbrBkgnd = NULL;
const char g_szClassName[] = "Custom Story(Red X Orginization)";
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
{
}
break;
case WM_CREATE:
{ Sleep(1000);
CreateWindow(TEXT("STATIC"), TEXT("Please Select a Game-Type to begin playing."), WS_VISIBLE | WS_CHILD,
20,40,400,25, hwnd, (HMENU)NULL, NULL, NULL);
HMENU Men1 = CreateMenu();
HMENU WindowsTextMode = CreateMenu();
HMENU Options1 = CreateMenu();
AppendMenu(Men1,MF_POPUP, (UINT_PTR)Options1, "Game Type");
AppendMenu(Options1, MF_STRING, Men1Button1, "CommandPrompt(Text Based)");
AppendMenu(Options1, MF_STRING, Men1Button2, "Windows Mode(Semi-Graphics based)");
AppendMenu(Options1, MF_STRING, Men1Button3, "Windows Mode(Text Based)");
AppendMenu(Options1, MF_STRING, Men1Button4, "2D Mode");
AppendMenu(Options1, MF_STRING, Men1Button5, "3D Mode");
SetMenu(hwnd, Men1);
break;
}
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC)wParam;
SetBkColor(hdc, crefBkgnd);
return (INT_PTR)s_hbrBkgnd;
}
case WM_COMMAND:
{
switch( LOWORD(wParam) )
{
case Men1Button1:
MODE = "CMD Mode";
std::cout << MODE << std::endl;
break;
case Men1Button2:
MODE = "Windows Mode(SGB)";
std::cout << MODE << std::endl;
break;
case Men1Button3:
MODE = "Windows Mode(TB)";
std::cout << MODE << std::endl;
break;
case Men1Button4:
MODE = "2D Mode";
std::cout << MODE << std::endl;
break;
case Men1Button5:
MODE = "3D Mode";
std::cout << MODE << std::endl;
break;
}
}break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
|