I have a listview in my program, and i noticed that everytime when i select an item from the listview, 1 sec later a WM_TIMER msg is sended to the listview. Where does this come from, and how can i disable it?
I have a listview in my program, and i noticed that everytime when i select an item from the listview, 1 sec later a WM_TIMER msg is sended to the listview. Where does this come from, and how can i disable it?
Let's see the code for your message handler.Originally Posted by johny145
Away.
shure....
Code:while(GetMessage(&msg,0,0,0)) { if(LOWORD(msg.message) == WM_TIMER && hChMapDlgListView && msg.hwnd == hChMapDlgListView) // disable WM_TIMER on listview { /* SKIP */ } else if(LOWORD(msg.message) == WM_TIMER && msg.hwnd == listviewHandle)// disable WM_TIMER on listview { /* SKIP */ } else if(hChMapDlg && (TranslateAccelerator (hChMapDlg, hAccelTable, (LPMSG) &msg ) || IsDialogMessage (hChMapDlg,(LPMSG) &msg)) ) { /* SKIP */ } else if ( TranslateAccelerator(hwndMain, hAccelTable, (LPMSG) &msg ) || IsDialogMessage (hwndMain,(LPMSG) &msg) ) { /* SKIP */ } else { TranslateMessage(&msg); DispatchMessage (&msg); } }
Last edited by johny145; 06-25-2005 at 08:33 PM.
The timer is created and owned by the list-view. If you don't want the timer, get rid of the list-view. Why is it causing you distress?
I use the shortcut ctrl+a to select all items. Lets say you click on the listview and then do a quick ctrl+a to select everything. Everything gets selected and then the wm_timer comes by, and the items that has the focus gets selected again. I dont know why, but it seems a wm_timer sets the selection back to the item that has the focus. I also removed the focus from all items, but then nothing gets selected. As you can see i did some hacking in the messageloop, and now it doesnt happen anymore. But i would rather have the wm_timers not showing up at all.
Is there any reason why the listview makes a wm_timer, and how bad is it to block them from the listview?
*bump*
Is there any reason why the listview makes a wm_timer, and how bad is it to block them from the listview?