Download MetaTrader 5
To add comments, please log in or register
Start making profit using the Market. Publish your product!
Mom_markets1
88
Mom_markets1 2013.02.06 23:06 
I have been able to get almost every wm command to work except this one:



 PostMessageA(hndl, WM_COMMAND, 34100, 0); // for the first profile

 

it is supposed to change profiles. I have been able to get every other wm command to work, and the only code that changes is what you see

above. I have tried in multiple mt4 clients and on different machines. 


is there a different function I should be using? is PostMessageA correct? 


Having the ability to change the profiles on a vps is a great tool, and it can allow you to run many indicators, and simply change the profiles

every minute or so to rotate through them all. 

qjol
3243
qjol 2013.02.07 02:46  
i'm not a genius.... can u show us the relevant code (working just fine for me)
Paul
63
Paul 2013.02.07 06:17  
Mom_markets:

 

 PostMessageA(hndl, WM_COMMAND, 34100, 0); // for the first profile

 


How are you setting & checking the hndl parameter? I suspect it is invalid.

Regards, Paul.

Paul
63
Paul 2013.02.07 07:16  

Alternative method to mimick CTRL+F5 keyboard shortcut:

 

#include <WinUser32.mqh>

#import "user32.dll"
void keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo);

#define VK_SHIFT    16  //SHIFT key
#define VK_CONTROL  17  //CTRL key
#define VK_F5       116 //F5 key
                   
int start()
{    
  keybd_event(VK_CONTROL,0,0,0);
  keybd_event(VK_F5,0,0,0);
  keybd_event(VK_F5,0,KEYEVENTF_KEYUP,0);
  keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);  
}
qjol
3243
qjol 2013.02.07 08:01  
paul_hughes:

Alternative method to mimick CTRL+F5 keyboard shortcut:

not such a good idea, if he has 25 profiles he supposed to do it a few times, moreover, How can he verify when he gets the right profile
Paul
63
Paul 2013.02.07 09:10  
qjol:
not such a good idea, if he has 25 profiles he supposed to do it a few times, moreover, How can he verify when he gets the right profile


Because he wants to:

...simply change the profiles every minute or so to rotate through them all.  

 Regards, Paul.

qjol
3243
qjol 2013.02.07 09:23  
come on...
Paul
63
Paul 2013.02.07 14:56  
qjol:
come on...

What do you mean?
TradertoolsFX
17
TradertoolsFX 2013.04.30 02:27  

The wParam for Next Profile is 33152 and Previous Profile is 35465

Only use 34100 if you know the position of the profile you want to change to ... 34100 is first profile, 34101 is second, 34102 is third, and so on ...

 You could iterate through the profiles, but you should find the menu count first and keep in mind to disregard the first 4 items. Easier to just use one of the above two codes for next and previous.

whroeder1
13597
whroeder1 2013.04.30 13:29  
Mom_markets: Having the ability to change the profiles 
is ridiculous. Don't overly complicate things. Create multiple terminal installations, one per profile. Done.
rp22rp22rp22
21
rp22rp22rp22 2014.04.15 15:42  

I'm trying to find a way to automate my ctrl f5 key

I was reading these posts. Can anyone tell me if Paul's post can do that?

Is his post an ea or script?

Is there a place on this site that I can post what I need programmed and get some kind of quotes to have it done?

Thanks for any guidance

Rick

/
To add comments, please log in or register