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

C / C++ / MFC

 
Questionclient-server Pin
reyyy28-Jan-07 6:27
reyyy28-Jan-07 6:27 
AnswerRe: client-server Pin
reyyy29-Jan-07 4:56
reyyy29-Jan-07 4:56 
Questionwhy mouse hook processed 2 times? Pin
bengz28-Jan-07 6:22
bengz28-Jan-07 6:22 
AnswerRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:06
Mark Salsbery28-Jan-07 7:06 
GeneralRe: why mouse hook processed 2 times? Pin
bengz28-Jan-07 7:22
bengz28-Jan-07 7:22 
QuestionRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:27
Mark Salsbery28-Jan-07 7:27 
AnswerRe: why mouse hook processed 2 times? Pin
bengz28-Jan-07 7:43
bengz28-Jan-07 7:43 
GeneralRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:57
Mark Salsbery28-Jan-07 7:57 
The hook proc should get called at least once for the WM_LBUTTONDOWN and once for the
WM_LBUTTONUP. There's also WM_MOUSEMOVE, WM_MOUSEWHEEL, etc. messages, all of which go
through your hook proc.

That's why you need to flter out just the messages you are interested in. You may want/need
to filter by HWND or cursor position - that information is in the MOUSEHOOKSTRUCT structure.

What is the value of "leftclick" in your PostMessage call? If it is WM_LBUTTONDOWN then
your hwnd could receive two WM_LBUTTONDOWN messages if the click was in the same hwnd you
posted to.

*EDIT By the way, if "leftclick" is WM_LBUTTONDOWN then that's bad.  The WM_LBUTTONDOWN posted<br />
to windows has different wparam/lparam parameters than the hook proc wparam/lparam.


Mark
QuestionDisplay Message Pin
jon_fallon28-Jan-07 5:21
jon_fallon28-Jan-07 5:21 
AnswerRe: Display Message Pin
Eytukan28-Jan-07 5:30
Eytukan28-Jan-07 5:30 
GeneralRe: Display Message Pin
jon_fallon28-Jan-07 5:45
jon_fallon28-Jan-07 5:45 
QuestionRe: Display Message Pin
prasad_som28-Jan-07 5:32
prasad_som28-Jan-07 5:32 
AnswerRe: Display Message Pin
jon_fallon28-Jan-07 5:42
jon_fallon28-Jan-07 5:42 
GeneralRe: Display Message Pin
Mark Salsbery28-Jan-07 7:12
Mark Salsbery28-Jan-07 7:12 
AnswerRe: Display Message Pin
Anilkumar K V28-Jan-07 21:57
Anilkumar K V28-Jan-07 21:57 
QuestionWM_INIT or something like that....? [modified] Pin
Makakuin28-Jan-07 5:07
Makakuin28-Jan-07 5:07 
AnswerRe: WM_INIT or something like that....? Pin
prasad_som28-Jan-07 5:18
prasad_som28-Jan-07 5:18 
GeneralRe: WM_INIT or something like that....? Pin
Makakuin28-Jan-07 5:22
Makakuin28-Jan-07 5:22 
GeneralRe: WM_INIT or something like that....? Pin
Waldermort28-Jan-07 6:32
Waldermort28-Jan-07 6:32 
AnswerRe: WM_INIT or something like that....? Pin
prasad_som28-Jan-07 18:44
prasad_som28-Jan-07 18:44 
QuestionPorting Visual Studio 6 Application Pin
Blamor28-Jan-07 3:54
Blamor28-Jan-07 3:54 
AnswerRe: Porting Visual Studio 6 Application Pin
Cedric Moonen28-Jan-07 5:04
Cedric Moonen28-Jan-07 5:04 
QuestionButton to next form/popup Pin
Twalgering28-Jan-07 0:25
Twalgering28-Jan-07 0:25 
GeneralRe: Button to next form/popup Pin
Twalgering29-Jan-07 5:52
Twalgering29-Jan-07 5:52 
QuestionSend Sound to SoundCard Pin
A_Fa27-Jan-07 18:44
A_Fa27-Jan-07 18:44 

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.