Click here to Skip to main content
15,894,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: font problem Pin
CPallini14-Jun-09 21:51
mveCPallini14-Jun-09 21:51 
AnswerRe: font problem Pin
«_Superman_»14-Jun-09 21:52
professional«_Superman_»14-Jun-09 21:52 
QuestionHow do I access live video stream from webcam installed on my server using C++? Pin
smorris1014-Jun-09 7:56
smorris1014-Jun-09 7:56 
AnswerRe: How do I access live video stream from webcam installed on my server using C++? Pin
«_Superman_»14-Jun-09 16:50
professional«_Superman_»14-Jun-09 16:50 
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 
As far as I understand, a call to CreateCompatibleDC(NULL) is equivalent to a call to CreateCompatibleDC(hdc) for some hdc (hdc is not NULL, of course).

The question is how to get hdc in the second call so that it is equivalent to the first one?

I actually need a handle of the window which is associated with the hdc. I was going to use WindowFromDC(hdc) for that porpose. Is it possible to find hdc and then to find window handle in that way?

The point is that 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 by 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=""> ).

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

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 
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 

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.