Can a MT4 genius tell me why this will not work?

 
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. 

 
i'm not a genius.... can u show us the relevant code (working just fine for me)
 
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.

 

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);  
}
 
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
 
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.

 
come on...
 
qjol:
come on...

What do you mean?
 

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.

 
Mom_markets: Having the ability to change the profiles 
is ridiculous. Don't overly complicate things. Create multiple terminal installations, one per profile. Done.
 

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

Reason: