access data in dialog from win32 application
-
Hi, This question is related to win32 user interface programming. I need to use Single threaded runtime library and cannot use MFC. Thus I am using win32. I have designed a dialog that should take three float values as input. How do write the code to do data exchange so that values entered by the user are available to me in some local variable after the user has clicked "OK" on the dialog after entering some values. I can do this in MFC and but do not know how to do this using win32. I could create file open dialog using GetOpenFileName but did not find any similar function for writing data exchange code. Any help would be great as I am stuck and want to get this done asap. :) Thanks in advance for your help. Regards, Abhijit
-
Hi, This question is related to win32 user interface programming. I need to use Single threaded runtime library and cannot use MFC. Thus I am using win32. I have designed a dialog that should take three float values as input. How do write the code to do data exchange so that values entered by the user are available to me in some local variable after the user has clicked "OK" on the dialog after entering some values. I can do this in MFC and but do not know how to do this using win32. I could create file open dialog using GetOpenFileName but did not find any similar function for writing data exchange code. Any help would be great as I am stuck and want to get this done asap. :) Thanks in advance for your help. Regards, Abhijit
Use GetDlgItem to get the hwnd of the control (hWnd is your dialog's hwnd, nIDC is your control's resource id)
HWND hWndCtrl;
::GetDlgItem(hWnd, nIDC, &hWndCtrl);Use GetWindowText to then get the control's value:
TCHAR szT[64];
::GetWindowText(hWndCtrl, szT, _countof(szT));