Keyboard Messages not intercepted when PreTranslateMessage is used

Hi

Mine is a MFC ActiveX Ctrl. I am using PreTranslateMessage as follows
so that keystrokes like backspace can be detected in IE, but though
SendMessage gets called, the Keystrokes like Arrow keys, delete
backspace don't function at all in
ActiveX container as well as IE. Am I missing something or do I need
to explicitly write WM_KEYDOWN (KEYUP) message handlers? Please let me know.

BOOL CMegafleetPluginCtrl::PreTranslateMessage(MSG* pMsg)
{
		
	switch (pMsg->message)
      {
         case WM_KEYDOWN:
         case WM_KEYUP:
            switch (pMsg->wParam)
            {
	       case VK_UP:
               case VK_DOWN:
               case VK_LEFT:
               case VK_RIGHT:
               case VK_HOME:
	       case VK_BACK:
	       case VK_DELETE:
		   SendMessage (pMsg->message, pMsg->wParam, pMsg->lParam);
                  // Windowless controls won't be able to call
SendMessage.
                  // Instead, just respond to the message here.
                return TRUE;
				  
            }
            break;
      }
      return COleControl::PreTranslateMessage(pMsg);
  }

Thanks,
Punit
0
1/20/2005 5:25:59 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
1009 Views

Similar Articles

[PageSpeed] 10

Got it working. The control now responds to keys like
backspace,delete,tab etc in ActiveX Container as well as IE.
Now i override PreTranslateMessage as follows: ( with reference to some
other posts on MFC related groups)

BOOL CMegafleetPluginCtrl::PreTranslateMessage(MSG* pMsg)
{
bool isHandledNow = false;

if (IsDialogMessage (pMsg))
return true;

else
return COleControl::PreTranslateMessage(pMsg);
}

it seems too be working fine...

Thanks,
Punit

0
2/1/2005 12:03:50 PM
Reply:

Similar Artilces:

errror message
error message: the selected assistant character is not available. microsoft outlook cannot install the neccessary files due to windows installer error 1605. this action is only valid for products that are currently installed. anyone please advise? ...

redirecting incoming email messages
Hello, I have been trying to get incoming email to automatically forward to a gmail address, with no luck. I can redirect it to another address in the company address list - that works fine. But it will not redirect it to an external (gmail) address.... any ideas??? thanks in advance Bill many companies block forwarding to outside email addresses. You'll need to ask the admin - he can configure it so you can forward. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: ht...

using data from anohter worksheet
Hello ive got confused. If i have two worksheets (w1 and w2) and on w1 i have a database o products on ws1 i.e. column A = product name column B = cost per product column C = weight then in worksheet 2 i want to basically make an order form that wil calculate the total cost of an order. I want to write the name of th product and the number ordred and have the rest of the table b autofilled with the total cost and total weight for that product. dont want to copy and paste from one sheet to the other. Also i don want to show unecessary data from ws1 on ws2 i.e. cost per product an weight...

Error Message when starting
Every time I start publisher I get an error message "out of memory or hard disk full" neither is accurate. Does anyone have suggestions for correcting this? David Every version of Publisher may give an out of memory error, each version may have a different reason for the error. It is helpful to know what version you are using. -- Mary Sauer MS MVP http://office.microsoft.com/ http://www.msauer.mvps.org/ news://msnews.microsoft.com "David W" <anonymous@discussions.microsoft.com> wrote in message news:322b01c4a801$995625d0$a601280a@phx.gbl... > Every time I...

English keyboard
Hi All, How can I switch the keyboard to English (or to any other) from Access ? Thanks in advance Imre ...

Required field message
I am creating a form in Excel and have cretin fields that must have information entered before moving to the next field. Is there a way to have a message pop up (Information is required) if the field is left blank. I�m new at using VB and any help would be greatly appreciated. Thank you, Steve Steve One suggestion is Try using the exit event for the control and have a procedure to test the entry. Hope this helps. Nick "Steve S via OfficeKB.com" <forum@nospam.OfficeKB.com> wrote in message news:262db95ebfb44e328ea7134c5fa29589@OfficeKB.com... >I am creating a form in Ex...

Warning message
Hi, I am getting this warning message everytime I try to change tabs on a tabcontrol. Warning: no message line prompt for ID 0x0192. I have an SDI application which has a tabcontrol and a set of tabs. The value 0x0192 refers to is the id for the tabcontrol 402. m_tabctrl.Create(WS_VISIBLE | WS_CHILD | TCS_BOTTOM , rect, this, 402); ON_NOTIFY(TCN_SELCHANGE, 402, OnTabSelChange) Why is this happening? "W Akthar" <anonymous@discussions.microsoft.com> wrote in message news:043001c52941$814457c0$a601280a@phx.gbl... > Hi, > > I am getting this warning mess...

