Right click mouse window activation disabling

I have a dialog based application which has two dialogs where secod
dialo is a modeless dialog.
When I Right click the mouse button on any one of the dialog that
comes to  foreground.
I need to block this behaviour on Right click (i.e only on Left click
dialog should get activated).
How can i achieve this?

I tried overriding Rbutton down/up and commenting the base class call
but no effect.
also i tried pretranslating and blocking Rbutoon messages but without
any success.
0
kishor.s22 (10)
4/18/2008 8:46:36 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
371 Views

Similar Articles

[PageSpeed] 47

That is not message of windows's job.

To make what you want, using Mouse Hooking (WH_MOUSE)

-- 
WebSite :
  Realization of Dream { imagine your dream} -  http://rodream.net

WebMail :
  rodream@naver.com


"Kishore" wrote:

> I have a dialog based application which has two dialogs where secod
> dialo is a modeless dialog.
> When I Right click the mouse button on any one of the dialog that
> comes to  foreground.
> I need to block this behaviour on Right click (i.e only on Left click
> dialog should get activated).
> How can i achieve this?
> 
> I tried overriding Rbutton down/up and commenting the base class call
> but no effect.
> also i tried pretranslating and blocking Rbutoon messages but without
> any success.
> 
0
rodream (49)
4/18/2008 12:23:03 PM
Try this:

int CMyDialog::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT
message)
{
	if(message == WM_RBUTTONDOWN)
		return MA_NOACTIVATEANDEAT; // Does not activate the window, but
discards the mouse message.

	return CFrameWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
}

-SM
0
smisro (101)
4/18/2008 8:32:01 PM
I'm not quite sure what you are asking.  But if your problem is that when you click in any
dialog the entire app and dialogs come to the front, THAT IS WINDOWS WORKING AS IT IS
SUPPOSED TO WORK.  Defeating this is not possible.  If all you are concerned about is
intercepting the right-click, however, you have neglected to say anything useful in your
description.  You talk about RButtonDown, but you do not say what class you implement this
in, or the relationship of that class to any other window class in your app.  Likewise for
PreTranslateMessage.  Without useful information, no analysis is possible.
					joe

On Fri, 18 Apr 2008 01:46:36 -0700 (PDT), Kishore <kishor.s22@gmail.com> wrote:

>I have a dialog based application which has two dialogs where secod
>dialo is a modeless dialog.
>When I Right click the mouse button on any one of the dialog that
>comes to  foreground.
>I need to block this behaviour on Right click (i.e only on Left click
>dialog should get activated).
>How can i achieve this?
>
>I tried overriding Rbutton down/up and commenting the base class call
>but no effect.
>also i tried pretranslating and blocking Rbutoon messages but without
>any success.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
4/20/2008 5:57:21 PM
Reply:

Similar Artilces:

Why are the two codes below not getting the right formula for my worksheet event change formula?
Why are the two codes below not getting the right formula for my worksheet event change formula? The remaining ones do work, but these two are not getting the right results. Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]" Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]" I'm trying to get both column G & H to show a combined value of data in other columns. Column G should show result by combining data from column E & B, while column H should show result by combining data from column F & C. Column G is showing: =RC[-2]&RC[-5] ...

Listbox selected line mostly just below bottom of window
I think I'm just missing a call of some sort. I have a listbox. Then I sort the lines, select the line I want and redisplay the listbox using: sendmessage( g_TagBrowse_HDlg, LB_SETCURSEL, C_LINE-1, 0); RedrawWindow( window, 0, 0, rdw_Invalidate ); But sometimes my selected line is mostly just below the bottom of the window. (see image http://members.cox.net/deleyd2/misc/listbox.gif ) I'm relatively new to this so I assume the problem is I just need to make another call of some sort to get the line fully in view? There's something very, very, very wrong with this code. ...

Third party product that's like Activity Tracking
Hello! Does anyone know of a third party product that works like Activity Tracking? We want to record activities in GP (posting, modifications to transactions, etc). Thanks!!! Rockton's Auditor comes to mind: http://rocktonsoftware.com/products.aspx?p=1 Though I haven't tried this one, I've had good experience with their other products. "Marisol" wrote: > Hello! > > Does anyone know of a third party product that works like Activity Tracking? > We want to record activities in GP (posting, modifications to transactions, > etc). Thanks!!! Mari...

shortcut mouse right side key
the shortcut key on the right side no longer works in Excel. This is after installing a software inventory control in developed in Excel and removed for free on the Internet. Could anyone help me to run down the right side to link the mouse when using Excel? -- cslgh No menu when you right-click on a cell? Perhaps code from the inventory control program you installed disabled it. Alt + F11 to open VBE. View>Immediate Window. Copy this into that window and hit ENTER key. Application.CommandBars("Cell").Enabled = True Alt + q to return to Excel.............

