Teen Programmers Unite  
 

 

Return to forum top

Getting the focused/selected text of a window in Win32

Posted by Edgar [send private reply] at August 30, 2001, 02:50:36 AM

How can I get the focused or selected text of the other window, if I have this
CWnd *nextWind = CWnd::GetNextWindow()
or smth like this.



Please help.
Thanks in adnance.

Edgar

Posted by taubz [send private reply] at August 31, 2001, 10:17:31 PM

Look up the EM_GETSEL message in the MSDN (msdn.microsoft.com/library - it makes a good download)

- taubz

Posted by TheTutor [send private reply] at September 01, 2001, 06:18:32 PM

If you other window is a control window you can call

int GetWindowText(HWND hwnd, // handle to window or control with text
LPTSTR lp_string, // address of buffer for text
int count // maximum number of characters to copy
};

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.