Click here to Skip to main content
15,907,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dumb Question. But Can't find an answer Pin
FISH7865-Mar-09 9:47
FISH7865-Mar-09 9:47 
GeneralRe: Dumb Question. But Can't find an answer Pin
Code-o-mat5-Mar-09 10:14
Code-o-mat5-Mar-09 10:14 
GeneralRe: Dumb Question. But Can't find an answer Pin
FISH7865-Mar-09 16:52
FISH7865-Mar-09 16:52 
GeneralRe: Dumb Question. But Can't find an answer Pin
Code-o-mat5-Mar-09 22:03
Code-o-mat5-Mar-09 22:03 
GeneralRe: Dumb Question. But Can't find an answer Pin
FISH7866-Mar-09 1:52
FISH7866-Mar-09 1:52 
GeneralRe: Dumb Question. But Can't find an answer Pin
Code-o-mat6-Mar-09 2:06
Code-o-mat6-Mar-09 2:06 
GeneralRe: Dumb Question. But Can't find an answer Pin
FISH7866-Mar-09 2:16
FISH7866-Mar-09 2:16 
GeneralRe: Dumb Question. But Can't find an answer Pin
Code-o-mat6-Mar-09 2:28
Code-o-mat6-Mar-09 2:28 
Well, first of all, am not sure you can actually query and fiddle with a DC of a window belonging to a different thread than yours, but you probably should not anyways... (WindowFromPoint may return a window handle which does not belong to your process)
Now, you create a memory DC there and blit "onto it", but...by default, a memory DC has a 1 pixel by 1 pixel sized, 1 bits per pixel colordepth bitmap selected into it, so when you call Bitblt, you will blit onto that bitmap which is most likely not what you want. You can use GetPixel on the window DC too, you don't need to BitBlt it to some memory DC. If you DO want to create a copy, you have to use -for example- CreateCompatiblebitmap[^], create a bitmap you want to blit onto with it, select this into your memory DC using SelectObject[^], storing the original bitmap handle SelectObject returns, perform the blitting and whatever you wish to do, then select the original bitmap handle into the memory DC before you destroy it, and then also destroy the buffer if you no longer need it using DeleteObject[^].

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <

GeneralRe: Dumb Question. But Can't find an answer Pin
FISH7866-Mar-09 2:42
FISH7866-Mar-09 2:42 
GeneralRe: Dumb Question. But Can't find an answer Pin
Code-o-mat6-Mar-09 2:45
Code-o-mat6-Mar-09 2:45 
AnswerRe: Dumb Question. But Can't find an answer Pin
Jonnie White6-Mar-09 3:44
Jonnie White6-Mar-09 3:44 
QuestionWin32 Pin
sarathbabununna5-Mar-09 4:56
sarathbabununna5-Mar-09 4:56 
AnswerRe: Win32 Pin
Code-o-mat5-Mar-09 6:22
Code-o-mat5-Mar-09 6:22 
Questioncatching ctreectrl's WM_ERASEBKGND Pin
kitkat120125-Mar-09 4:44
kitkat120125-Mar-09 4:44 
AnswerRe: catching ctreectrl's WM_ERASEBKGND Pin
Code-o-mat5-Mar-09 5:14
Code-o-mat5-Mar-09 5:14 
GeneralRe: catching ctreectrl's WM_ERASEBKGND Pin
kitkat120125-Mar-09 5:54
kitkat120125-Mar-09 5:54 
GeneralRe: catching ctreectrl's WM_ERASEBKGND Pin
Code-o-mat5-Mar-09 5:57
Code-o-mat5-Mar-09 5:57 
GeneralRe: catching ctreectrl's WM_ERASEBKGND Pin
kitkat120125-Mar-09 6:04
kitkat120125-Mar-09 6:04 
GeneralRe: catching ctreectrl's WM_ERASEBKGND Pin
Code-o-mat5-Mar-09 6:11
Code-o-mat5-Mar-09 6:11 
QuestionCan I make a new view of my document DYNAMICALLY and of a different class than the old view? (SDI Doc/View) Pin
Joseph Marzbani5-Mar-09 3:44
Joseph Marzbani5-Mar-09 3:44 
AnswerRe: Can I make a new view of my document DYNAMICALLY and of a different class than the old view? (SDI Doc/View) Pin
led mike5-Mar-09 4:16
led mike5-Mar-09 4:16 
QuestionLeftMouseClk and Hold it? Pin
Software20075-Mar-09 3:36
Software20075-Mar-09 3:36 
AnswerRe: LeftMouseClk and Hold it? Pin
Cedric Moonen5-Mar-09 3:47
Cedric Moonen5-Mar-09 3:47 
GeneralRe: LeftMouseClk and Hold it? Pin
Software20075-Mar-09 3:50
Software20075-Mar-09 3:50 
AnswerRe: LeftMouseClk and Hold it? Pin
Joseph Marzbani5-Mar-09 3:57
Joseph Marzbani5-Mar-09 3:57 

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.