15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Alt-UpArrow - I Want Notification!

beriksen@cda.com
Monday, March 04, 1996

     


     Hi There,
     
     I'm trying to mimic the behaviour of a combo box with a CEdit, an 
     owner-draw button (for the drop down arrow button) and a list box.  
     I've got a CEdit on a dialog that I've subclassed to CMyEdit so that I 
     can get at all it's messages.  When you click on the button, I 
     ShowWindow(SW_SHOW) the list (or ShowWindow(SW_HIDE) it if it's already 
     showing).  Anyway, here's my problem:
     
     In a standard combo box, if the pop-up is NOT visible, then 
     Alt-UpArrow (or Alt-DownArrow, for that matter) will bring up the 
     popup list.  Likewise, if the popup IS visible, then Alt-Up/Down will 
     make the popup go away.  I want my CMyEdit object to get notification 
     of this key combination, and I've tried everything I can think of, 
     without success.
     
     I think that the problem is that any Alt-x combination is treated as a 
     system message, but I tried overriding OnSysChar, OnSysCommand, 
     OnSysKeyDown, and none of these got fired when I pressed Alt-DownArrow 
     or Alt-UpArrow.  (They did, however, get fired when other things were 
     pressed, like ctrl-, etc.)  I've also put stuff in 
     PreTranslateMessage for my CMyEdit class, as well as in my CMyApp 
     class.  Again, I didn't get notified.
     
     Soooo...  Does anyone know about how to get Alt-Up/Down messages?  I'm 
     having a similar problem trapping ESC and ENTER.
     
     Thanks for your help!
     
     Brian Eriksen




LeRoy Baxter -- lbaxter@cinfo.com
Wednesday, March 06, 1996

you might try PreTranslateMessage()

----------
From: 	Brian Eriksen[SMTP:beriksen@cda.com]
Sent: 	Monday, March 04, 1996 7:18 AM
To: 	mfc-l@netcom.com
Subject: 	Alt-UpArrow - I Want Notification!

     


     Hi There,
     
     I'm trying to mimic the behaviour of a combo box with a CEdit, an 
     owner-draw button (for the drop down arrow button) and a list box.  
     I've got a CEdit on a dialog that I've subclassed to CMyEdit so that I 
     can get at all it's messages.  When you click on the button, I 
     ShowWindow(SW_SHOW) the list (or ShowWindow(SW_HIDE) it if it's already 
     showing).  Anyway, here's my problem:
     
     In a standard combo box, if the pop-up is NOT visible, then 
     Alt-UpArrow (or Alt-DownArrow, for that matter) will bring up the 
     popup list.  Likewise, if the popup IS visible, then Alt-Up/Down will 
     make the popup go away.  I want my CMyEdit object to get notification 
     of this key combination, and I've tried everything I can think of, 
     without success.
     
     I think that the problem is that any Alt-x combination is treated as a 
     system message, but I tried overriding OnSysChar, OnSysCommand, 
     OnSysKeyDown, and none of these got fired when I pressed Alt-DownArrow 
     or Alt-UpArrow.  (They did, however, get fired when other things were 
     pressed, like ctrl-, etc.)  I've also put stuff in 
     PreTranslateMessage for my CMyEdit class, as well as in my CMyApp 
     class.  Again, I didn't get notified.
     
     Soooo...  Does anyone know about how to get Alt-Up/Down messages?  I'm 
     having a similar problem trapping ESC and ENTER.
     
     Thanks for your help!
     
     Brian Eriksen








| Вернуться в корень Архива |