Skip to content

Commit

Permalink
With HideWindow (pid) / ShowWindow(pid)
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Oct 22, 2020
1 parent 118b4d2 commit 321578e
Show file tree
Hide file tree
Showing 4 changed files with 870 additions and 789 deletions.
Binary file modified WinAPI.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ winapi.MinimizeWindow = function(title, chain) {
execFile(winapiCS, ["MinimizeWindow", title], {}, chain);
};


winapi.HideWindow = function(title, chain) {
execFile(winapiCS, ["HideWindow", title], {}, chain);
};

winapi.ShowWindow = function(title, chain) {
execFile(winapiCS, ["ShowWindow", title], {}, chain);
};

winapi.GetDisplaysList = function(chain) {
execFile(winapiCS, ["GetDisplaysList"], {}, function(err, stdout) {
chain(err, JSON.parse(stdout));
Expand Down
29 changes: 23 additions & 6 deletions src/cs/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class Program
const string CMD_ReOrientDisplay = "ReOrientDisplay";
const string CMD_GetDisplaySettings = "GetDisplaySettings";
const string CMD_GetDisplayList = "GetDisplaysList";
const string CMD_MaximizeWindow = "MaximizeWindow";
const string CMD_MinimizeWindow = "MinimizeWindow";
const string CMD_MaximizeWindow = "MaximizeWindow";
const string CMD_MinimizeWindow = "MinimizeWindow";

const string CMD_HideWindow = "HideWindow";
const string CMD_ShowWindow = "ShowWindow";


static void Main(string[] args)
Expand All @@ -43,18 +46,32 @@ static void Main(string[] args)
User32.ReOrientDisplay(orientation);
}

if (cmd == CMD_MaximizeWindow)
if (cmd == CMD_MinimizeWindow)
{
string title = args[1];
Console.WriteLine(title);
User32.MaximizeWindow(title);
User32.MinimizeWindow(title);
}

if (cmd == CMD_MinimizeWindow)
if (cmd == CMD_MaximizeWindow)
{
string title = args[1];
Console.WriteLine(title);
User32.MinimizeWindow(title);
User32.MaximizeWindow(title);
}

if (cmd == CMD_HideWindow)
{
uint pid = Convert.ToUInt32(args[1]);
Console.WriteLine(pid);
User32.HideWindow(pid);
}

if (cmd == CMD_ShowWindow)
{
uint pid = Convert.ToUInt32(args[1]);
Console.WriteLine(pid);
User32.ShowWindow(pid);
}

}
Expand Down
Loading

0 comments on commit 321578e

Please sign in to comment.