January 31st, 2012, 12:05 PM
Set Text In Another Application's Dialog Box?
Trader Work Station forces you to set a time at which the application will close each day. Shortly before the close time the below Window pops up:
At this point you can change the exit time to 1minute before the current time to avoid the forced exit.
I wanted to automate this process so tried the following code:
Unfortunately this sets the title of the window to "05:30" rather than the contents of the edit box. Clearly I need the handle of the edit control rather than the window, but I'm not sure how to get this. Things are made more complicated by the fact that TWS is a Java application.
CWnd* pWnd = CWnd::FindWindow(NULL, "DU79106 Exit Session Setting (Simulated Trading)");
pWnd->SendMessage(WM_SETTEXT, 0, LPARAM("05:30"));
Is it possible to send text to the edit control of this dialog box? If so how cold it be done?
Thanks in advance for any advice you can offer.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.