Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPrinting C/C++ source code in color Pin
SAK23-May-02 12:38
SAK23-May-02 12:38 
GeneralRe: Printing C/C++ source code in color Pin
Martin Ziacek23-May-02 19:34
Martin Ziacek23-May-02 19:34 
GeneralFile->Open Pin
Stew23-May-02 12:03
Stew23-May-02 12:03 
GeneralRe: File->Open Pin
Stew23-May-02 12:29
Stew23-May-02 12:29 
GeneralPrinting Question Pin
Stew23-May-02 10:31
Stew23-May-02 10:31 
GeneralRe: Printing Question Pin
Stew23-May-02 11:18
Stew23-May-02 11:18 
GeneralRe: Printing Question Pin
Jonathan Craig23-May-02 11:18
Jonathan Craig23-May-02 11:18 
GeneralSetWindowsHookEx Problem...... Pin
DeepBlue23-May-02 10:06
DeepBlue23-May-02 10:06 
Hi !
I wrote system hook for right mouse click i.e. using WH_MOUSE in SetWindowHookEx()

Now for the hook procedure in the .dll file I added the code..

//=====================================================
EXPORT LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam)
{
switch(wParam)
{
case WM_RBUTTONUP:
{
DisplayDialog();
return CallNextHookEx(hK,nCode,wParam,lParam);
}
default:
return CallNextHookEx(hK,nCode,wParam,lParam);
}
}
//======================================================

// The above code should display a Modless Dialog Box on screen .. when it intercepts a Right mouse click.
The problem I am facing here is that though the dialog box does pop up...instead of one ... they are multiple in number and keep on increasing !!!

I traced the whole execution and found that the hook procedure was receiving multiple WM_RBUTTONUP messages when I just right clicked once.
Why is this happening ?

Another thing.. What do I do if I wanted to check if the
Shift key was pressed when right click was made.
Do I have to install a Keyboard hook for this, or can I get the info from wParam itself.


Please Help
DB

Note:
1. DisplayDialog() function displays a dialog box on screen.
2. Variable hk stores the hook handle from SetWindowsHookEx function.



QuestionCan RDS.Dataspace be used from Visual C++ Pin
Jesper Mandal Hansen23-May-02 9:45
Jesper Mandal Hansen23-May-02 9:45 
GeneralWebBrowser control Pin
Sanjeev Kumar23-May-02 9:15
Sanjeev Kumar23-May-02 9:15 
GeneralRe: WebBrowser control Pin
Ravi Bhavnani23-May-02 12:17
professionalRavi Bhavnani23-May-02 12:17 
QuestionWhats wrong with this code? Pin
Mazdak23-May-02 8:52
Mazdak23-May-02 8:52 
AnswerRe: Whats wrong with this code? Pin
Joaquín M López Muñoz23-May-02 8:59
Joaquín M López Muñoz23-May-02 8:59 
GeneralRe: Whats wrong with this code? Pin
Mazdak23-May-02 9:21
Mazdak23-May-02 9:21 
GeneralRe: Whats wrong with this code? Pin
Joaquín M López Muñoz23-May-02 9:31
Joaquín M López Muñoz23-May-02 9:31 
GeneralRe: Whats wrong with this code? Pin
Mazdak23-May-02 9:41
Mazdak23-May-02 9:41 
AnswerRe: Whats wrong with this code? Pin
Philip Patrick23-May-02 8:59
professionalPhilip Patrick23-May-02 8:59 
GeneralRe: Whats wrong with this code? Pin
Mazdak23-May-02 9:27
Mazdak23-May-02 9:27 
AnswerRe: Whats wrong with this code? Pin
Neville Franks23-May-02 12:42
Neville Franks23-May-02 12:42 
GeneralDisplaying version Pin
User 988523-May-02 8:02
User 988523-May-02 8:02 
GeneralRe: Displaying version Pin
Prem Kumar23-May-02 8:16
Prem Kumar23-May-02 8:16 
GeneralLinker error when using DirectDrawCreateEx(...) Pin
Alan Chambers23-May-02 7:51
Alan Chambers23-May-02 7:51 
GeneralRe: Linker error when using DirectDrawCreateEx(...) Resolved Pin
Alan Chambers23-May-02 8:52
Alan Chambers23-May-02 8:52 
GeneralOutlook (Express) Automation Pin
peterchen23-May-02 6:54
peterchen23-May-02 6:54 
GeneralRe: Outlook (Express) Automation Pin
Shog923-May-02 7:36
sitebuilderShog923-May-02 7:36 

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.