Message Counters
What's the best Perfmon counters to use if we want to find the total number of messages being processed by the server? Also, is there a way to find just the total number of messages processed by the IMS? Thanks. ...

Message Read Receipt
We have Outlook 2002 SP2 with Exchange 5.5. Our problem is that the recepients read mail and the sender does not get a read receipt. The reason being that the recipient have the option not to send the receipt as they have activated "Ask me before sending a response" parameter within the "Tracking options" settings in the Outlook. Is there a way we can force read receipts through any global settings on Exchange server or through local Outlook options. Not that I am aware of. -- Nikki Peterson [MVP - Outlook] "K A Khan" <anonymous@discussions.micro...

Keyboard
Hi, I need to catch the keyboard key`s ctrl+alt+e in my MFC application how can I catch the combination of those three key`s??? How can I catch the F5 key??? For a normal key`s I use appwizard OnChar function or KeyDown. Thanks. hi, I guess you can try GetKeyState(VK_MENU) and GetKeyState(VK_CONTROL) when you response the OnChar or KeyDown message. "Dave" wrote: > Hi, > I need to catch the keyboard key`s ctrl+alt+e in my MFC application > how can I catch the combination of those three key`s??? > > How can I catch the F5 key??? > > &...

Publisher won't print business cards correctly on any paper I use
I have to say I hate Vista and Office 2007. I bought a new computer and this came standard on the computer. I am trying to print my business cards out and I have done previously in Publisher 2003. Never had a problem in 2003 printing anything. In Publisher 2007 the business cards come out printing outside of the perforated areas, to high, off center, etc. I have tried manually going in and adjusting the paper settings and nothing has been successful. I have wasted tons of paper, ink and now I am frustrated. It should be as easy as click print and get your business cards, after a...

No Attribute Message
I am also receiving this error message, although the circumstance is slightly different. I have written a plugin which will automatically select the default unit for a new product. When I enter a new product, the plugin runs all the way through, and then I get this error: 'No Attribute'. Can anyone tell me why I'm getting this error, or how I can run a trace to see a more detailed error message? ...

send/recieve error message
I'm running outlook XP and whenever I send or recieve I get the following Error reported in the progress window ============= !task itPMC email - Snding and Recieving' reported error (0x800CCC0F) : 'The connection to the server was interrupted. If this problem continues, contact your server administrator or Internet Service Provider (ISP). The server responded: +OK 2675 octets' ============= Anyone any ideas? For those of you that have been getting "Sending and Receiving reported error .... connection to server was interrupted" as I have, try creating a new HTTP ...

hook keyboard and send as other keyvalue
hi, i have a problem to deal with global keyboard hooking . my application has to deal with a special keyboard, whitch asking that when press Shilft + A, it actually come out "#", Shift + B , it comes out "&".. and when shift is not pressed, the A is still A. i can not come out with the functionality no matter what.. i have to use global keyboard hooking since it is for the whole application LRESULT CALLBACK keyProc(int nCode,WPARAM wParam,LPARAM lParam) { PKBDLLHOOKSTRUCT hook = (PKBDLLHOOKSTRUCT)lParam; ??????? return CallNextHookEx(gHook, nCode, wPa...

Using object model to coult the number of used rows
Hi Does any one know how to count the number of used columns and rows in a sheet via the object model I know int m_columncount = m_CurrentWorkSheet.Columns.Count; gives the total columns, but what I need is a count of the used colums. Or do I need to write a manual count i.e. manually count how many are used by by checking each element? thanks Andy Hi Andy, The following will get the number of rows in your used range as you would observer using Ctrl+End dim rowCnt as long rowCnt = activesheet.Cells.SpecialCells(xlLastCell).row Take a look at http://www.mvps.or...

KEYBOARD NOT WORKING
I know some people may help better if I give more specific details to my problem.. So here goes: My keyboard works correctly with any other application, such as MSN, ICQ, Wordpad.. etc. However, when I open an Office application such as Word or Excel, it doesn't seem to type for me. I cannot type in the help section, can I type in the document or in those toolbars at the top for Fonts, etc. But if I specifically go to "Format >> Font", then yes, I can type in it. I have tried reinstalling Office already, that doesn't work. The hardware is fine, I can still...

Message size decrease?!
I receive a mail with 3 pdf attachments (The size is 15MB) When I move that mail to other folders from inbox, I find that the mail size will become 11MB Why the size change? THX P.S: I use Exch2k+SP3 and Outlook 2000 client And all 3 atachements are there and accessible after you move? David wrote: > I receive a mail with 3 pdf attachments (The size is 15MB) > When I move that mail to other folders from inbox, I find that the mail size > will become 11MB > > Why the size change? > > THX > > P.S: I use Exch2k+SP3 and Outlook 2000 client Yes I can read thes...

Microsoft Outlook Error Message
The Add-in "AVG Exchange Extension" (C:\Program~1\AVG\AVH9|avgxch32.dll) cannot be loaded and has been disabled by Outlook. Please contact the Add-in manufacturer for an update. If no update is available, please uninstall the Add-in. I have uninstalled AVG hence the error message, now every time I try to open Outlook 2007 I get the above message. I have no idea where to uninstall the Add-in can anyone help please. You don't mention what operating system you are using, but you just have to delete/rename the file named extend.dat when Outlook isn't running. ...

Outlook and XP Keyboard Access
I just had Windows XP installed on my machine and I am having problems with keyboard access in Outlook 2002. I do not use a mouse and I have my inbox set up with the preview pane. Prior to XP I could get to my inbox with CTRL+Shift+i and then tab around the panes (mail list, preview pane and folders). With XP I can not get a selection in any pane without turning off the preview pane and then turning it on again. Which I then have to repeat every time I use the shortcut to get back to the inbox. This is making me very frustrated. Does anyone have a solution? Thanks in advance! It m...

For control variable already in use
Excel 2007, Win 7 64-bit I have the following code. Note that this is a self-standing macro. This macro is not called by any other macro. It is executed by a Forms button. There are 3 FOR loops, none nested Sub SortByName() With Sheets("SortSht") Copy & Paste Set rColA =................... For cc = rColA.Count To 2 Step -2 Stuff Next cc For cc = rColA.Count To 1 Step -1 Stuff Next cc For cc = rColA.Count To 1 Step -1 ...

Which process posts this window message ?
Hi, our company have product with MFC GUI application. We want to filter processing of windows messages which are posted to our GUI's windows from another processes. Does it possible to determine which process posted window message in our message queues ? Or some another solution, how to defend against unwanted window messages from another processes ? (For example setting suitable rights in our process or our threads ?) Peter There are no APIs I am aware of that allow you to determine the sender of a message. There is no known mechanism to secure a message agains...

Secure Messaging (signed and encrypted) with external/interdivisional Recipients using Outlook 2003/Exchange 2003
I currently have to evaluate a solution for a signed and encrypted Exchange 2003 (SP2)Outlook 2003 (SP2) messaging environment, externally to the internet and "network internally" with other divisions (which are not trusted into our Win2003 Forest/Exchange 2003 Org.). MS PKI is in place and is used within our Forest/Exchange Org for secure messaging. My questions here are: Are there any possibilities for external, secure messaging (digitally signed and encrypted) using the existing MS PKI Infrastructure? Would a MS PKI cross certification infrastructure work with external internet ...

can not send messages
I tryed sending out a message and this error message popped up The host 'BenLomand' could not be found. Please verify that you have entered the server name correctly. Subject 'driver license', Account: 'pop3', Server: 'BenLomand', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 11001, Error Number: 0x800CCC0D "BenLomand" is not a valid mail server name. You get the correct mail server names from your mail provider. Do you have an existing email address? If so, what is the part of your email address after the @ symbol? That par...

error using word as the email editor (office 200,W2K)
I keep receiving the following error - "Microsoft word is set to be your e-mail editor. However, word is unavailable, not installed, or is not the same version as Outlook. The outlook email editor will be used instead. An OLE registration error occurred. The progrma is not correctly installed. Run setup again for the program." I have tried detect and repair; reinstalling - the error persists. Any suggestions? ...

Facility for using COST CENTER codes while entering transactions
Hi, To minimise the number of account codes and to analyse my expenses for individual departments , I would like to allot CC for all the Depts. / Activities and use them while entering transactions in the system. Is it possible to do in MS GP ? Is anybody using such a feature now ? Raj Yep, either MDA or Analytical Accounting will do this for you. Mike "INTERNAL AUDITOR" <INTERNALAUDITOR@discussions.microsoft.com> wrote in message news:05471113-51D1-450F-9A30-93B82434CBBC@microsoft.com... > Hi, > > To minimise the number of account codes and to analyse my expe...