Click here to Skip to main content
15,911,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: keys codes in APIs like Keybd_Event Pin
David Crow9-Jul-07 7:18
David Crow9-Jul-07 7:18 
GeneralRe: keys codes in APIs like Keybd_Event Pin
V_shr9-Jul-07 7:27
V_shr9-Jul-07 7:27 
GeneralRe: keys codes in APIs like Keybd_Event Pin
Hamid_RT9-Jul-07 7:58
Hamid_RT9-Jul-07 7:58 
QuestionCtAbout popupMenu Pin
kcynic9-Jul-07 6:12
kcynic9-Jul-07 6:12 
AnswerRe: CtAbout popupMenu Pin
Mark Salsbery9-Jul-07 6:34
Mark Salsbery9-Jul-07 6:34 
Questionlosing dimensions in metafile Pin
Force Code9-Jul-07 6:02
Force Code9-Jul-07 6:02 
AnswerRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 6:38
Mark Salsbery9-Jul-07 6:38 
GeneralRe: losing dimensions in metafile [modified] Pin
Force Code9-Jul-07 6:54
Force Code9-Jul-07 6:54 
Mark Salsbery wrote:
I'm confused (not a rare event ). Are you actually changing the metafile before you put it
back on the clipboard?

If so, what methods/APIs are you using to do so?


As I stated, my goal for the moment is just to succeed in copying the data from the clipboard and replacing the content of the clipboard with the copy. However, the metafile's dimensions I put back to the clipboard are screwed up somehow.

Here's one code sample:

HENHMETAFILE henh = (HENHMETAFILE)GetClipboardData(CF_ENHMETAFILE);
int nSize = GetEnhMetaFileBits(henh,0,NULL);
BYTE* data = new BYTE[nSize];
GetEnhMetaFileBits(henh,nSize,data);
EmptyClipboard();
henh = SetEnhMetaFileBits(nSize,data);
SetClipboardData(CF_ENHMETAFILE,henh);

(yeah, its straight SDK.)
The copy that's put back has bitmap dimension info that has been altered. I say that, because if I don't mess with the clipboard at all, (as above) the bitmap is pasted with the dimensions most recently altered by user. With the code above, (which seemingly does nothing but replace the clipboard with a duplicate) when the paste is completed, the image has reverted to some previous dimensions.

In the above, I'm using GetEnhMetaFileBits/SetEnhMetaFileBits. However the same result occurs when just using CopyEnhMetaFile (as well as with yet another method for copying the metafile).




-- modified at 13:00 Monday 9th July, 2007
QuestionRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 9:19
Mark Salsbery9-Jul-07 9:19 
AnswerRe: losing dimensions in metafile Pin
Force Code9-Jul-07 12:53
Force Code9-Jul-07 12:53 
GeneralRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 16:49
Mark Salsbery9-Jul-07 16:49 
AnswerRe: losing dimensions in metafile Pin
Chris Losinger9-Jul-07 7:06
professionalChris Losinger9-Jul-07 7:06 
GeneralRe: losing dimensions in metafile Pin
Force Code9-Jul-07 7:21
Force Code9-Jul-07 7:21 
Questionconvert mpg to avi in directshow Pin
liur179-Jul-07 4:59
liur179-Jul-07 4:59 
AnswerRe: convert mpg to avi in directshow Pin
toxcct9-Jul-07 5:04
toxcct9-Jul-07 5:04 
AnswerRe: convert mpg to avi in directshow Pin
Mark Salsbery9-Jul-07 7:40
Mark Salsbery9-Jul-07 7:40 
GeneralRe: convert mpg to avi in directshow Pin
liur179-Jul-07 15:00
liur179-Jul-07 15:00 
GeneralRe: convert mpg to avi in directshow Pin
Mark Salsbery9-Jul-07 15:50
Mark Salsbery9-Jul-07 15:50 
GeneralRe: convert mpg to avi in directshow Pin
liur179-Jul-07 20:45
liur179-Jul-07 20:45 
QuestionRe: convert mpg to avi in directshow Pin
Hamid_RT9-Jul-07 7:59
Hamid_RT9-Jul-07 7:59 
QuestionLocalization using .rc resource and resource only dll in same EXE Pin
Neeranjan9-Jul-07 4:36
Neeranjan9-Jul-07 4:36 
QuestionWinsock issue (HTTP) Pin
PigeonRat9-Jul-07 4:24
PigeonRat9-Jul-07 4:24 
AnswerRe: Winsock issue (HTTP) Pin
PigeonRat9-Jul-07 4:37
PigeonRat9-Jul-07 4:37 
Questionfunction pointer Pin
eirche9-Jul-07 3:51
eirche9-Jul-07 3:51 
AnswerRe: function pointer Pin
Nibu babu thomas9-Jul-07 4:12
Nibu babu thomas9-Jul-07 4:12 

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.