Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Removing application icon from alt+tab list Pin
Tomasz Sowinski12-Mar-02 22:54
Tomasz Sowinski12-Mar-02 22:54 
GeneralRe: Removing application icon from alt+tab list Pin
KGS12-Mar-02 23:47
KGS12-Mar-02 23:47 
GeneralHelp! Pin
Jacky Wu12-Mar-02 22:27
Jacky Wu12-Mar-02 22:27 
GeneralUse Stingray Objective Grid 97 Pin
Simon Roth12-Mar-02 21:12
Simon Roth12-Mar-02 21:12 
GeneralRe: Use Stingray Objective Grid 97 Pin
Tomasz Sowinski12-Mar-02 23:04
Tomasz Sowinski12-Mar-02 23:04 
GeneralWindows CE and System font Pin
12-Mar-02 20:56
suss12-Mar-02 20:56 
QuestionHow to get highlighted text by double click? Pin
Pony12-Mar-02 20:07
Pony12-Mar-02 20:07 
AnswerRe: How to get highlighted text by double click? Pin
Tomasz Sowinski12-Mar-02 23:12
Tomasz Sowinski12-Mar-02 23:12 
Yes, it's about clipboard. This code places the contents of strClipboardText variable in clipboad. You'll probably use CEdit::GetSel and CEdit::GetSel and CEdit::GetWindowText to get this string.
CString strClipboardText = ...;

if (!OpenClipboard() || !EmptyClipboard())
{
	AfxMessageBox("Error: can't open the clipboard.");
	return;
}
HGLOBAL hglbText = GlobalAlloc(GMEM_MOVEABLE, 1 + strClipboardText.GetLength()); 
char *pData = (char *)GlobalLock(hglbText); 
lstrcpy(pData, strClipboardText);
GlobalUnlock(hglbText); 
SetClipboardData(CF_TEXT, hglbText);
CloseClipboard();


Assuming that you're using CEdit control, there will be a problem with double-clicking - this action highlights the *word* you're clicking on. Previous selection is lost. You may try to override WM_LBUTTONDBLCLK to change this behavior.

Tomasz Sowinski -- http://www.shooltz.com
GeneralRe: How to get highlighted text by double click? Pin
Pony13-Mar-02 6:22
Pony13-Mar-02 6:22 
QuestionCListCtrl -Max Visible text length 260? Pin
12-Mar-02 18:45
suss12-Mar-02 18:45 
AnswerRe: CListCtrl -Max Visible text length 260? Pin
Tomasz Sowinski12-Mar-02 22:57
Tomasz Sowinski12-Mar-02 22:57 
Generalwriting a plugin Pin
Dor12-Mar-02 14:34
Dor12-Mar-02 14:34 
GeneralRe: writing a plugin Pin
alex.barylski12-Mar-02 19:36
alex.barylski12-Mar-02 19:36 
GeneralCEvent Syncronization Class! Pin
MarkPQ12-Mar-02 13:58
MarkPQ12-Mar-02 13:58 
GeneralRe: CEvent Syncronization Class! Pin
Serge Krynine12-Mar-02 14:16
Serge Krynine12-Mar-02 14:16 
GeneralCreating Styles... Pin
CDuddley12-Mar-02 13:49
CDuddley12-Mar-02 13:49 
GeneralRe: Creating Styles... Pin
Maximilien12-Mar-02 15:20
Maximilien12-Mar-02 15:20 
GeneralRe: Creating Styles... Pin
alex.barylski12-Mar-02 15:49
alex.barylski12-Mar-02 15:49 
GeneralRe: Creating Styles... Pin
CDuddley12-Mar-02 16:27
CDuddley12-Mar-02 16:27 
GeneralRe: Creating Styles... Pin
Serge Krynine12-Mar-02 17:02
Serge Krynine12-Mar-02 17:02 
GeneralRe: Creating Styles... Pin
alex.barylski12-Mar-02 19:29
alex.barylski12-Mar-02 19:29 
GeneralCPP question Pin
alex.barylski12-Mar-02 13:01
alex.barylski12-Mar-02 13:01 
GeneralRe: CPP question Pin
Rick York12-Mar-02 14:59
mveRick York12-Mar-02 14:59 
GeneralRe: CPP question Pin
alex.barylski12-Mar-02 15:37
alex.barylski12-Mar-02 15:37 
GeneralRe: CPP question Pin
Jon Hulatt12-Mar-02 22:25
Jon Hulatt12-Mar-02 22:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.