Skip to content

Commit

Permalink
Update taskbarHidder.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
npocmaka authored Sep 2, 2021
1 parent d4194ba commit 1f2de45
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions hybrids/.net/c/taskbarHidder.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ endlocal & exit /b %errorlevel%

*/




// Credit: https://stackoverflow.com/a/19024531/388389
using System;
using System.Runtime.InteropServices;

public class Taskbar
{
[DllImport("user32.dll")]
private static extern int FindWindow(string className, string windowText);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool IsWindowVisible(IntPtr hWnd);

[DllImport("user32.dll")]
private static extern int ShowWindow(int hwnd, int command);
Expand Down Expand Up @@ -82,7 +82,15 @@ public class Taskbar
ShowWindow(HandleOfStartButton, SW_HIDE);
}

static void printHelp()
public static void GetStatus()
{
IntPtr xAsIntPtr = new IntPtr(Handle);
Console.WriteLine("TaskBar visible : " + IsWindowVisible(xAsIntPtr));
xAsIntPtr = new IntPtr(HandleOfStartButton);
Console.WriteLine("StartButton visible : " + IsWindowVisible(xAsIntPtr));
}

static void printHelp()
{
//clears the extension from the script name
String scriptName = Environment.GetCommandLineArgs()[0];
Expand All @@ -93,8 +101,8 @@ public class Taskbar
Console.WriteLine(" " + scriptName + " 1");
Console.WriteLine("Show:");
Console.WriteLine(" " + scriptName + " 2");
// Console.WriteLine("Get State:");
// Console.WriteLine(" " + scriptName + " 3");
Console.WriteLine("Get State:");
Console.WriteLine(" " + scriptName + " 3");
}

static void Main(string[] args)
Expand All @@ -121,9 +129,10 @@ public class Taskbar
//show
Taskbar.Show();
break;
/*case 3:
case 3:
// get state
break;*/
Taskbar.GetStatus();
break;
default:
Console.WriteLine("Invalid argument: "+args[0]);
Environment.Exit(10);
Expand Down

0 comments on commit 1f2de45

Please sign in to comment.