Pos
Zero-based number of the window to retrieve information for.
Pos = -1 will return information for the current window.
Type
Window type. Can be one of the following (the
WINDOWINFO_TYPE enumeration):
Modified
Modification flag.
Can be set only if Type = WTYPE_EDITOR.
Current
Nonzero if the window is active.
TypeName
The name of the window type (Panels,View,Edit,Help,VMenu),
depends on the current language setting of Far.
Name
Window title. For WTYPE_VIEWER and
WTYPE_EDITOR windows this is a file name. For panels, the name of the currently selected file object.
For the help window - full path to the opened HLF file. For menu and dialogs - header.
void GetFarWindowInfo()
{
WindowInfo WInfo;
int CountWindow;
int I;
FILE *Fp;
if((Fp=fopen("window.log","a+t")) == NULL)
return ;
// request window count
CountWindow=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETWINDOWCOUNT,NULL);
fprintf(Fp,"WindowCount=%i\n",CountWindow);
for ( I=0; I < CountWindow; I++ )
{
WInfo.Pos=I;
// request window information
Info.AdvControl(Info.ModuleNumber,ACTL_GETWINDOWINFO,(void*)&WInfo);
// output it
fprintf(Fp,"Window[%i], Type=%i (%s), File=[%s] Current=%i, Modified=%i\n",
I,WInfo.Type,WInfo.TypeName,WInfo.Name,
WInfo.Current,WInfo.Modified);
}
fclose(Fp);
// set window number 1 (i.e. second)
Info.AdvControl(Info.ModuleNumber,ACTL_SETCURRENTWINDOW,(void*)1);
}