Skip to content

Commit

Permalink
using FCTL_GETUSERSCREEN to work correctly in Far 3 & SetStdHande fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed May 17, 2016
1 parent 2f00dab commit 1584703
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
32 changes: 6 additions & 26 deletions plugins/multiarc/ArcMix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ int Execute(HANDLE hPlugin,char *CmdStr,int HideOutput,int Silent,int ShowTitle,

if (CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 32768))
{
SetStdHandle(STD_OUTPUT_HANDLE,hChildStdoutWr);
SetStdHandle(STD_ERROR_HANDLE,hChildStdoutWr);

if (Silent)
{
/*hScreen=Info.SaveScreen(0,0,-1,0);
Expand All @@ -154,24 +151,18 @@ int Execute(HANDLE hPlugin,char *CmdStr,int HideOutput,int Silent,int ShowTitle,
Info.Message(Info.ModuleNumber,0,NULL,MsgItems,
ARRAYSIZE(MsgItems),0);
}
SetStdHandle(STD_OUTPUT_HANDLE,hChildStdoutWr);
SetStdHandle(STD_ERROR_HANDLE,hChildStdoutWr);
}
else
HideOutput=FALSE;
}
else
{
GetConsoleScreenBufferInfo(StdOutput,&csbi);

char Blank[1024];
FSF.sprintf(Blank,"%*s",csbi.dwSize.X,"");
for (int Y=0;Y<csbi.dwSize.Y;Y++)
Info.Text(0,Y,LIGHTGRAY,Blank);
Info.Text(0,0,0,NULL);

COORD C;
C.X=0;
C.Y=csbi.dwCursorPosition.Y;
SetConsoleCursorPosition(StdOutput,C);
Info.Control(hPlugin, FCTL_GETUSERSCREEN, NULL);
GetConsoleScreenBufferInfo(StdOutput, &csbi);
COORD C = { 0, csbi.dwCursorPosition.Y };
SetConsoleCursorPosition(StdOutput, C);
}


Expand Down Expand Up @@ -263,17 +254,6 @@ int Execute(HANDLE hPlugin,char *CmdStr,int HideOutput,int Silent,int ShowTitle,
SetConsoleMode(StdInput,ConsoleMode);
if (!HideOutput)
{
SMALL_RECT src;
COORD dest;
CHAR_INFO fill;
src.Left=0;
src.Top=2;
src.Right=csbi.dwSize.X;
src.Bottom=csbi.dwSize.Y;
dest.X=dest.Y=0;
fill.Char.AsciiChar=' ';
fill.Attributes=7;
ScrollConsoleScreenBuffer(StdOutput,&src,NULL,dest,&fill);
Info.Control(hPlugin,FCTL_SETUSERSCREEN,NULL);
}
if (hScreen)
Expand Down
6 changes: 6 additions & 0 deletions plugins/multiarc/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
drkns 17.05.2016 12:54:55 +0200 - build 197

1. ���������� FCTL_GETUSERSCREEN ��� ���������� ������ � Far 3.

2. SetStdHandle ���������� ������, ��� �����, ��� ������ ����� ���������.

svs 14.05.2014 20:03:02 +0400 - build

1. Add arcspa.lng
Expand Down
2 changes: 1 addition & 1 deletion plugins/multiarc/multiarcversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __MULTIARCVERSION_HPP__
#include "farversion.hpp"

#define MA_BUILD 196
#define MA_BUILD 197
#define MAPRODUCTNAME "MultiArc"
#define FMTDESCRIPTION "Second-level plugin module for MultiArc Far Manager plugin"

Expand Down

0 comments on commit 1584703

Please sign in to comment.