Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat are the differences between them? Pin
decodeToMe14-Jun-09 5:56
decodeToMe14-Jun-09 5:56 
AnswerRe: What are the differences between them? Pin
Stuart Dootson14-Jun-09 6:22
professionalStuart Dootson14-Jun-09 6:22 
AnswerRe: What are the differences between them? Pin
Randor 14-Jun-09 6:32
professional Randor 14-Jun-09 6:32 
QuestionCreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? [modified] Pin
japcrword14-Jun-09 5:12
japcrword14-Jun-09 5:12 
QuestionRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
Randor 14-Jun-09 5:44
professional Randor 14-Jun-09 5:44 
AnswerRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
japcrword14-Jun-09 6:24
japcrword14-Jun-09 6:24 
GeneralRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
Randor 14-Jun-09 6:39
professional Randor 14-Jun-09 6:39 
GeneralRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? [modified] Pin
japcrword14-Jun-09 7:12
japcrword14-Jun-09 7:12 
Thank you for quick answer. I indeed use API hooks to intercept CreateCompatibleDC. The created by CreateCompatibleDC memory DC is used for drawing some text. I need to know what window this memory DC is applied to in the end.

Some dictionaries like stardict use the technique of API hooking to translate text. They can translate a word when a mouse hovers over the text. In my case I don't use mouse position, I need to filter some text according to what window it belongs to. I thought it was possible to use DC for that purpose. The idea was to intercept DrawText, TextOut etc, get HDC from their parameter and then bby call to WindowFromDC get window handle. The problem is that some application create DC in memory by CreateCompatibleDC(NULL) and do text output to the memory DC. The solution seemed to be in intercepting CreateCompatibleDC(NULL) and getting somehow the real DC by calling some (unknown to me) API-function from the intercepted CreateCompatibleDC, and finally getting window handle from WindowFromDC( <real DC> ).

I'm beginning to think that it isn't so simple as I initially supposed.

modified on Sunday, June 14, 2009 1:53 PM

GeneralRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
Randor 14-Jun-09 8:03
professional Randor 14-Jun-09 8:03 
GeneralRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
japcrword14-Jun-09 8:55
japcrword14-Jun-09 8:55 
GeneralRe: CreateCompatibleDC(NULL) == CreateCompatibleDC(hdc) for some hdc? Pin
Randor 14-Jun-09 9:34
professional Randor 14-Jun-09 9:34 
QuestionPlease solve my problem its very urgent Pin
santhosh-padamatinti14-Jun-09 1:23
santhosh-padamatinti14-Jun-09 1:23 
AnswerThe best way to make urgent question answered Pin
CPallini14-Jun-09 21:54
mveCPallini14-Jun-09 21:54 
QuestionRe: Please solve my problem its very urgent Pin
David Crow15-Jun-09 3:02
David Crow15-Jun-09 3:02 
AnswerRe: Please solve my problem its very urgent Pin
Randor 15-Jun-09 6:33
professional Randor 15-Jun-09 6:33 
Questionchar* as return type in dll Pin
_808613-Jun-09 23:05
_808613-Jun-09 23:05 
AnswerRe: char* as return type in dll Pin
Stuart Dootson14-Jun-09 2:26
professionalStuart Dootson14-Jun-09 2:26 
GeneralRe: char* as return type in dll Pin
_808614-Jun-09 4:13
_808614-Jun-09 4:13 
GeneralRe: char* as return type in dll Pin
_808614-Jun-09 4:21
_808614-Jun-09 4:21 
GeneralRe: char* as return type in dll Pin
0x3c014-Jun-09 6:44
0x3c014-Jun-09 6:44 
QuestionWhere does VC9 store its run time type info? Pin
followait13-Jun-09 16:55
followait13-Jun-09 16:55 
AnswerRe: Where does VC9 store its run time type info? Pin
harold aptroot13-Jun-09 22:44
harold aptroot13-Jun-09 22:44 
AnswerRe: Where does VC9 store its run time type info? Pin
Stuart Dootson14-Jun-09 2:26
professionalStuart Dootson14-Jun-09 2:26 
QuestionPassing CDialog results to CFormView ?? Pin
Vaclav_13-Jun-09 15:45
Vaclav_13-Jun-09 15:45 
AnswerRe: Passing CDialog results to CFormView ?? Pin
Stuart Dootson14-Jun-09 2:21
professionalStuart Dootson14-Jun-09 2:21 

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.