Giving rights to a user's mailbox
I have a number of users that I have created in my Windows2003 domain that are giving me greif. I have been unable to assign permissions to their mailboxes to give other users the full mailbox right. When I go through the motions of giving the correct rights and then I try to open the mailbox in Outlook by telling it to open an aditional mailbox under the advanced tab I get an error of: Unable to expand the folder. The operation failed. An object could not be found. Any ideas? Thanks Mike Aditional: This is Exchange 2003 and Outlook 2003. I have also tried creating a new profile with t...

Change Windows 7 Startup Sound?
Has anyone found a foolproof way to change the Windows 7 startup sound (imageres.dll)? I've tried a few methods and none of them let me complete the processs, even in Safe Mode. "Tom Pamin" <scnrfrq@roadrunner.com> wrote in message news:uv5$394bKHA.5608@TK2MSFTNGP05.phx.gbl... > Has anyone found a foolproof way to change the Windows 7 startup sound > (imageres.dll)? I've tried a few methods and none of them let me complete > the processs, even in Safe Mode. Why would they? This is an XP group not Windows 7. Windows 7 Forums: http://socia...

How do I get the names of the sender in my sent box without click.
In Outlook Today, I added the column "to" in my sent boxes. The names of the senders however are not placed there, unless I click the message. Is it possible to fill in the names of the senders automatically?. ...

windows defrag on the root drive
can the windows defrag mess up exchange 2003? I ran defrag this morning on the drive and now things seem weird... RandyH wrote: > can the windows defrag mess up exchange 2003? Probably not, but I would not do that with first stopping all Exchange services. > I ran defrag this morning on > the drive and now things seem weird... In what way? ...

Very Easy...Right?
How do I change an existing code from... mynum = Application.InputBox("Select Submission_ID") ....to mynum is located in cell A4 on sheet 1 (ie use the number already located in A4) with no InputBox I've tried.... mynum = Worksheets("Sheet1").Cells(R4,C1) mynum = Worksheets("Sheet1").Cells(4,1).Value mynum = Range("A4") I've even tried... Range("A4").Select mynum = ActiveCell I just don't know how to tell it to input the number already contained in A4 as the input for the already existing code. i'd use ...

How do I: enter a checkmark symbol in a cell by clicking on it
This is what I am trying to do.... 1. When someone clicks on cell, the checkmark symbol is entered into the cell 2. When someone clicks on the same cell again, they cell becomes blank (ie toggle between checkmark and blank) 3. Then how do I count the number of checkmarks in a column. Thanks, -- prsII ------------------------------------------------------------------------ prsII's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32166 View this thread: http://www.excelforum.com/showthread.php?threadid=519157 How about a double-click?: Enter the following in ...

using windows mail
when I try to send through window mail, I get error msg. error10060 OX800cccoe Please post the error message in its entirety. You can left click on it to highlight and then right click to copy and then paste it into this thread. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Jeanne" <Jeanne@discussions.microsoft.com> wrote in message news:F393030B-D730-4AE9-8BD4-856087C52EA6@microsoft.com... > when I try to send through window mail, I get error msg. error10060 > OX800cccoe > Jeanne, try Meghan's reply up abo...

Administrative rights
I'm fairly new to Exchange 2003. I have it running on Server 2000. (I inherited this setup.) I'm trying to enable another user to create IDs and have the AD automatically create the Exchange mailbox at the same time. Whenever they create a user, they are NOT prompted to create the Echange info. That form never appears. I thought the solution was to delegate control to them at the Administrative group level. I set up a group and given it View and Full control. I have set up the user specifically with View and Full Control. Nothing seems to allow him to create mailboxes. ...

how to edit the access right of C:\Windows\assembly\GAC_32\
I test website, ant get Compiler error: CS0016 Access is denied Compiler need read files from C:\Windows\assembly\GAC_32\ I could not see the folders under C:\Windows\assembly\GAC_32\ in explorer. and I can access these file from Command window so these files are there I try to set the security let NETWORK SERVICE and IIS_IUSER have read right but perperty window of assembly folder does not have security tab. help and suggestion needed. Thanks "MXC" <mxchen100@hotmail.com> wrote: >I test website, ant get Compiler error: CS0016 Access is denied > &g...

RIGHT-Return 10th characters to right
I have an Excel spreadsheet with 25 or more digits in column A. I want to put the 10th digits to the last digit in column B. Is there a way to do this? Thanks in advance. =RIGHT(A1,10) Regards, Felipe >-----Original Message----- >I have an Excel spreadsheet with 25 or more digits in >column A. I want to put the 10th digits to the last digit >in column B. > >Is there a way to do this? > >Thanks in advance. >. > Jh, =RIGHT(H8,LEN(H8)-9) Dan E "jh" <anonymous@discussions.microsoft.com> wrote in message news:00cf01c398c6$e9f044d0$a5012...

Public folder right is missing!
Hi ou there, Permissions on Public folder tree is missing, users with right to modify or edit folder content are dinied access to the folder tree where they have permission. I used pfdavadmin to see and edit the permission but still the right are not retained. Help! ...

