Click here to Skip to main content
15,921,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to modify context menu of the editor of ComboBox Pin
Anna-Jayne Metcalfe1-Jun-03 23:42
Anna-Jayne Metcalfe1-Jun-03 23:42 
GeneralRe: How to modify context menu of the editor of ComboBox Pin
Doan Quang Minh2-Jun-03 6:22
Doan Quang Minh2-Jun-03 6:22 
GeneralRe: How to modify context menu of the editor of ComboBox Pin
Anna-Jayne Metcalfe2-Jun-03 10:54
Anna-Jayne Metcalfe2-Jun-03 10:54 
GeneralRe: How to modify context menu of the editor of ComboBox Pin
Doan Quang Minh2-Jun-03 21:41
Doan Quang Minh2-Jun-03 21:41 
GeneralRe: How to modify context menu of the editor of ComboBox Pin
Anna-Jayne Metcalfe2-Jun-03 22:35
Anna-Jayne Metcalfe2-Jun-03 22:35 
QuestionHow 2 Add Custom features to Active -X Control Pin
Vikrant Vikrant1-Jun-03 19:03
Vikrant Vikrant1-Jun-03 19:03 
Generalsend .bmp or .gif or .jpg file to clipboard Pin
CS4291-Jun-03 18:48
CS4291-Jun-03 18:48 
GeneralRe: send .bmp or .gif or .jpg file to clipboard Pin
Roger Allen2-Jun-03 2:03
Roger Allen2-Jun-03 2:03 
First you need to get hold of a class that can read in the file type you want to use. I beleive that soem are available here on CP. After that, once loaded you should have a handle to a HDIB which can be placed on the clipboard something like this:

BITMAPINFOHEADER header;
header.biWidth = m_sizes.cx;
header.biHeight = m_sizes.cy;
header.biSizeImage = 3 * m_sizes.cx * m_sizes.cy;
header.biSize = 40;
header.biPlanes = 1;
header.biBitCount =  3 * 8;         // RGB
header.biCompression = 0;
header.biXPelsPerMeter = 0;
header.biYPelsPerMeter = 0;
header.biClrUsed = 0;
header.biClrImportant = 0;

// Generate handle
HANDLE handle = (HANDLE)::GlobalAlloc (GHND, sizeof(BITMAPINFOHEADER) + 3 * m_sizes.cx * m_sizes.cy);
if (handle != NULL)
{
    // Lock handle
    char *pData = (char *)::GlobalLock((HGLOBAL)handle);
    // Copy header and data
    memcpy(pData, &header, sizeof(BITMAPINFOHEADER));
    memcpy(pData + sizeof(BITMAPINFOHEADER), m_pPixelData, 3 * m_sizes.cx * m_sizes.cy);
    // Unlock
    ::GlobalUnlock((HGLOBAL)handle);
    // Push DIB in clipboard
    OpenClipboard();
    EmptyClipboard();
    SetClipboardData(CF_DIB ,handle);
    CloseClipboard();
}


Note that this is a code extract from an app which exports an OpenGL image to clipboard. It gives the general principles you need to follow.


Roger Allen
Sonork 100.10016

Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
GeneralRe: send .bmp or .gif or .jpg file to clipboard Pin
CS4292-Jun-03 20:31
CS4292-Jun-03 20:31 
GeneralDDX Control Problem Pin
Steven M Hunt1-Jun-03 18:42
Steven M Hunt1-Jun-03 18:42 
GeneralRe: DDX Control Problem Pin
peterchen1-Jun-03 18:50
peterchen1-Jun-03 18:50 
GeneralRe: DDX Control Problem Pin
Steven M Hunt1-Jun-03 18:55
Steven M Hunt1-Jun-03 18:55 
GeneralRe: DDX Control Problem Pin
Anna-Jayne Metcalfe1-Jun-03 23:49
Anna-Jayne Metcalfe1-Jun-03 23:49 
GeneralAbout as win32 question. Pin
sunjohn1-Jun-03 17:16
sunjohn1-Jun-03 17:16 
GeneralRe: About as win32 question. Pin
Toni781-Jun-03 20:00
Toni781-Jun-03 20:00 
GeneralRe: About as win32 question. Pin
sunjohn1-Jun-03 22:09
sunjohn1-Jun-03 22:09 
GeneralRe: About as win32 question. Pin
Toni782-Jun-03 12:20
Toni782-Jun-03 12:20 
GeneralNET SEND ~ HELP ME Pin
BoyceMan1-Jun-03 16:48
BoyceMan1-Jun-03 16:48 
GeneralRe: NET SEND ~ HELP ME Pin
Ken Mazaika1-Jun-03 17:00
Ken Mazaika1-Jun-03 17:00 
GeneralRe: NET SEND ~ HELP ME Pin
Chris Richardson1-Jun-03 17:20
Chris Richardson1-Jun-03 17:20 
GeneralRe: NET SEND ~ HELP ME Pin
Abbas_Riazi1-Jun-03 19:34
professionalAbbas_Riazi1-Jun-03 19:34 
GeneralRe: NET SEND ~ HELP ME Pin
BoyceMan2-Jun-03 9:09
BoyceMan2-Jun-03 9:09 
GeneralRe: NET SEND ~ HELP ME Pin
Tom Wright2-Jun-03 11:49
Tom Wright2-Jun-03 11:49 
GeneralRe: NET SEND ~ HELP ME Pin
BoyceMan2-Jun-03 11:59
BoyceMan2-Jun-03 11:59 
GeneralRe: NET SEND ~ HELP ME Pin
Abbas_Riazi2-Jun-03 19:52
professionalAbbas_Riazi2-Jun-03 19:52 

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.