]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
1. wxMSW::wxNotebook::SetPageSize() and SetPadding() added
[wxWidgets.git] / src / msw / listctrl.cpp
index b74816ce5baf8d36293df3c8053027fc93d862f2..34649103cc5eaf2cffed7d461b0ece5efdc2d536 100644 (file)
@@ -1420,9 +1420,16 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             }
 
             // else translate it into wxEVT_COMMAND_LIST_ITEM_ACTIVATED event
+            // if it happened on an item (and not on empty place)
             {
-                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+                if ( hdr->iItem == -1 )
+                {
+                    // not on item
+                    return FALSE;
+                }
+
+                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 event.m_itemIndex = hdr->iItem;
             }
             break;