Hello, I want to get data (CF_TEXT) from a clipboard. I've already copied some text. When I use this function, it sometimes returns "" (blank) instead of data in the clipboard. What's wrong with this code. Help me, please. CString CDictView::GetClipData() { CString vocab = ""; if (IsClipboardFormatAvailable(CF_TEXT)) { if (OpenClipboard()) { char* pData; pData = (char*)GetClipboardData(CF_TEXT); vocab = pData; EmptyClipboard(); } CloseClipboard(); } return vocab; } :-O
Pony
Posts
-
What's wrong with GetClipboardData? -
How to use WM_COPY?Hello, How to use WM_COPY if I want to copy some text in other application? ::SendMessage(m_hWnd, WM_COPY, 0, 0); I implemented this but it doesn't work. There's nothing in the clipboard. Help me, please. :-O
-
I want to know how to copy the highlighted text?Thank you very much. I've already send WM_COPY message but it doesn't work. There's nothing in the clipboard. ::SendMessage(m_hWnd, WM_COPY, 0, 0); I don't know why it doesn't work. Did I forget something? Guide me, please. :confused:
-
I want to know how to copy the highlighted text?Hello, I want to know how to copy the highlighted text to the clipboard (like pressing Ctrl+C) in my application using a button. What do I have to do after I map button control? The problem is the highlighted text is not only in my application but it's in the other application. (ex. browser, notepad, etc.) Help me, please. I have to finish my application within 4 days. Please...:((
-
How to get highlighted text by double click?Thank you very much. But there's a problem. I didn't get highlighted text from edit box but i want to get highlighted text from anywhere on screen (ex. in browser, spreadsheet, notepad, etc.). How can I get it? Guide me, please. :-O
-
How to get highlighted text by double click?Hello, I have a problem with text selection. I want to get the highlighted text that users double click on it (not only in my own application). Do I have to use COleDataObject to implement this? Is this about clipboard? I'm a beginner. Guide me, please.:-O
-
Why can't I toggle menu?Hello, Why can't I toggle menu? I have system tray menu that I want to toggle the 3rd menu item. But the problem is it doesn't toggle when I click it. Help me, please... ON_COMMAND(ID_FLOAT, OnFloat) void CMainFrame::OnFloat() { CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(2); UINT state = submenu->GetMenuState(ID_FLOAT, MF_BYCOMMAND); if (state & MF_CHECKED) { submenu->CheckMenuItem(ID_FLOAT, MF_UNCHECKED | MF_BYCOMMAND); } else { submenu->CheckMenuItem(ID_FLOAT, MF_CHECKED | MF_BYCOMMAND); } } :-O
-
Why can't I toggle menu?Hello, Why can't I toggle menu? I have system tray menu that I want to toggle the 3rd menu item. But the problem is it doesn't toggle when I click it. Help me, please... ON_COMMAND(ID_FLOAT, OnFloat) void CMainFrame::OnFloat() { CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(2); UINT state = submenu->GetMenuState(ID_FLOAT, MF_BYCOMMAND); if (state & MF_CHECKED) { submenu->CheckMenuItem(ID_FLOAT, MF_UNCHECKED | MF_BYCOMMAND); } else { submenu->CheckMenuItem(ID_FLOAT, MF_CHECKED | MF_BYCOMMAND); } } Thank you, :-O
-
How to hook?Hello.. I want to know how to hook all mouse messages in the windows system. (I'm writing an application that gets text input from where a mouse is pointed in every windows.) Guide me, please.:-O
-
How to map return-key(enter) from combobox?I'm making a dictionary application and I want to know how to map message, when users key-in their vocabulary in combobox and then press enter, with my "Search" procedure. I already mapped button message with my "Search" procedure. I don't know how to use WM_KEYDOWN or ON_WM_KEYDOWN. Help me, please..:-O
-
mouse over ??How can i get the word that has a mouse pointed over it? (note : Any words that appear on screen, not only on the active window.) :confused: