Click here to Skip to main content
16,004,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Mark Salsbery wrote:
Probably a dumb question, but are you creating a new metafile created by drawing using the new
dimensions or editing an existing metafile when the user alters something?

Also, what do you mean by "the bitmap is pasted"?


OK, here's the scenario:

A user copies a bitmap from some source to the client area of this application. Then, in the client area, he resizes the bitmap by dragging an edge of it. Then he copies this resized bitmap (ctrl-c) and pastes it somewhere else in the client area (ctrl-v). Once he resized the image, the application converted it from a bitmap to a memory metafile. So, when it is copied with ctrl-c, it is copied as a metafile and then pasted as a metafile.

What I have done is just intercept the paste message right before the image (i.e. the meta file) is pasted. Then, for now, i.e. *strictly for testing purposes*, all I've done is make a duplicate of the clipboard data (i.e. the metafile), and replaced the clipboard data with this duplicate metafile. So basically NOTHING should be changed *AT ALL*. But when the image is pasted, its size has reverted to what it was before the user resized it.

Understand?

Maybe I should have asked to begin with - have you ever copied metafiles from the clipboard.

Here is the complete code I used to intercept the paste msg:

//following excerpt is from a subclassed WndProc in a DLL
//injected into an application's address space:
.
.
.
case CM_PASTE_WP: {
OpenClipboard(hwnd);
if (IsClipboardFormatAvailable(CF_ENHMETAFILE)) {
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);
}
CloseClipboard();
}
break;

.
.
.

return CallWindowProc(r_obj->WordProcPrev,hwnd,message,wParam,lParam);

}
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 
GeneralRe: function pointer Pin
eirche9-Jul-07 4:18
eirche9-Jul-07 4:18 
AnswerRe: function pointer Pin
toxcct9-Jul-07 4:14
toxcct9-Jul-07 4:14 

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.