Download MetaTrader 5
To add comments, please log in or register
Do you want to learn MQL5? 300 articles will help you!
tao zemin.
402
tao zemin. 2014.12.03 15:46 

Dear all, 

  May i know  how to programmatically arrange windows as non-overlapping tiles? Since MT5 provide a toolbar(by pressing ALT+R) for or this. I searched the MT5 manual but cannnot find the API. 

Many thanks for your help. 

taozemin

Alain Verleyen
Moderator
30295
Alain Verleyen 2014.12.03 16:25  
taozemin:

Dear all, 

  May i know  how to programmatically arrange windows as non-overlapping tiles? Since MT5 provide a toolbar(by pressing ALT+R) for or this. I searched the MT5 manual but cannnot find the API. 

Many thanks for your help. 

taozemin

You can't do that with mql5. Only possible way is with WINAPI.
tao zemin.
402
tao zemin. 2014.12.04 05:38  

 Interesting. If i know message ID for arranging the windows as non-overlapping tiles, the problem will be almost solved..... Would you please give some hints on this issue? thank you.

   
Alain Verleyen
Moderator
30295
Alain Verleyen 2014.12.04 10:43  
taozemin:

 Interesting. If i know how an EA or indicator can post a message to the terminal MDI, the problem is partly solved..... Would you please give some hints on this issue? thank you.

   
Search mql4.com forum with PostMessageA. You can do similar things with MT5/mql5.
tao zemin.
402
tao zemin. 2014.12.08 09:42  
angevoyageur:
Search mql4.com forum with PostMessageA. You can do similar things with MT5/mql5.

Dear angevoyageur,

   THank you for your instruction. I've already done that. and from the materials I got. I composed the following script which is suggested to make the charts cascased.But after I compiled and ran the script, it produces no reponse! I am not familiar with windows messaging API, and I'am completely puzzled by the phenomenon! Is there anything that i have missed?! Many thanks for your time and consideration.

taozemin.

 

#import "user32.dll"
   int GetParent(int hWnd);
  int GetAncestor(int, int);
   int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
   int PostMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDITILE    0x226
#define WM_MDICASCADE 0x0227


void OnStart()
{
   int hMDI = GetParent(GetParent(ChartWindowFind()));
   //int hMDI = GetAncestor(ChartWindowFind(),2);
   int ret=SendMessageA(hMDI, WM_MDICASCADE, 0, 0);
}
Alain Verleyen
Moderator
30295
Alain Verleyen 2014.12.08 11:17  
taozemin:

Dear angevoyageur,

   THank you for your instruction. I've already done that. and from the materials I got. I composed the following script which is suggested to make the charts cascased.But after I compiled and ran the script, it produces no reponse! I am not familiar with windows messaging API, and I'am completely puzzled by the phenomenon! Is there anything that i have missed?! Many thanks for your time and consideration.

taozemin.

 

You are confusing subwindows number with Window handle.

   int wHandle=(int)ChartGetInteger(0,CHART_WINDOW_HANDLE);
   int hMDI = GetParent(GetParent(wHandle));
tao zemin.
402
tao zemin. 2014.12.08 12:22  
angevoyageur:

You are confusing subwindows number with Window handle.

Dear angevoyageur:

  So wonderful the solutiion is! Thank you so much!

taozemin.

/
To add comments, please log in or register