Microsoft Tries to Avoid Windows Blue Screen Repeat
< I am definitely fearful of Windows Updates. I do a manual creating a Restore before doing an update. My other laptop is still down from the damage of KB977165.> -- Microsoft Tries to Avoid Windows Blue Screen Repeat Gregg Keizer Apr 14, 2010 5:09 am http://www.pcworld.com/article/194205/microsoft_tries_to_avoid_windows_blue_screen_repeat.html Microsoft took steps Tuesday to avoid repeating the debacle two months ago that left Windows XP users staring at the notorious "Blue Screen of Death" error message after they applied a patch. In February, a secu...

Execution time of several minutes
Hello group! A couple of weeks ago, Bob Phillips helped me with a function that rearranges and sorts my list of run times (for different courses when I've been out running). Now, I'm just wondering, is such a function supposed to take 3-4 minutes to execute (on a slow, 800MHz/384RAM (not the newer, faster type))? For each course that I've run (currently about 15 in the "course list"), the function runs through my list of runs (which consists of results from about 90 runs) so that the script can make a new listing of all runs, but this time grouped by course. Thereafter,...

Where is Address book data (Oultook 98 /Windows 98) (Outlook XP /Windows XP)?
This is a multi-part message in MIME format. ------=_NextPart_000_0080_01C3DB10.0FD801C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Where is Address book data (Oultook 98 /Windows 98) (Outlook XP /Windows = XP)? ------=_NextPart_000_0080_01C3DB10.0FD801C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dis...

OL2007, Word as editor, right mouse button not showing autocorrection
Normally when using Word and the cursor is over a misspelt word, the right mouse button shows alternative words and various other options. However, when creating a new email in OL, the Word editor uses the right button for Work | Signatures. Can I get it back to the normal Word modality? TIA, Bill "Bill Davy" <Bill@SynectixLtd.com> wrote in message news:OV4P7gdEKHA.1248@TK2MSFTNGP04.phx.gbl... > Normally when using Word and the cursor is over a misspelt word, the right > mouse button shows alternative words and various other options. > > However, whe...

In right scroll bar can you change the page # in view box to sect.
The scroll bar on the right show in the view box the page number and then text from the document, can you change what the view box shows from page number to sections? Sueann wrote: > The scroll bar on the right show in the view box the page number and > then text from the document, can you change what the view box shows > from page number to sections? No, there is no option to control that display. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benef...

Rights required to access Exchange 'Mailbox Rights' in ADUC #2
*I believe I'm posting as a a manged newsgroup user with alias, but so far I'm not getting a response. This is my third try to see if I can get it to work.* Is it possible to provide IT staff access to manipulate Mailbox Rights under the Exchange Advanced tab in ADUC without giving them Exchange Administrator rights? We'd like our staff to be able to manipulate all aspects of users using ADUC, but not the back-end Exchange stuff in System Manager. However it appears to be an all-or-nothing situation, at least where access to the mailbox rights are concerned. The message...

Excel 2007 Chart mouse hover sensitivity
Opening Excel 97 worksheet in Excel 2007 in compatibiity mode, I can hover over an existing X-Y chart series and read the proper series name, time, and value of that point. But if I use my macros to delete all the data series, read in new data, and then re-add the series (most settings on Auto), then when I hover over a series and point, it more times than not gives the name of a different series and a different time, and value! It can pick a series point that is over 1 inch away on the screen. If I click on that point, it will display the same wrong series in the formulas...

CListCtrl Highlight item when mouse moves over item
Dear All, Problem : I am using CListCtrl (View : icon ) for displaying image files in thumbnail view. it's working fine.. But I want to highlight the border of the image when my mouse moves over that image.. or atleast how would i know the index of that image when i moves mouse over any item (here thumbnail images) ?? I am using VC++ 6.0. Please help me ASAP. Thanks in advance.. Thanks & Regards, Kireet Gajera Do you want to do this when the user selects an item or just when the mouse flies over it. If the first is try it should already be happening. If the second is tru...

Mouse Scroll Wheel Crashes Dynamics
Hi all, We're on GP9, and in a terminal server (Win2003) environment. We have a small issue when using the mouse scroll wheel in dynamics; the scrolling will start scrolling by itself, scroll all the way to the end, and then freeze. Then you have to End Task out of GP. It's tempermental - if you scroll really slow with the wheel, it's ok. But if you scroll just a little to fast, it takes off scrolling and crashes. This behaviour has been with us since GP8, and of course it only occurs within Dynamics. I looked in the KB and couldn't find anything. Anyone else witness ...

disassembly window in VS 6
Hello When I am debugging and the debugger stops at a breakpoint, it shows the disassembly window. So I have to disable it so i can see the C++ code. I have to do that every time. How can I set up VS so that it shows C++ code when the debugger stops at a breakpoint? Thanks for you advice! Vaclav --- Odchoz� zpr�va neobsahuje viry. Zkontrolov�no antivirov�m syst�mem AVG (http://www.grisoft.cz). Verze: 6.0.552 / Virov� b�ze: 344 - datum vyd�n�: 15.12.2003 hi, If the debugger is unable to find the necessary symbols then it will display the code in assembly. Try putting the .pdb file(...