0

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

protected override CreateParams CreateParams
    {
        get
        {
            CreateParams cp = CreateParams;
            // turn on WS_EX_TOOLWINDOW style bit
            cp.ExStyle |= 0x80;
            return cp;
        }
    }

I have no idea what the above code does, i found it on stackoverflow but it worked when i tried it

protected override void WndProc(ref Message m)
    {
        if (m.Msg == 0x0312)
        {
            //DO What i want to do here
        }
        base.WndProc(ref m);
    }

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.

SenaCarbtc
  • 121
  • 3
  • 15

0 Answers0