title: Creating a Button With C++
body: <p>I'm working on designing a game in C++ and am currently working on my main menu which includes three buttons for three difficulty levels. The problem is, I don't actually know how to create a button in C++. I came across a couple of YouTube tutorials on how to do this, but both guys doing the videos were just inserting this piece of code into an existing program and I'm having trouble figuring out how to get it to work with my code.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;Windows.h&gt;
  using namespace std;
  int main()
  {
      system("color e0");
      cout &lt;&lt; "Can You Catch Sonic?" &lt;&lt; endl;
      cout &lt;&lt; "Can you find which block Sonic is hiding under? Keep your eyes peeled for that speedy hedgehog and try to find him after the blocks stop moving" &lt;&lt; endl;
      CreateWindow(TEXT("button"), TEXT("Easy"), WS_VISIBLE | WS_CHILD, 
          10, 10, 80, 25, NULL, NULL, NULL, NULL);
      return 0;
  } 
  </code></pre>
  
  <p>When I run this, the console pops up with the correct background color and messages, but there is no button. Can anyone tell me what I'm doing wrong? I'm sure it has something to do with all those NULLs, but not sure what to replace them with. </p>
  
  <p>This is what the code from the YouTube video was, but like I said, it was in the middle of a program that had already been created:</p>
  
  <pre><code>CreateWindow(TEXT("button"), TEXT("Hello"), 
     WS_VISIBLE | WS_CHILD,
     10, 10, 80, 25,
     hwnd, (HMENU) 1, NULL, NULL);
  </code></pre>
  
  <p>Any ideas? I'm really new to this so any help or suggestions would be greatly appreciated. </p>