FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to trigger ComboBox KeyDown Event?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Wed Jan 21, 2009 10:06 am    Post subject: How to trigger ComboBox KeyDown Event? Reply with quote

Thanks!
________
Yamaha WR426


Last edited by ideage on Wed Feb 02, 2011 5:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Thu Feb 05, 2009 9:23 pm    Post subject: Reply with quote

Ah,I got it!

use Application's MessageFilter.

Code:


class ComboxKeyDownFilter:IMessageFilter
{
   HWND m_EditHwnd;
   
   this(ComboBox cbox){
      m_EditHwnd=FindWindowExA(cbox.handle,null,"Edit",null);
   }
   bool preFilterMessage(inout Message m)
   {
      if(m.msg ==WM_KEYDOWN && m_EditHwnd==m.hWnd)
      {
         writefln("KewDown!");
         return false;
      }
      return false;
   }
}


________
Third-generation Ford Taurus history
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group