Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In win32 C++ how can i enable static text control to copy text?

Tags:

c++

winapi

I am writing a simple win32 application that has a window and static text , now I want to enable the user to copy the text with his right click (mark and copy) how can i do that?

LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG1 DIALOG 0, 0, 369, 318
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Win32 demo"
FONT 8, "Ms Shell Dlg"
{
     LTEXT           "Questions to [email protected]", IDC_STATIC, 96, 87, 150, 8, SS_LEFT
}
like image 580
user63898 Avatar asked Jun 12 '11 06:06

user63898


1 Answers

You can't do this with static text. In particular you can't highlight text. Instead you should use a read only edit control.

like image 98
David Heffernan Avatar answered Oct 24 '22 01:10

David Heffernan