Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hide console when executing with arguments
  • Loading branch information
Kalyvas Emmanouil committed Oct 8, 2021
1 parent 527ae1d commit 7efa65a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SmartLock/Program.cs
Expand Up @@ -20,7 +20,9 @@ class Commands

class Program
{

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

static async Task Main(string[] args)
{//<<= Entry point =>>
if (args.Length == 0)
Expand All @@ -29,6 +31,10 @@ static async Task Main(string[] args)
}
else
{//Execution with arguments
//Hide console :
IntPtr h = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
ShowWindow(h, 0);
//Handle commands :
await HandleCommands(args);
}
}
Expand Down

0 comments on commit 7efa65a

Please sign in to comment.