Galen
January 6th, 2006, 02:48 PM
I'm trying to handle the WM_KEYDOWN message in a datagrid. Specifically I want to know when ctrl+c is hit when the user wants to copy rows. At first I tried creating the handler like so:
this->m_datagrid->KeyDown += new System::Windows::Forms::KeyEventHandler(this, DataGrid_KeyDown);
void DataGrid_KeyDown(Object* obj, System::Windows::Forms::KeyEventArgs* e)
{
}
However, that didn't work. It never recieved any WM_KEYDOWN messages even though I was using ctrl+c to copy rows from the datagrid. It seems like something else is receiving the message.
I also tried a similar method by overloading the PreProcessMessage function in my datagrid but got the same results. It doesn't recieve the message.
Finally, I learned to use Spy++ a little to see where the WM_KEYDOWN is going. It is going to a child window whose class is "WindowsForms10.EDIT.app4". Does that mean anything to anyone? Any advice is much appreciated.
this->m_datagrid->KeyDown += new System::Windows::Forms::KeyEventHandler(this, DataGrid_KeyDown);
void DataGrid_KeyDown(Object* obj, System::Windows::Forms::KeyEventArgs* e)
{
}
However, that didn't work. It never recieved any WM_KEYDOWN messages even though I was using ctrl+c to copy rows from the datagrid. It seems like something else is receiving the message.
I also tried a similar method by overloading the PreProcessMessage function in my datagrid but got the same results. It doesn't recieve the message.
Finally, I learned to use Spy++ a little to see where the WM_KEYDOWN is going. It is going to a child window whose class is "WindowsForms10.EDIT.app4". Does that mean anything to anyone? Any advice is much appreciated.