anybody know windows API...

To add comments, please log in or register
Denis Sartakov
1547
Denis Sartakov  

developing DLL that is called from MT5 EA.

this Dll should emulate manual trading while actually tradings are made by EA.

so dll should wokr with mt5 open/close/modify window.

at now stage dll opened modify window for defined position in such way:

here is the code

        SendMessage(h_StopLossPipsEdit_msctls_updown32, UDM_SETBUDDY, reinterpret_cast<WPARAM>(h_StopLossPips_Edit), static_cast<LPARAM>(NULL));

        for (int i = 0; i < i_New_SL; i++)
        {
                SendMessage(h_StopLossPips_Edit,WM_KEYDOWN,VK_UP, NULL);
                SendMessage(h_StopLossPips_Edit,WM_KEYUP,VK_UP, NULL);
        }

this works but slow, so i want to place needed modify price for stoploss directly into stoploss edit window,

i placed but can't notify parent window about, so while price is valid "modify ..." button remanes "Disable":

 Edit_Enable(h_StopLossPips_Edit,TRUE);
        SendMessage(h_StopLossPips_Edit, WM_SETTEXT,0,(LPARAM)(LPCTSTR)pt_Text);
        Edit_SetModify(h_StopLossPips_Edit,TRUE);
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_CHANGE),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_UPDATE),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_ALIGN_RTL_EC),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_ALIGN_LTR_EC),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_MAXTEXT),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_VSCROLL),(LPARAM)(h_StopLossPips_Edit));
        SendMessage(GetParent(h_StopLossPips_Edit),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(h_StopLossPips_Edit),EN_SETFOCUS),(LPARAM)(h_StopLossPips_Edit));

what is wrong ?

To add comments, please log in or register