title: c# override CreateParams and WndProc without form
body: <p>I have a tray application that only has an icon in the tray and no forms what so ever. It listens for hotkeys and performs certain functions, this worked fine when i had a form and minimized it but i don't want to see that form all the time i start my computer and i need this application to run all the time. I tried to make my own ApplicationContext in program.cs but i can't figure out how to do this part</p>
  
  <pre><code>protected override CreateParams CreateParams
      {
          get
          {
              CreateParams cp = CreateParams;
              // turn on WS_EX_TOOLWINDOW style bit
              cp.ExStyle |= 0x80;
              return cp;
          }
      }
  </code></pre>
  
  <p>I have no idea what the above code does, i found it on stackoverflow but it worked when i tried it</p>
  
  <pre><code>protected override void WndProc(ref Message m)
      {
          if (m.Msg == 0x0312)
          {
              //DO What i want to do here
          }
          base.WndProc(ref m);
      }
  </code></pre>
  
  <p>Here is where i did my functions in the form but now when i want to remove the form i can't use this. What can i use? I tried using MainForm but it says it's inaccessible due to protection level.</p>