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

C / C++ / MFC

 
AnswerRe: How do I get the correct font height in Hindi fonts? [modified] Pin
Adam Roderick J29-Jul-09 2:27
Adam Roderick J29-Jul-09 2:27 
AnswerRe: How do I get the correct font height in Hindi fonts? Pin
Iain Clarke, Warrior Programmer29-Jul-09 2:54
Iain Clarke, Warrior Programmer29-Jul-09 2:54 
GeneralRe: How do I get the correct font height in Hindi fonts? Pin
Adam Roderick J29-Jul-09 3:03
Adam Roderick J29-Jul-09 3:03 
GeneralRe: How do I get the correct font height in Hindi fonts? Pin
Gywox29-Jul-09 4:42
Gywox29-Jul-09 4:42 
QuestionHow to GetHandle of Windows from Resource ID in ATL COM Pin
am 200929-Jul-09 1:43
am 200929-Jul-09 1:43 
AnswerRe: How to GetHandle of Windows from Resource ID in ATL COM Pin
Adam Roderick J29-Jul-09 1:55
Adam Roderick J29-Jul-09 1:55 
AnswerRe: How to GetHandle of Windows from Resource ID in ATL COM Pin
Iain Clarke, Warrior Programmer29-Jul-09 2:55
Iain Clarke, Warrior Programmer29-Jul-09 2:55 
QuestionHow to control other non-focus application? Pin
audi0229-Jul-09 1:12
audi0229-Jul-09 1:12 
The project:
I wrote a program Ahook that hooks the keyboard and mouse events appear in the system and send them to other target application – the Paint which is not in focus and is in background window (i don't want it to be in focus and want it to be in the background). It means that I can for example move and use the mouse anywhere on the desktop or on any other application, but the Paint program will be operated as like the mouse was moving over it.

How it is done:
The Ahook uses the follow function to hook all keyboard and mouse events:

hHook=SetWindowsHookEx(WH_JOURNALRECORD,journalRecordProc, AhookInstance,0);

In order to send the messages to the Paint, the Ahook uses the follow function:

PostMessage(hPaintWnd, message,0, (iNy<<16) + iNx);

iNx and iNy are normalized mouse location values -means, I change the real location of the mouse to a location that is on the Paint program.

Results and problem:
I used the Spy++ to check the operation of all this and the Paint program receives all events Ahook sends. The location of the mouse as Paint sees is ok, means that paints "thinks" that the mouse is moving on it. But there is problem – the Paint program doesn't react to the events although it receives them. Why???
a) Is it because Paint is not in focus?
b) Is it because the messages found by WH_JOURNALRECORD hooked are not the relevant for sending to the Paint getmessage loop ?
c) Is there any other reason?

Some more information that may lead to conclusion:
a) Looking the Spy++ results for events Paint sees when Ahook sent it, shows very simple events such as WM_MOUSEMOVE and WM_LBUTTONDOWN etc.
b) Looking the Spy++ results for events received when mouse is used on the Paint, shows that the messages are much more complicated than just mouse move and mouse button down/up. It contains WM_NCHITTEST, WM_SETCURSOR, WM_NCMOUSEMOVE (but not WM_MOUSEMOVE) etc, is it says that what Ahook sends is not the relevant information???

Thansk
AnswerRe: How to control other non-focus application? Pin
Adam Roderick J29-Jul-09 1:41
Adam Roderick J29-Jul-09 1:41 
GeneralRe: How to control other non-focus application? Pin
audi0229-Jul-09 9:59
audi0229-Jul-09 9:59 
QuestionRe: How to control other non-focus application? Pin
audi023-Aug-09 22:49
audi023-Aug-09 22:49 
QuestionCreating a Data stream Pin
VCProgrammer29-Jul-09 0:55
VCProgrammer29-Jul-09 0:55 
AnswerRe: Creating a Data stream Pin
Iain Clarke, Warrior Programmer29-Jul-09 2:59
Iain Clarke, Warrior Programmer29-Jul-09 2:59 
QuestionHow to display the OpenCV image in CView (MFC) Pin
Sonhye Aui28-Jul-09 23:56
Sonhye Aui28-Jul-09 23:56 
QuestionHow to set proxy with xmlhttprequest Pin
Ash_VCPP28-Jul-09 23:30
Ash_VCPP28-Jul-09 23:30 
QuestionCHttpFile::SendRequest problem Pin
msn9228-Jul-09 22:29
msn9228-Jul-09 22:29 
AnswerRe: CHttpFile::SendRequest problem Pin
msn9228-Jul-09 22:58
msn9228-Jul-09 22:58 
GeneralRe: CHttpFile::SendRequest problem Pin
Swapnil Shah28-Jul-09 23:11
Swapnil Shah28-Jul-09 23:11 
GeneralRe: CHttpFile::SendRequest problem Pin
msn9229-Jul-09 1:32
msn9229-Jul-09 1:32 
QuestionScrolling into CListCtrl Pin
siko228-Jul-09 22:13
siko228-Jul-09 22:13 
AnswerRe: Scrolling into CListCtrl Pin
«_Superman_»28-Jul-09 22:49
professional«_Superman_»28-Jul-09 22:49 
QuestionMFC debug checking? Pin
duongcntt4b28-Jul-09 21:47
duongcntt4b28-Jul-09 21:47 
AnswerRe: MFC debug checking? Pin
Code-o-mat28-Jul-09 22:08
Code-o-mat28-Jul-09 22:08 
QuestionHow to find out a file location Using C language in windows programming? Pin
WindowsVsLinux28-Jul-09 21:32
WindowsVsLinux28-Jul-09 21:32 
QuestionRe: How to find out a file location Using C language in windows programming? Pin
CPallini28-Jul-09 21:38
mveCPallini28-Jul-09 21:38 

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.