1.  
  2. #ifndef REDXWIN_H_INCLUDED
  3. #define REDXWIN_H_INCLUDED
  4.  
  5. #define REDX_WINDOW 1002
  6. #define REDX_MENU 1007
  7. #define Seth_Dialog 1000007
  8. #define Men2Button1 101
  9. #define Men2Button2 102
  10. #define Men2Button3 103
  11. #define Men2Button4 104
  12. #define Men3Button1 1008
  13. #define Men3Button2 1009
  14. #define Men3Button3 1010
  15. #define Men3Button4 1011
  16. #define Men3Button5 1012
  17. #define Men1Button1 1001
  18. #define Men1Button2 1003
  19. #define Men1Button3 1004
  20. #define Men1Button4 1005
  21. #define Men1Button5 1006
  22. #define RedXCursor 2003
  23. #define Men4Button1 105
  24. #define Men3Button6 108
  25. #define Men3Button7 109
  26. #define Men5Button1 110
  27. #define Men5Button2 111
  28. #define Men5Button3 112
  29. #define Men6Button1 113
  30. #define Men6Button2 114
  31. #define Men6Button3 115
  32. #define Men6Button4 116
  33. #define Men6Button5 117
  34. #define Men7Button1 118
  35. #define Men7Button2 119
  36. #define Men7Button3 120
  37. #define Men7Button4 121
  38. #define Men7Button5 122
  39. #define Men8Button1 123
  40. #define Men8Button2 124
  41. #define WM_SETCURSOR 0x0020
  42.  
  43. #define Men6Option3Button1 126
  44. #define Men6Option3Button2 127
  45. #define Men6Option3Button3 128
  46. #define Men6Option3Button4 129
  47. #define Men6Option3Button5 130
  48. #define Men6Option3Button6 131
  49. #define Men6Option3Button7 132
  50. #define Men6Option3Button8 133
  51. #define Men6Option3Button9 134
  52. #define Men6Option3Button10 135
  53. #define Men6Option3Button11 136
  54. #define Men6Option3Button12 137
  55. #define Men6Option3Button13 138
  56. #define Men6Option3Button14 139
  57. #define Men6Option3Button15 140
  58. #define Men6Option3Button16 141
  59.  
  60. #define IDD_DLGFIRST 142
  61.  
  62. #endif
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. #include "REDXWin.h"
  74.  
  75.  
  76.  
  77. IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66
  78. STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  79. CAPTION "My About Box"
  80. FONT 8, "MS Sans Serif"
  81. BEGIN
  82. DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
  83. PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
  84. GROUPBOX "About this program...",IDC_STATIC,7,7,225,52
  85. CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby theForger",
  86. IDC_STATIC,16,18,144,33
  87. END
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. #include <windows.h>
  100. #include <iostream>
  101. #include <string>
  102. #include <math.h>
  103. #include "REDXWin.h"
  104. #include <fstream>
  105.  
  106. std::string name;
  107. float age;
  108.  
  109. int BeginCommandPromptTextBasedGame(){
  110. std::cout << "Before we begin this adventerous 'Text Based Game', we need some things from the player(you). Please input your name, it can be first name, last name, middle name, all three, or even a made up name." << std::endl;
  111. std::cin >> name;
  112. std::cout << "Now please enter your age. Using letters for your age may brake the application and you will have to re-load it." << std::endl;
  113. std::cin >> age;
  114. std::cout << "Okay please verify that your name is " << name << ", " << "and your age is " << age << " " << "Right?" << std::endl;
  115. std::cout << "Now let us begin the story of " << name << std::endl;
  116. system("CLS");
  117. }
  118.  
  119. using namespace std;
  120.  
  121. LPCSTR cursor = IDC_ARROW;
  122.  
  123. std::string Stri1 = "NULL";
  124.  
  125. BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
  126. {
  127. switch(Message)
  128. {
  129. case WM_INITDIALOG:
  130.  
  131. return TRUE;
  132. case WM_COMMAND:
  133. switch(LOWORD(wParam))
  134. {
  135. case IDOK:
  136. EndDialog(hwnd, IDOK);
  137. break;
  138. case IDCANCEL:
  139. EndDialog(hwnd, IDCANCEL);
  140. break;
  141. }
  142. break;
  143. default:
  144. return FALSE;
  145. }
  146. return TRUE;
  147. }
  148.  
  149. std::string MODE = "NULL";
  150. std::string OpenOrClosed = "";
  151.  
  152. HWND nurb;
  153. static HBRUSH hbrBkgnd = NULL;
  154.  
  155.  
  156.  
  157. const char g_szClassName[] = "Custom Story(RedXStudios)";
  158.  
  159. LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  160. {
  161. switch(msg)
  162. {
  163. case WM_LBUTTONDOWN:
  164. {
  165.  
  166. }
  167. break;
  168.  
  169. case WM_CREATE:
  170.  
  171. { Sleep(1000);
  172.  
  173. nurb = CreateWindow(TEXT("STATIC"), TEXT(""), WS_VISIBLE | WS_CHILD,
  174. 40,80,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  175.  
  176.  
  177.  
  178.  
  179. CreateWindow(TEXT("STATIC"), TEXT("Please Select a Game-Type to begin playing."), WS_VISIBLE | WS_CHILD,
  180. 20,40,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  181.  
  182.  
  183. HMENU Men1, Men2, Men3, Men4, Men5, Men6, Men7, Men8, Men9, Men10;
  184. HMENU Options1 = CreateMenu();
  185. HMENU Options2 = CreateMenu();
  186. HMENU Options3 = CreateMenu();
  187. HMENU Options4 = CreateMenu();
  188.  
  189. Men1 = CreateMenu();
  190. AppendMenu(Men1,MF_POPUP, (UINT_PTR)Options1, "Game Type");
  191. AppendMenu(Options1, MF_STRING, Men1Button1, "CommandPrompt(Text Based)");
  192. AppendMenu(Options1, MF_STRING, Men1Button2, "Windows Mode(Semi-Graphics based)");
  193. AppendMenu(Options1, MF_STRING, Men1Button3, "Windows Mode(Text Based)");
  194. AppendMenu(Options1, MF_STRING, Men1Button4, "2D Mode");
  195. AppendMenu(Options1, MF_STRING, Men1Button5, "3D Mode");
  196.  
  197. Men2 = CreatePopupMenu();
  198. AppendMenu(Men2, MF_STRING, Men2Button1, "File Location");
  199. AppendMenu(Men2, MF_STRING, Men2Button2, "Exe Location");
  200. AppendMenu(Men2, MF_STRING, Men2Button4, "RedXStudios Website");
  201. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men2, "Options");
  202.  
  203. Men3 = CreatePopupMenu();
  204. AppendMenu(Men3, MF_STRING, Men3Button1, "Seth Pack, Age 17, Beta Tested");
  205. AppendMenu(Men3, MF_STRING, Men3Button2, "Roy Dragon, Age 17, Beta Tested");
  206. AppendMenu(Men3, MF_STRING, Men3Button3, "Adam Talbott, Age 17, Beta Tested");
  207. AppendMenu(Men3, MF_STRING, Men3Button4, "Josh Franklin, Age 18, Programmed, Designed, and Wrote the game");
  208. AppendMenu(Men3, MF_STRING, Men3Button5, "Michael Rubenstein, Age 14, Beta Tested");
  209. AppendMenu(Men3, MF_STRING, Men3Button6, "Andy Burns, Age 15, Beta Tested");
  210. AppendMenu(Men3, MF_STRING, Men3Button7, "Jamie Franklin, Age 15, Beta Tested");
  211. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men3, "Credit");
  212.  
  213.  
  214. Men4 = CreatePopupMenu();
  215. AppendMenu(Men4, MF_STRING, Men4Button1, "Play");
  216. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men4, "Play Now");
  217.  
  218.  
  219. Men5 = CreatePopupMenu();
  220. AppendMenu(Men5, MF_STRING, Men5Button1, "GLUT/OPenGL");
  221. AppendMenu(Men5, MF_STRING, Men5Button2, "Win32");
  222. AppendMenu(Men5, MF_STRING, Men5Button3, "IrrKLang");
  223. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men5, "Special Thanks");
  224.  
  225. ShowWindow(hwnd, false);
  226. Men6 = CreatePopupMenu();
  227. AppendMenu(Men6, MF_STRING, Men6Button1, "RedXCursors");
  228. AppendMenu(Men6, MF_STRING, Men6Button2, "CustomCursor");
  229. AppendMenu(Men6, MF_STRING|MF_POPUP, (UINT_PTR)Options3, "OtherCursors");
  230. AppendMenu(Options3, MF_STRING, Men6Option3Button1, "Arrow");
  231. AppendMenu(Options3, MF_STRING, Men6Option3Button2, "Loading");
  232. AppendMenu(Options3, MF_STRING, Men6Option3Button3, "Cross");
  233. AppendMenu(Options3, MF_STRING, Men6Option3Button4, "Hand");
  234. AppendMenu(Options3, MF_STRING, Men6Option3Button5, "Help");
  235. AppendMenu(Options3, MF_STRING, Men6Option3Button6, "Ibeam");
  236. AppendMenu(Options3, MF_STRING, Men6Option3Button7, "Icon");
  237. AppendMenu(Options3, MF_STRING, Men6Option3Button8, "No");
  238. AppendMenu(Options3, MF_STRING, Men6Option3Button9, "Size");
  239. AppendMenu(Options3, MF_STRING, Men6Option3Button10, "SizeAll");
  240. AppendMenu(Options3, MF_STRING, Men6Option3Button11, "SIZENESW");
  241. AppendMenu(Options3, MF_STRING, Men6Option3Button12, "Sizens");
  242. AppendMenu(Options3, MF_STRING, Men6Option3Button13, "SizenWSE");
  243. AppendMenu(Options3, MF_STRING, Men6Option3Button14, "SizEWE");
  244. AppendMenu(Options3, MF_STRING, Men6Option3Button15, "UpArrow");
  245. AppendMenu(Options3, MF_STRING, Men6Option3Button16, "Wait");
  246. AppendMenu(Men6, MF_STRING, Men6Button3, "Music");
  247. AppendMenu(Men6, MF_STRING, Men6Button4, "Calculater");
  248. AppendMenu(Men6, MF_STRING, Men6Button5, "CustomFont");
  249. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men6, "Extras");
  250.  
  251. Men7 = CreatePopupMenu();
  252. AppendMenu(Men7, MF_STRING, Men7Button1, "RedXCursor Instructions");
  253. AppendMenu(Men7, MF_STRING, Men7Button2, "CustomCursor Instructions");
  254. AppendMenu(Men7, MF_STRING, Men7Button3, "Music Instructions");
  255. AppendMenu(Men7, MF_STRING, Men7Button4, "Calculater Instructions");
  256. AppendMenu(Men7, MF_STRING, Men7Button5, "CustomFont Instructions");
  257. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men7, "Instructions");
  258.  
  259. Men8 = CreatePopupMenu();
  260. AppendMenu(Men8, MF_STRING, Men8Button1, "Info on extras");
  261. AppendMenu(Men8, MF_STRING, Men8Button2, "Josh Franklin Comments");
  262. AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men8, "Information");
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SetMenu(hwnd, Men1);
  269. SetCursor(LoadCursor(NULL, IDC_ARROW));
  270. break;
  271. }
  272.  
  273.  
  274.  
  275.  
  276. case WM_COMMAND:
  277. {
  278.  
  279.  
  280. }
  281.  
  282. switch( LOWORD(wParam) )
  283. {
  284.  
  285. case Men1Button1:
  286. {
  287. MODE = "CMD Mode";
  288. SetWindowText(nurb, TEXT("Command Prompt Text-Based has been chosen"));
  289.  
  290. CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD,
  291. 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  292.  
  293. static HBRUSH brus1 = NULL;
  294. break;
  295. }
  296. case Men1Button2:
  297. {
  298. MODE = "Windows Mode(SGB)";
  299. SetWindowText(nurb, TEXT("Windows Mode Semi-Graphics-Based has been chosen"));
  300.  
  301.  
  302. CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD,
  303. 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  304.  
  305. break;
  306. }
  307. case Men1Button3:
  308. {
  309. MODE = "Windows Mode(TB)";
  310. SetWindowText(nurb, TEXT("Windows Mode Text-Based has been chosen"));
  311.  
  312. CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD,
  313. 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  314.  
  315. break;
  316. }
  317. case Men1Button4:
  318. {
  319. MODE = "2D Mode";
  320. SetWindowText(nurb, TEXT("2D Mode has been chosen"));
  321.  
  322. CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD,
  323. 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  324.  
  325.  
  326. break;
  327. }
  328. case Men1Button5:
  329. {
  330. MODE = "3D Mode";
  331. SetWindowText(nurb, TEXT("3D Mode has been chosen"));
  332.  
  333.  
  334. CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD,
  335. 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL);
  336.  
  337. break;
  338. }
  339. case Men3Button1:
  340. {
  341.  
  342. MessageBox(hwnd, "Seth Pack, Age 17, TGN Content scout, JAVA Programmer", "Seth's chosen description",
  343. MB_ICONEXCLAMATION | MB_OK);
  344. break;
  345. }
  346.  
  347. case Men3Button2:
  348. {
  349.  
  350.  
  351. MessageBox(hwnd, " Roy the dragon, Lua Programmer, Roblox Junkie","Roy's chosen description", MB_ICONEXCLAMATION | MB_OK);
  352. break;
  353. }
  354.  
  355. case Men3Button3:
  356. {
  357.  
  358. MessageBox(hwnd, "Adam Talbott, Lua Programmer, Roblox Junkie","Adam's chosen description", MB_ICONEXCLAMATION | MB_OK);
  359.  
  360. break;
  361. }
  362.  
  363. case Men3Button4:
  364. {
  365. MessageBox(hwnd, "Josh Franklin, C++, Lua, Java, HTML, HTML5, CSS, CSS3, Javascript, PHP Programmer, Roblox Junkie", "Josh's chosen description ", MB_ICONEXCLAMATION | MB_OK);
  366. break;
  367. }
  368.  
  369. case Men3Button5:
  370. {
  371.  
  372.  
  373. MessageBox(hwnd, "Michael Rubinstein, Likes Doctor who, Programs in rbx.lua, Roblox junkie", "Mich's chosen description", MB_ICONEXCLAMATION | MB_OK);
  374. break;
  375.  
  376. }
  377.  
  378. case Men3Button6:
  379. {
  380.  
  381. MessageBox(hwnd, "Andy Burns, Age 15, Car Addict, Roblox junkie", "Andy's chosen description", MB_ICONEXCLAMATION | MB_OK);
  382. break;
  383. }
  384.  
  385. case Men3Button7:
  386. {
  387.  
  388. MessageBox(hwnd, "Jamie Franklin, Age 15, Crazy, Music Addict", "Jamie's chosen description", MB_ICONEXCLAMATION | MB_OK);
  389. break;
  390.  
  391.  
  392. }
  393.  
  394. case Men4Button1:
  395. {
  396.  
  397.  
  398. if (MODE == "CMD Mode"){
  399.  
  400. ShowWindow(hwnd, false);
  401.  
  402. cout << "To 'Play' type 'Play' and press enter, for details at anytime type details/ and then press enter, for instructions type instruc/" << std::endl;
  403.  
  404. std::string BeginCom;
  405. cin >> BeginCom;
  406.  
  407. bool non = false;
  408.  
  409. while(non == false){
  410. if(BeginCom == "Play"){
  411.  
  412. system("CLS");
  413. BeginCommandPromptTextBasedGame();
  414. non = true;
  415. break;
  416. }else if(BeginCom == "play"){
  417. system("CLS");
  418. BeginCommandPromptTextBasedGame();
  419. non = true;
  420. break;
  421. }else if(BeginCom == "details/"){
  422. std::cout << "This is a Fantasy Mid-Evil RPG(You are currently playing the text version). The point of the game is to live your life and live your story until the very end. The game interacts to choices you make." << std::endl;
  423. cin >> BeginCom;
  424.  
  425. }else if(BeginCom == "Details/"){
  426. std::cout << "This is a Fantasy Mid-Evil RPG(You are currently playing the text version). The point of the game is to live your life and live your story until the very end. The game interacts to choices you make." << std::endl;
  427. cin >> BeginCom;
  428. }else if(BeginCom == "instructions/"){
  429.  
  430. std::cout << "To save the game at any point in time type 'save/', or 'Save/', to get back to the Main window/options menu type esc(1); and to close the whole program completley type esc(2);" << std::endl;
  431. cin >> BeginCom;
  432.  
  433. }else if(BeginCom == "Instructions/"){
  434.  
  435. std::cout << "To save the game at any point in time type 'save/', or 'Save/', to get back to the Main window/options menu type esc(1); and to close the whole program completley type esc(2);" << std::endl;
  436. cin >> BeginCom;
  437.  
  438. }
  439.  
  440. else if(BeginCom != "Details/" and "details/" and "instructions/" and "Instructions/" and "Play" and "play"){
  441. MessageBox(hwnd,"You have chosen a in-valid choice of characters. To fix this type one of the three options play/, instructions/, or details/", "Typing Error", MB_OK);
  442. system("CLS");
  443. cout << "To 'Play' type 'Play' and press enter, for details at anytime type details/ and then press enter, for instructions type instruc/" << std::endl;
  444. cin >> BeginCom;
  445.  
  446. };
  447. }
  448. }
  449. else if(MODE == "Windows Mode(SGB)"){
  450.  
  451.  
  452. }else if(MODE == "Windows Mode(TB)"){
  453.  
  454.  
  455. }else if(MODE == "2D Mode"){
  456.  
  457.  
  458. }else if(MODE == "3D Mode"){
  459.  
  460.  
  461. }else{
  462.  
  463. MessageBox(hwnd, "This is either due to not picking a game mode or there is a code error. Try re-opening the program and picking a game mode, if that does not help then re-download the application.", "Game Load Error", MB_ICONEXCLAMATION | MB_OK);
  464.  
  465.  
  466. }
  467.  
  468. break;
  469.  
  470. }
  471.  
  472. case Men6Option3Button1:
  473. {
  474.  
  475. SetCursor(LoadCursor(NULL, IDC_ARROW));
  476. break;
  477.  
  478. }
  479.  
  480. case Men6Option3Button2:{
  481.  
  482. SetCursor(LoadCursor(NULL, IDC_APPSTARTING));
  483. break;
  484. }
  485.  
  486. case Men6Option3Button3:{
  487.  
  488. SetCursor(LoadCursor(NULL, IDC_CROSS));
  489. break;
  490. }
  491.  
  492. case Men6Option3Button4:{
  493.  
  494. SetCursor(LoadCursor(NULL, IDC_HAND));
  495. break;
  496. }
  497.  
  498. case Men6Option3Button5:{
  499.  
  500. SetCursor(LoadCursor(NULL, IDC_HELP));
  501. break;
  502. }
  503.  
  504. case Men6Option3Button6:{
  505.  
  506. SetCursor(LoadCursor(NULL, IDC_IBEAM));
  507. break;
  508. }
  509.  
  510. case Men6Option3Button7:{
  511.  
  512. SetCursor(LoadCursor(NULL, IDC_ICON));
  513. break;
  514. }
  515.  
  516. case Men6Option3Button8:{
  517.  
  518. SetCursor(LoadCursor(NULL,IDC_NO ));
  519. break;
  520. }
  521.  
  522. case Men6Option3Button9:{
  523.  
  524. SetCursor(LoadCursor(NULL, IDC_SIZE));
  525. break;
  526. }
  527.  
  528. case Men6Option3Button10:{
  529.  
  530. SetCursor(LoadCursor(NULL, IDC_SIZEALL));
  531. break;
  532. }
  533.  
  534. case Men6Option3Button11:{
  535.  
  536. SetCursor(LoadCursor(NULL, IDC_SIZENESW));
  537. break;
  538. }
  539.  
  540. case Men6Option3Button12:{
  541.  
  542. SetCursor(LoadCursor(NULL, IDC_SIZENS));
  543. break;
  544. }
  545.  
  546. case Men6Option3Button13:{
  547.  
  548. SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
  549. break;
  550. }
  551.  
  552. case Men6Option3Button14:{
  553.  
  554. SetCursor(LoadCursor(NULL, IDC_SIZEWE));
  555. break;
  556. }
  557.  
  558. case Men6Option3Button15:{
  559.  
  560. SetCursor(LoadCursor(NULL, IDC_UPARROW));
  561. break;
  562. }
  563.  
  564.  
  565. case Men6Option3Button16:{
  566.  
  567. SetCursor(LoadCursor(NULL, IDC_WAIT));
  568. break;
  569. }
  570.  
  571. case Men5Button1:{
  572.  
  573. MessageBoxEx(hwnd, "I thank 'GLUT/OPenGL' for supplying the libary to dumb down making 3D objects", "Special Thanks", MB_OK, NULL );
  574. break;
  575. } case Men5Button2:{
  576.  
  577. MessageBoxEx(hwnd, "I thank Win32 for all Windows objects created within my application", "Special Thanks", MB_OK, NULL );
  578. break;
  579. }case Men5Button3:{
  580.  
  581. MessageBoxEx(hwnd, "I thank IrrkLang for all audio within my application", "Special Thanks", MB_OK, NULL);
  582.  
  583. break;
  584. }
  585.  
  586. }break;
  587. case WM_CLOSE:
  588. DestroyWindow(hwnd);
  589. break;
  590.  
  591. case WM_CTLCOLORSTATIC:
  592. {
  593. HDC hdcStatic = (HDC) wParam;
  594. SetBkColor(hdcStatic, RGB( 255, 255, 255));
  595.  
  596. if (hbrBkgnd == NULL)
  597. {
  598. hbrBkgnd = CreateSolidBrush(RGB( 255, 255, 255));
  599. }
  600. return (INT_PTR)hbrBkgnd;
  601. }
  602.  
  603. case WM_DESTROY:
  604. PostQuitMessage(0);
  605. DeleteObject(hbrBkgnd);
  606. break;
  607. default:
  608. return DefWindowProc(hwnd, msg, wParam, lParam);
  609.  
  610. case WM_SETCURSOR:
  611. {hwnd;
  612.  
  613.  
  614. }
  615.  
  616. }
  617. return 0;
  618. }
  619.  
  620.  
  621.  
  622.  
  623. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  624. LPSTR lpCmdLine, int nCmdShow)
  625. {
  626.  
  627. WNDCLASSEX wc;
  628. HWND hwnd;
  629. MSG Msg;
  630. nCmdShow = true;
  631. wc.cbSize = sizeof(WNDCLASSEX);
  632. wc.style = 0;
  633. wc.lpfnWndProc = WndProc;
  634. wc.cbClsExtra = 0;
  635. wc.cbWndExtra = 0;
  636. wc.hInstance = hInstance;
  637. wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  638. wc.hCursor = LoadCursor(NULL,IDC_ARROW);
  639. wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  640. wc.lpszMenuName = NULL;
  641. wc.lpszClassName = g_szClassName;
  642. wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
  643.  
  644. if(!RegisterClassEx(&wc))
  645. {
  646. MessageBox(NULL, "Window could not be loaded, we apologise.", "Error(Please try re-downloading.)",
  647. MB_ICONEXCLAMATION | MB_OK);
  648. return 0;
  649. }
  650.  
  651. hwnd = CreateWindowEx(
  652. WS_EX_APPWINDOW,
  653. g_szClassName,
  654. "Custom Story(Red X Orginization)",
  655. WS_OVERLAPPEDWINDOW,
  656. CW_USEDEFAULT, CW_USEDEFAULT, 2000, 900,
  657. NULL, NULL, hInstance, NULL);
  658.  
  659. if(hwnd == NULL)
  660. {
  661. MessageBox(NULL, "Window Creation Failed!", "Error!",
  662. MB_ICONEXCLAMATION | MB_OK);
  663. return 0;
  664. }
  665.  
  666. ShowWindow(hwnd, nCmdShow);
  667. UpdateWindow(hwnd);
  668.  
  669.  
  670. while(GetMessage(&Msg, NULL, 0, 0) > 0)
  671. {
  672. TranslateMessage(&Msg);
  673. DispatchMessage(&Msg);
  674. }
  675. return Msg.wParam;
  676. }