Chart minimising in CrapQl4

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Chart minimising in CrapQl4

Post by SteveHopwood »

One for the Proper Coders here.

I would love to give users of my DFC Dashboard EA the option to have each newly-opened chart starting minimised.

Any of you Clever Clogs know how to do this?

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

Chart minimising in CrapQl4

Post by renexxxx »

SteveHopwood » Thu May 18, 2017 5:44 am wrote:One for the Proper Coders here.

I would love to give users of my DFC Dashboard EA the option to have each newly-opened chart starting minimised.

Any of you Clever Clogs know how to do this?

:xm:
Steve,

Unfortunately, we need the help of the WinAPI for this. This code below seems to work:

Code: Select all

bool chartMinimize(long chartID = 0) {

   if (chartID == 0) chartID = ChartID();
   
   int chartHandle = (int)ChartGetInteger( chartID, CHART_WINDOW_HANDLE, 0 );
   int chartParent = GetParent(chartHandle);
   
   return( ShowWindow( chartParent, SW_FORCEMINIMIZE ) );
}
See attached code for a test script that first minimizes all windows, waits and then maximizes them all again.

Hopes that this is of any use to you.
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Chart minimising in CrapQl4

Post by SteveHopwood »

Fantastic Rene. Thanks very much. :clap: :clap: :clap: :clap: :clap: :clap: :clap:

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Coders Hangout”