#import "user32.dll" int GetParent(long hWnd); bool SetWindowPos(int hWnd, int hWndInserterAfter, int x, int y, int width, int height, uint uFlags); void keybd_event(int bVk, int bScan, int dwFlags, int dwExtraInfo); #import void OnStart() { if(ChartGetInteger(0,CHART_IS_MAXIMIZED,0)==1) { // ChartSetInteger(0,CHART_IS_DOCKED,0); keybd_event(0x12,0,0,0); keybd_event(0x52,0,0,0); keybd_event(0x12,0,0x0002,0); keybd_event(0x52,0,0x0002,0); } long FirstChartID = ChartFirst(); long SecondChartID = ChartNext(FirstChartID); long ThirdChartID = ChartNext(SecondChartID); long FourthChartID = ChartNext(ThirdChartID); long FirstChartHandle, SecondChartHandle, ThirdChartHandle, FourthChartHandle; int FirstChartParentHandle, SecondChartParentHandle, ThirdChartParentHandle, FourthChartParentHandle; ChartGetInteger ( FirstChartID, CHART_WINDOW_HANDLE, 0, FirstChartHandle); ChartGetInteger ( SecondChartID, CHART_WINDOW_HANDLE, 0, SecondChartHandle); ChartGetInteger ( ThirdChartID, CHART_WINDOW_HANDLE, 0, ThirdChartHandle); ChartGetInteger ( FourthChartID, CHART_WINDOW_HANDLE, 0, FourthChartHandle); //Each window to a chart; and a handle attached to the window FirstChartParentHandle = GetParent(FirstChartHandle); //Retrieves a handle to the specified window's parent or owner SecondChartParentHandle = GetParent(SecondChartHandle); //if the window is a child window, the return value is a handle to the parent window ThirdChartParentHandle = GetParent(ThirdChartHandle); FourthChartParentHandle = GetParent(FourthChartHandle); SetWindowPos( FirstChartParentHandle,0,1288, 0,640, 958,0); SetWindowPos( SecondChartParentHandle,0,900, 0,640, 958,0); SetWindowPos( ThirdChartParentHandle,0,450, 0,640, 958,0); SetWindowPos( FourthChartParentHandle,0,0,0, 620,958,0); }