How to trap PreTranslateMessage in Win32 (non-MFC) app?
How do you trap PreTranslateMessage in a Win32 (non-MFC) app? I have an
existing MFC class called CCustomEditCtrl that I have to convert to pure
Win32. I am doing some processing in it's PreTranslateMessage event. Can
someone tell me where to put this code in the Win32 version? Do I hvae to
trap some WM_ event ? Thanks.
You would just handle the messages in the control window function. If you
want to do something before all other messages, take care of it towards the
top of the window function. In pseudo-code:
// You can, for example, add your proces...Owner draw CListCtrl, EnsureVisible, PreTranslateMessage
There is Owner draw CListCtrl with overriden DrawItem. This class has
subitems arbitrary controls (CEdit, CButton...). It should be fine to detect
arrows keys in controls to jump with caret in CEdit boxes in one column by
pressed arrow key. I tried to catch it in CEdit -> PreTranslateMessage() in
block if(pMsg->wParam == VK_UP)
then to call EnsureVisible() to parent CListCtrl to be caret always visible
and CListCtrl scrolls if needed. Problem is when first time it scrolls up,
some infinite loop begins and CPU 100% . It seems that something wrong with
this... Can be EnsureVisible(...pretranslatemessage behaviour
I have a problem when I press CTRL+ALT+D keys the PreTranslateMessage
function is not fired for WM_KEYDOWN, only for WM_KEYUP.
Hey Luis, check out this article and see it if helps (talks about disabling
that key combination by setting up a hotkey so you get the message instead
of the OS)
"Luis Porras" <email@example.com> wrote in message
> I have a problem when I press CTRL+ALT+D keys the PreTranslateM...Ctrl + Home
I am used to the "ctrl + home" key combination taking me
to the cell A1 of sheet A. In Excel, it only takes you to
the cell A1 of the sheet you are in at the time.
Is there another key combination that takes the place of
Ctrl + Home in QPW and takes you to Cell A1 in the Sheet A
or do I need to program that into a macro and stick it on
a toolbar somewhere?
There is no built-in shortcut to take you to the first worksheet's cell A1.
You could, of course, press Ctrl-PgUp a number of times to get to the first
worksheet, and then press Ctrl-Home.
The code for ...PreTranslateMessage
Hi I'm trying to catch a CTRL+V event in my PreTranslateMessage function. Now when V is pressed pMsg->wParam == 86 but what is it when CTRL+V is pressed. Or is there some other way of catching the CTRL+V key press
If there's another way, we'll hear about it. Here's what I do:
When you get a WM_KEYDOWN and a VK_SHIFT, set m_shiftdown=1.
When you get a 'V', check if m_shifdown==1
When you get a WM_KEYUP and a VK_SHIFT, set m_shiftdown=0.
> Hi I'm trying to catch a CTRL+V event in my PreTranslateMessage function.
> Now when V is pressed p...Strange PreTranslateMessage Behavior
I have a vc++ 6.0 dialog-based application where I'm using
PreTranslateMessage to send keyboard characters out the serial port
with the following code:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
if (pMsg->message == WM_CHAR )
WPARAM wp = pMsg->wParam;
char by = (char) wp;
p_cs = &by;
pSPort->WriteData( p_cs, 1 );
I also have a couple of buttons that perform some functions and are
enabled and/or disabled after the functions are complete. Stripped of
all irrelevant code these functions are:
v...no more PreTranslateMessage
All my Dialogs are derived from AbstractDialog.
This AbstractDialog overrides PreTanslateMessage
so I can catch keystrokes in all my Dialogs.
BOOL AbstractDialog::PreTranslateMessage(MSG* pMsg)
Now in a particular Dialog I override the virtual
OnKey() function and execute whatever should happen
in that Dialog on a particular keystroke.
Works like charm! Now I have also a CButton handler
which creates a w...My Ctrl+D doesn't work, how can I reset?
In excel my fill down shortcut does not work. Ctrl+D. Where are these
shortcut viewed and possibly reset?
There are only two ways I can think of that can prevent Ctrl-d from acting
to do a fill down. One is if an external program intercepts that keystroke
before it gets to Excel. The other is if, within Excel, that keystroke has
been assigned to a macro. One way to check the latter possibility quickly
is to start Excel in safe mode. From Start->Run enter "excel.exe /s"
(without quotes, there is s pace before the slash). If Ctrl-d works then
you know it is a macro lo...Ctrl+PgUp and Ctrl+PgDn
I have a workbook in Excel 97 with two windows. One is
PipeBook.xls:1 and the other is PipeBook.xls:2. I would
like to disable the function of Ctrl+PgUp and Ctrl+PgDn in
the window PipeBook.xls:2, however leave the function
available for window PipeBook.xls:1. Is that possible?
take a look at SCROLLAREA in vba help.Put your code in the ThisWorkbook
module in the Open_Workbook macro.
Granite Shoals, TX
"Keith Hueston" <firstname.lastname@example.org> wrote in message
> I have a work...PreTranslateMessage and Ctrl + A
how can I check in PreTranslateMessage, if the user has pressed Ctrl and A?
pMsg->wParam; //?? Ctrl+A ?
pMsg->lParam; //?? Ctrl+A ?
Thanks for help,
On Wed, 25 Jul 2007 18:42:17 +0200, "Guido Franzke" <email@example.com>
>how can I check in PreTranslateMessage, if the user has pressed Ctrl and A?
> pMsg->wParam; //?? Ctrl+A ?
> pMsg->lParam; //?? Ctrl+A ?
>Thanks ...SendKeys command for Ctrl-Shift-v?
I'm trying to send the Ctrl-Shift-v combination to MS Word, with
no luck. So far SendKeys "^+(v)" isn't doing it. Is this
Using Office 2003 sp3 on Windows XP Home
Behold, I will allure her, I will lead her into the wilderness
and speak tenderly to her - Ho. 2.14.
Does Selection.PasteAndFormat do what you need or use SendKeys "^+v" without
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consult...PreTranslateMessage question
I have an MFC application which is based on a modal CDialog. It
contains a Picture control which is resized if the parent dialog size
changes - this keeps the picture control occupying the full width of
the CDialog's client area.
The Picture Control is used to display video, but when the dialog box
size is stretched it causes a lot of flickering because the Picture
Control repeatedly redraws its background while also displaying the
According to the documentation, I just have to trap WM_ERASEBKGND
messages for the Picture Control to prevent it drawing its background.
So I created ...Ctrl+Quote copy
This is not a report question, but maybe you can help.
I always use the short cut Ctrl+Brk to copy from the previous line. When
I change the keyboard mode to Hebrew by pressing Alt+Shift, and then
pressing Ctrl+" the form opens in design mode. Acc97 was no problem.
Is there another alternative to copy from previous line?
Thanks in advance
You are all good people
...Macro's with Ctrl or Ctrl-Shift?
When you record a new macro it asks you what Ctrl key you want to access it
with. If you Edit the Properties of a Macro it asks you what Ctrl-Shift key
you want to use to access a macro. How can you have more control over this
to assign the proper key to a macro? Thanks.
I don't know what you mean by "edit the properties of a macro." You can
assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros
either when about to record a macro, or later with Tools - Macro - Macros -
Options. If by "have more control," you mean keys other than C...preTranslateMessage error
I'm learning how to use pretranslateMessage in c++ for an mfc app. but it
keeps giving me two errors and I can't find a good tutorial on it. it says:
PhysicsMath error LNK2005: "public: virtual int __thiscall
CPhysicsMathDlg::PreTranslateMessage(struct tagMSG *)"
(?PreTranslateMessage@CPhysicsMathDlg@@UAEHPAUtagMSG@@@Z) already defined in
PhysicsMath fatal error LNK1169: one or more multiply defined symbols found
anyone know what it means?
"Deej" <firstname.lastname@example.org> wrote in message
news:7sednROg4_wLPmmiRVnemail@example.com.....PreTranslateMessage and controls
I have a member function in my project that is in place to prevent the
dialog box from closing when ENTER or ESCAPE is pressed inside an edit
box. However, in the process, the push buttons are (expectedly) no
longer triggered when they have input focus and the user pressed
ENTER. I want the program to tab only from edit boxes if enter is
pressed, otherwise perform the default windows action. How do I test
for the current selected Dialog item? The block in question has the
BOOL CMainDlg::PreTranslateMessage(MSG* pMsg)
if( pMsg->message == WM_KEYDOWN )
...Outlook 2007: No copy and paste with CTRL+INS
As a left handed user I always use CTRL+INS and SHIFT+INS for copy and
MS seems to have deactivated this shortcut in Outlook 2007 (which is
very annoying if you are left handed).
Is there a way to enable this shortcut again?
Achim Becker, you wrote on Wed, 08 Apr 2009 11:21:07 +0200:
> CTRL+INS and SHIFT+INS
What does "INS" mean? The shortcuts are CTRL+C (copy) and CTRL+V
(paste). Or I do not understand?
X'Posted to: microsoft.public.outlook,microsoft.public.outlook.general
MVP - MS Outlook
http://www.o...CTRL C & CTRL V doesnot work whereby I cannot copy and paste.
CTRL C & CTRL V doesnot work whereby I cannot copy and paste.
Are you saying that you can copy and paste by other means (for example via
Microsoft Word MVP
"binoy" <firstname.lastname@example.org> wrote in message
> CTRL C & CTRL V doesnot work whereby I cannot copy and paste.
...CFileDialog and PreTranslateMessage
Hello, I have a CFileDialog derived class.
I want to handle the backspace key down in my derived class.
I added PreTranslateMessage handler to my class but it never gets in there
What can I do in order to handle the Back_Space key down in my derived
First of all you did not mention what control you want to receive
notification when del key was pressed.
Secondly you should not use PreTranslateMessage in this manner; it was not
designed for that and it is a source of many problems that usually are not
You have to provide more detailed infor...CTRL+TAB!!!!!!
I know I can jump between workbooks by using 'CTRL+TAB' to
go FORWARD. Well if I want to go bacwards it will be
While im in a writing function mode (In the middle of
writing a formula) I can jump to the next workbook "UP" to
reference something for a vlookup but not "Back" to
another....why? Please note that I can have up to 20
workbooks open at one time for the purpose of linking thus
if i need to reference the 19th workbook i need to
CTRL+TAB 19 time to get there rather than do a
CTRL+SHIFT+TAB 2 times. Is it somethint...Keyboard Messages not intercepted when PreTranslateMessage is used
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)
c...Interrupting long calculations in Excel? Hi all, I am having a very long calculation in Excel using VBA. Of course I know I can hit ESC or CTRL+BREAK to interrupt the VBA program. But I found du
Interrupting long calculations in Excel?
I am having a very long calculation in Excel using VBA.
Of course I know I can hit ESC or CTRL+BREAK to interrupt the VBA
But I found due to too long running process, the Excel window stop to
respond for very long time,
besically it's like "not responding" situation with "not responding"
on the windows title bar...
It doesn't seem to accept any more key strokes, not to say ESC or CTRL
What can I do to rein/stop my program?
Try this to speed up execution
Application.ScreenUpdating = FA...Highlight cells with ctrl-click but only un-highlight one cell
When highlighting a number of cells using ctrl-click, and accidentally
highlighting one incorrectly, how can I un-highlight it without losing my
other selections and starting over?
Hagan, have a look here for some code to do it,
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
"hagan" <email@example.com> wrote in message
ne...PreTranslateMessage in the DLL is not called
I have a strange thing in my code. I have a class which is derived from
CEdit. In that class there is a PreTranslateMessage method. It is called
when I compile this class in the Exe. But it is not never called when I
compile this class as a DLL and load it dynamically by LoadLibrary and use
Please do you have any ideas what is wrong there? What is the difference of
using derived class as a exe or as a dll?
Is it a Regular DLL? Is the CEdit derived object in a modeless dialog?
German Koninin wrote:
> Hi there.
> I have a stra...About ctrl-enter
When typing the name of the web address in the address bar and then press
Crtl-Enter. IE automatically shows the full URL address, however, it always
finishes the address with .com.tw
How to change the setting to finishing with .com.hk ?
My OS is Windows Vista Business & IE 8 in Trad Chinese.
In Internet Options> General> Languages> Specify the suffix. (Not where you
would think to look.)
Hope this helps,
[MS MVP- IE]
"yclhk" <firstname.lastname@example.org> wrote in message