Free Source Code and Program Tips
How to catch the events when click on the app icon on taskbar
How to catch the events when you click on the application's icon on the taskbar?
It’s the WM_NC class messages. For example, you can handle the WM_NCLBUTTONDBLCLK message.
And you can alse reponsible the WM_SYSCOMMAND messages. In particular, the special cases of SC_MINIMIZE and SC_MAXIMIZE are what are called from the system menu, which is what is available from the taskbar.
| Print article | This entry was posted by support on September 24, 2008 at 3:55 pm, and is filed under Win32/MFC. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
No comments yet.
No trackbacks yet.
The Simplest way to change the row height of CListCtrl
about 2 years ago - No comments
In the post “How to change the row height of CListCtrl“, it gives 2 solution example how to change row height or CListCtrl. Hower, it is not the simplest way. The simplest way to change the row height in a CListCtrl is: Display an icon with the desired height. All other ways that I know
How to Adding CTreeCtrl in CListCtrl
about 2 years ago - No comments
In some case, you need such a control as the following figure: It’s a CListCtrl like control, but it binds a CTreeCtrl in the first column. But you can also consider it as a CTreeCtrl and each of the items has the list style. All roads lead to Rome. But in 1999, David Lantsman has
How to send/post message to CDocument?
about 2 years ago - 2 comments
Sometime you need to send/post message to CDoumnet, but CDocument is not a window, and it can’t receive message. How do that? There are 3 solutions: Solution 1: Send the message to the main window. Send/Post the message to the main frame or the view, and then call some functions of the document. But if
How to use an derived CListCtrl in CListView
about 2 years ago - 2 comments
Sometime you use CListView and need to extend the functionality of the CListCtrl of the view. For example, you want to overwrite the handler function of the NM_CUSTOMDRAW or WM_SIZE message. So the problem is: How to tell CListView to use your own CListCtrl? OK, you are on the wrong way now. The CListView does
How to set the backgroud color of CPropertyPage
about 2 years ago - No comments
How to set the backgroud color of CPropertyPage? If you override OnCtlColor in your property page, then you can return a different background color and that seems to work with CStatic and other items. But what if you want is a background that’s not just a simple color? You’d like to be able to draw
How to select the item of ListView(CListCtrl)
about 2 years ago - No comments
Use CListCtrl::SetItemState with LVIS_SELECTED
Intermittent work in UI thread
about 2 years ago - No comments
Pedro Ferreira I’m trying to create a UI thread to do constant background work, but I’m having some design problems. The thread needs to fetch records from a database. do some processing on each record and, when there are no more records, sleep for 1 minute before check the database again. The process will be
Intermittent work in UI thread
about 2 years ago - No comments
Pedro Ferreira said: I’m trying to create a UI thread to do constant background work, but I’m having some design problems. The thread needs to fetch records from a database. do some processing on each record and, when there are no more records, sleep for 1 minute before check the database again. The process will
Install global hook without dll
about 3 years ago - 2 comments
Chinese version author: peach@newsmth.net Userally, when you install a global hook, you need a dll. But now, you can install WH_KEYBOARD_LL or WH_MOUSE_LL global hook without dll’s help. The following code was tested under win2k3. And I it will also run on 2k/xp. #define _WIN32_WINNT 0400 #define STRICT #define WIN32_LEAN_AND_MEAN #include #include #include DWORD g_main_tid
Solution: Crash in Release build with self-defined message
about 3 years ago - No comments
We often meet such case: I have an application with a modeless dialog. The dialog comes up perfectly in DEBUG build, But in RELEASE build, it crashed. Such problem often occures because of incorrect signature of message handle functions, that included into MFC message map for your CWnd based class.We should very carefully check signatures