Hi, I want to use dll files to get lot size from One Click Trading
My Progress, I got the handle of that edit box using below code:
#import "user32.dll"int FindWindowW(string className, string windowName);
int FindWindowExW(int hwndParent, int hwndChildAfter, string className, string windowName);
int GetWindowTextW(int hWnd, string lpString, int nMaxCount);
int GetParent(int hWnd);
int SendMessageW(int hWnd, int Msg, int wParam, string lParam);
#import
int hwndMT4 = FindWindowW("MetaQuotes::MetaTrader::4.00", NULL);
if (hwndMT4 == 0)
return -1;
int hwndMDIClient = FindWindowExW(hwndMT4, 0, "MDIClient", NULL);
if (hwndMDIClient == 0)
return -2;
int hwndAboveChart = FindWindowExW(hwndMDIClient, 0, "Afx:00610000:b:00010003:00000006:000715CD", NULL);
if (hwndAboveChart == 0)
return -3;
int hwndChart = FindWindowExW(hwndAboveChart, 0, "AfxFrameOrView140s", NULL);
if (hwndChart == 0)
return -4;
int hwndEdit = FindWindowExW(hwndChart, 0, "Edit", NULL);
if (hwndEdit == 0)
return -5;
Afx:00610000:b:00010003:00000006:000715CD -> This value changes on restart, I use WinSpy++ tool to see this value(Will do something to not need them once I get the lot size value) (WinSpy++ attached below)
hwndEdit -> This variable gets the handle of the main edit box that contains the lot size
But I am unable to get the lot size, I have tried below:
1.)
// Get the lot size text from the edit boxstring lotSizeText;
GetWindowTextW(hwndEdit, lotSizeText, 31);
Doesn't do anything and I do not get anything in my variable
2.)
// Get the lot size text from the edit boxstring lotSizeText;
constint WM_GETTEXT = 0x000D;
SendMessageW(hwndEdit, WM_GETTEXT, 31, lotSizeText);
Again, Doesn't do anything
I was happy finally finding the Edit box handle but I can't get the text out of it, It's the worst
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi, I want to use dll files to get lot size from One Click Trading
My Progress, I got the handle of that edit box using below code:
Afx:00610000:b:00010003:00000006:000715CD -> This value changes on restart, I use WinSpy++ tool to see this value(Will do something to not need them once I get the lot size value) (WinSpy++ attached below)But I am unable to get the lot size, I have tried below:
1.)
Doesn't do anything and I do not get anything in my variable
2.)
Again, Doesn't do anything
I was happy finally finding the Edit box handle but I can't get the text out of it, It's the worst
Some help will be really appreaciated