Capturing tab events in ActiveX controls

Hi,
    I have an activex control written in MFC that uses the Document /
View architecture. I am having problems capturing the tab event
properly. The control is embedded in an HTML page and viewed using IE
6. Here's the detail of the issue:
    I have overriden the COleControl::PreTranslateMessage method and
have changed it to post tab messages to the currently active view.
Here's a snapshot of the code that I am using for this purpose:

	switch (pMsg->message)
	{
         case WM_KEYDOWN:
         case WM_KEYUP:
            switch (pMsg->wParam)
            {
	case VK_TAB:
	CView* pView = ((ApplicationFrame*)AfxGetMainWnd())->GetActiveView();
	CWnd *pWnd = pView->GetFocus();
	::PostMessage(pView->m_hWnd,WM_NEXTDLGCTL,0,0);
	return TRUE;
   	    }
	break;
	}


    The problem that I am facing is that PreTranslateMessage is
getting called twice for each press of the tab key and consequently it
results in posting two tab messages on the active view.
    I would appreciate if somebody could provide suggestions/ideas on
how I can resolve this.

Thanks
-A
0
arup (2)
12/4/2003 10:47:31 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
604 Views

Similar Articles

[PageSpeed] 42

Abstraction wrote:

> 	switch (pMsg->message)
> 	{
>          case WM_KEYDOWN:
>          case WM_KEYUP:
Here is your problem, either you PRESS a button or RELEASE the button, 
you will tab. So forget about the WM_KEYUP.
>             switch (pMsg->wParam)
>             {
> 	case VK_TAB:
> 	CView* pView = ((ApplicationFrame*)AfxGetMainWnd())->GetActiveView();
> 	CWnd *pWnd = pView->GetFocus();
> 	::PostMessage(pView->m_hWnd,WM_NEXTDLGCTL,0,0);
> 	return TRUE;
>    	    }
> 	break;

Regards,
Danny Springer

0
12/7/2003 10:43:19 PM
Reply:

Similar Artilces:

Controlling Excel Automatic Calculation???
Hi I=92m trying to make a simple routine in excel VB so, when a command button is pressed, the whole workbook is calculated (I have automatic calculation set to manual). I also want to display a warning message to the end user when input data is changed but the =93calculate=94 button has not been pressed. Can anyone point me in the right direction? Any help would be very much appreciated. It is never a good idea to set calculation to manual. nevertheless, this is a normal setting. Put the following code in the Command Button Click function With Application .Calculation = xlAu...

email capture
I'm having a problem with Outlook not pulling the mail off my pop server. When I do a send and receive the mail is identified, "grabs" the messages like it's doing a download but when it reaches the end I'm getting an unknown error message. Any thoughts? 1) First, try to set up Outlook Express to download the email set. Sometimes it has better luck. 2) Another way is to clear the queue manually. This is technical, and not really recommended by anyone, but you may have a stuck message... Telnet to get it... (this method permanently deletes messages before you c...

Problem getting screen coordinates of a control with a formview
I have a mainframe with several splitter windows. Within one of the spliter windows I have created a formview with some controls on it. The form view was created using the resource editor. My problem is that everytime I query within the formview class for the positional rect thru thecontrol.GetClientRect together with ScreenToClient, or ClientToScreen the coordinates to do match where the control is one the screen. I am running at a resolution of 120 dot per inch. Is this a bug? Or how can I get the correct screen position of the control. Thanks. "John Larocca" <larocjj@medi...

referencing cell lnking to another tab in Excel that skips 2 colum
Hi, I am trying to link every 3rd column in Tab C into Tab A. Is there an easy way to do this via a formula - I have tried Indirect and column however not having any luck. Basically in Tab A on Cell A2: <Column A> <Column B> =Tab C!AB$91 =Tab C!AE$91 etc. In above case, is there a formula that can help me automate the calculation in Column C? Thanks so much! One way, use this in the startcell: =OFFSET('Tab C'!AB$91,,COLUMNS($A:A)*2-2) Above returns the same as: ='Tab C'!AB$91 (note that I assumed the s...

Median of Even Set; How to Capture them?
Hi everyone, Say I have a dat set such as: 4 5 6 7 The median is (5+6)/2=5.5! However, I am not interested in the answer here, but the 5 and the 6!!! Is there an excel function or way to do so? Thanks alot, Mike Do you want the output in one single cell or in 2 separate cells? Mike Wrote: > Hi everyone, > > Say I have a dat set such as: > > 4 > 5 > 6 > 7 > > The median is (5+6)/2=5.5! > > However, I am not interested in the answer here, but the 5 and the > 6!!! > > Is there an excel function or way to do so? > > Thanks alot, ...

CPropertySheet receiving tab from other control on dialog box
Hi All, I currently have a MFC dialog application which has button and radio button controls. It also has a class that I implemented from CPropertySheet. I am not able to tab from the button or the radio button control to my CPropertySheet control. Is there a way to do this? I create the property sheet in the dialog box's OnInitDialog call. Is there a way to put this property sheet into the tab order? Thanks, Greg I think the key is to set the WS_CONTROL flag for the child dialog. See if this will help: http://www.codeguru.com/cpp/w-d/dislog/modelessdialogs/article.php/c1889/ AliR. ...

Saving Tab settings
I find the default tab setting (.5) too coarse for most of the documents I work with. Whenever I open a new Publisher doc I go to 'Format>Tabs and from the "Tabs window change the 'Default tab stops' from 0.5" to 0.2", click OK then go to work. When done I save and close. Next time I open the document the tab setting has returned to 0.5" and I have to start over for the doc to display correctly. Any way I can get the tab setting to stay saved? There is a workaround in this article. Custom tabs that you previously set in Publisher 2000 are not saved when...

Capture user selection of font
If I put a font combo box on a Ribbonbar is there a way for me to capture the user's font choice? I need to capture that choice and use it in a macro. Whate *exactly* are you trying to achieve with your macro? -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "dplaut"...

Any way to catch the event..
Hi. In MFC program, is there any way to catch the event when user terminates program forcibly from task manager? As you know, OnDestory is not called when user terminates program forcibly from task manager... I would like to do someting before the point that user terminates program forcibly from task manager.... Would it be possible to do that? It seems like to me that there is no any message invoking when terminated program forcibly from task manager... Any idea would be great. Thanks in advance. >In MFC program, is there any way to catch the event when >user terminates progra...

assigning Submit behavior (event) to a form under a masterpage scenario
I could not find any specific discussion on this, so please bear with me as I am less experienced programming for the web than I am for the desktop. I have a master page with a <body> tag such as this (as this is part of the default content from the horse's mouth); <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form> </body> This MasterPage serves...

Change Data Capture: Preserve capture instance data when adding co
When a new column is added to table that is configured for change data capture (cdc), the capture instance table will not have the new column until cdc is disabled and re-enabled for the source table. In the process the existing capture instance is dropped. I thought I could copy existing data out to a temp table and then copy back using the following SQL. However, other CDC meta information, such as the cdc.change_tables.start_lsn, becomes invalid. How can the capture instance history be preserved, using the same capture instance name, if at all? Thanks, Rich /*...

Capturing date/time modified on a form?
I have a form where staff can go and add student information, I would like to be able to capture when and if the form has been modified. We are running reports on students with certain behaviours right now but we don't know how up-to-date the data is if we don't capture if it's been changed recently. I added TimeModified and DateModified to my main table and put the fields on my form that I need it to capture but I'm not sure how to actually get it to fill those fields once data has been modified, any help would be appreciated. Monique Duane OK, what I've done now...

imap4svc / event id 1023
Good day! I have Exchange 2003 SP1 and Windows 2003 SP1 with latest patches and Symantec Mail Security 4.6. And one of users complains about errors using imap4 (over ssl actually) – he get error … bit after refresh (or after pressing some GetNewMailButton) everything is ok. And he have to do this TwiceClickThing on every new email. On server Application log I can see following error type event: Error 0x8004050a occurred while rendering message 0019-00000114f03f for download for user xxxxxxxxxx@xxxxxxxxxxx.xx. For more information, click http://www.microsoft.com/contentredirect.asp. A...

Tab Sequence of Grid
I am preparing to deploy a fairly significant customization where I have added several fields to the SOP grid. Everything works great except that I seem unable to reset the Tab Sequence. I have tried following the instructions in the help file; select Tab Sequence from the menu and the double click the first field, tab and double click each subsequent field. This seems to have no effect whatsoever on the tab sequence. I tried setting the sequence in my VBA code which does work except that if the user clicks within the grid (to make a change, say) and then tries to Save, they have to click...

tab key #6
When I hit the tab key it takes me to another program. How do I stop it? sounds like your alt key is stuck. If you push alt + tab if will toggle between open programs -- eluehmann ------------------------------------------------------------------------ eluehmann's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=13095 View this thread: http://www.excelforum.com/showthread.php?threadid=318849 that is a windows question. Post you question in the windows newsgroup or you version of windows. >-----Original Message----- >When I hit the tab key it takes me ...

Control contents disappear after postback
I have a VB2008 website with, among others, 3 dropdownlists. Two of these are autopostback and unbound, ddlFuel1a and ddlFormulation1. Whenever I click on any autopostback control, the entire content of both of these controls is deleted. Other than the Imports and Inherits lines, the following is the entirety of my VB code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then ddlFuel1a.Items.Add("Gasoline") ddlFuel1a.Items.Add("Diesel") ddlFormulation1.It...

Capture signature
I have a Ingenico 6550 signature capture device. When i sign on the device, it didn't capture the name. The display and the card capture worked, only the signature part doesn't work. I set the device name and everything, it loaded the form, and the tab for the signature on the pos poped up. I use the form designer to test the capture device it worked. The signature show on the form designer. I don't know what could go wrong. Could anyone help!!! By the way i am using RMS 1.3. "TJW" wrote: > I have a Ingenico 6550 signature capture device. When i sign on...

Change event for a calculated Form TextBox
I have a calculated textbox (tbTotal) on a form with it's Control Source as [tbHours]*[tbLabor]. I want to trigger a procedure when the textbox value changes, but can't seem to find a event that works. tbHours and tbLabor are also calculated. Ideas? There is no event that fires when a textbox value is changed programmatically. You may try using the After Update event of the controls involved in the calculation. -- Dave Hargis, Microsoft Access MVP "chasday" wrote: > I have a calculated textbox (tbTotal) on a form with it's Control Source as > [tbHours]*...

Captured Quantities not Captured
I have a client with multiple sites. At one site (RETURNS and it is a site, not the returns bucket in the other sites) when we create a stock count schedule and start it does NOT capture the quantities on hand unless we limit the range of item numbers during the Mass Add function. This issue is reproducable ONLY ON THIS SITE. Any ideas any one? -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users For help learning and better using Dynamics GP,... check out our books at http://www.AccoladePublications.com ...

Login Control form authentication to Active Directory (AD)
Hello, We have a form designed using Visual Web Developer (VWD) 2008 (Express Edition), which utilizes the Login control. The form works fine when launched via VWD 2008. That is, when typing in the credentials (username & password) at the Login.aspx form, the account is successfully authenticated against AD, and the user is directed to the Default.aspx page. However, when we launch the site via IIS 7.0 the authentication against AD does not work. If we type in the "correct" credentials, the Login.aspx page simply re-displays (with no error message). This...

Control Access to groups of contacts
I have a client who wants to have a master contact list so he can see the entire list. He has a handful of clients who will need to be able to view overlapping subsets of those contacts, but should not be able to view the entire list. Can access control be applied at this granularity? User Attributes or other Security groups are acceptible components of this access control. For instance, UserA needs to see contacts 1, 3 and 5 UserB needs to see contacts 1, 2, and 3 UserC needs to see contacts 2, 4, and 5 UserD needs to see contacts 1, 3, 4, and 5 ...

Mouse up event in a button
Hi, Can you help me with this onw, I need an active-x control button that fire event in mouse down click on the button and in the mouse up click, The default button control send only click event in the mouse down pressing on it but ther is no way to know when the user release the mouse click, There is a new active x control that do that?? Can i build a new button control like a class the that derived from CButton and implement the mouse up event? how can you send me an example code??? Thanks! ...

Control Code to copya Value from a text box to another
2 Unbound text boxes what code do I need in the control for [TextboxB] to copy [TextboxA] Thanks for any help...............Bob On Nov 25, 7:36 pm, "Bob V" <rjva...@ihug.co.nz> wrote: > 2 Unbound text boxes what code do I need in the control for [TextboxB] to > copy [TextboxA] > Thanks for any help...............Bob In the code for TextboxA (not TextboxB) capture the TextboxA Exit event, e.g., Private Sub TextboxA_Exit(Cancel As Integer) TextboxB.Value = TextboxA.Value End Sub ...

Reminders out of control
Crossposted to outlook.calendaring. Here is my problem: SYSTEM: -w2k, sp4 -outloook 2000, fully updated -several email accounts POSSIBLE CAUSE: -I copied the outlook.pst and then replaced the original with the copy, to make a defrag work better. I have done this trick many times with no problems. I check the bit count each time I do it. Everything seemed fine. Defrag went fine, no errors. SYMPTOMS: -about five zillion reminders pop up when I start outlook. -I now have reminders for everything, where it used to be just for scheduled appointments. Every new email gets a reminder. -I can&...

Importing MM:SS From Tab Delimited File and Charting
Greetings, I am importing a tab delimited file as "text" with data in the format of MM:SS. (I am changing the data type to text in the file import wizard). A sample of my data is as follows: 46:39 00:10 00:00 17:50 00:00 07:29 15:42 02:17 02:58 31:25 00:00 64:38 06:34 28:24 00:00 26:21 I'm trying to create a column chart with this data, however, rather than getting a seperate column for each line item I get no columns and a legend that contains all values listed above. I've tried changing the datatype to custom mm:ss but end up with the same charting results, nothin...