//+------------------------------------------------------------------+
//| lango ismieru keitimas.mq4 |
//| Copyright 2017, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| windowresize.mq5 |
//+------------------------------------------------------------------+
#import "user32.dll"
int SetWindowPos(int hWnd,int hWndInsertAfter,int X,int Y,int cx,int cy,int uFlags);
int GetParent(int hWnd);
int GetTopWindow(int hWnd);
int GetWindow(int hWnd,int wCmd);
#import
#define GW_HWNDNEXT 0x0002
#define SWP_NOSIZE 0x0001
#define SWP_NOMOVE 0x0002
#define SWP_NOZORDER 0x0004
#define SWP_FRAMECHANGED 0x0020
int gr2x1_P1[]={PERIOD_D1,PERIOD_W1,PERIOD_H4}; // Period of grafic 1 of 2x1
int CXShift2x1[]={0,0,399}; // Horizontal shift of grafic 1 of 2x1
int CYShift2x1[] = {200,555,200}; // Vertical shift of grafic 1 of 2x1
int CXSize2x1[] = {399,399,200}; // Width of grafic 1 of 2x1
int CYSize2x1[] = {355,377,710}; // Height of grafic 1 of 2x1
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnStart()
{
long charthandle=-1;
int parenthandle;
//{
ResetLastError();
int i;
for(i=0; i<3; i++)
{
long h=ChartOpen("EURUSD",gr2x1_P1);Print("ChartOpen ",h);
int hMDIClient=GetParent((int)ChartGetInteger(ChartID(),CHART_WINDOW_HANDLE));
Print("hMDIClient ",hMDIClient);
//Sleep(5000);
int hChildWindow=GetTopWindow(hMDIClient);Print("hChildWindow ",hChildWindow);
while(hChildWindow>0)
{
SetWindowPos(hMDIClient,0,CXShift2x1,CYShift2x1,CXSize2x1,CYSize2x1,0x0004|0x0010);
SetWindowPos(hMDIClient,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
hChildWindow=GetWindow(hChildWindow,GW_HWNDNEXT);
}
}
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+