Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Hide Console App when executed.

(EDITED)
Founded the solutions.
Go on Property -> Output -> Windows Application.
(Apr 10, 2021 12:53 AM)PitbullT0r Wrote:  (EDITED)
Founded the solutions.
Go on Property -> Output -> Windows Application.

Thanks for the update :D
Depending on what you want to run there's other ways too, personally I use .vbs for it ;)
(Apr 10, 2021 01:43 AM)HOMODIN Wrote:  Thanks for the update :D
Depending on what you want to run there's other ways too, personally I use .vbs for it ;)

Ahahah i just searched for it and update for other newbies like me.
Just an addition, you can also edit your .csproj file directly and change the OutputType from Exe to WinExe to achieve this.

Code
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
    </PropertyGroup>

</Project>
(Apr 10, 2021 03:00 AM)Exalted Wrote:  Just an addition, you can also edit your .csproj file directly and change the OutputType from Exe to WinExe to achieve this.

Code
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
    </PropertyGroup>

</Project>

Okay thanks, really usefull.
Im just learning this beatiful programming language, i like it so much.
Code
[DllImport("kernel32.dll")]
private static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

private const int SW_HIDE = 0;
private const int SW_SHOW = 5;

public static void Main(string[] args)
{
   var handle = GetConsoleWindow();

   // Hide Console
   ShowWindow(handle, SW_HIDE);

   // Show Console
   // ShowWindow(handle, SW_SHOW);

}


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by sid123Jun 20, 2022 11:31 AM 3 170 Jun 20, 2022 11:31 AM
Last Post: dinosaur770
[C#] by RedirectMeSep 14, 2021 08:49 AM 8 289 Sep 14, 2021 08:49 AM
Last Post: RedirectMe
[C#] by JettyOct 2, 2020 12:33 PM 2 203 Oct 2, 2020 12:33 PM
Last Post: xHeaven