Welcome to the CSIG, a Special Interest Group of the ACGNJ. The subject for this month is a discussion about MFC Windows Programming using Microsoft Visual C++ version 6.0.
At the meeting, we are going to discuss an excellent article by Nishant Sivakumar called "C++ Tips, Tricks, and Workarounds". I found the article while browsing www.codeproject.com. The author is able to explain a number of areas which cause trouble for Visual C++ programers. Some topics include hidden modal dialogs, stealing focus, always on top dialogs, going full-screen, expanding and contracting dialogs, removing task bar icon, context sensitive help and many other useful tips and tricks.
http://www.codeproject.com/dialog/dlgboxtricks.asp
http://www.voidnish.com/articles/ShowArticle.aspx?code=dlgboxtricks
His heavily discussed article (250 messages on CodeProject site) includes:
Starting a modal dialog hidden |
Full screen dialogs |
How to steal focus on 2K/XP |
Making your dialog stay on top |
Expanding and Contracting your dialog boxes |
Getting your dialog box into the desktop |
Adding minimize/maximize buttons to your dialog box |
Changing the mouse cursor |
Changing a dialog's background and control text color |
Removing the task bar icon of your dialog based App |
Context sensitive help |
Show MessageBox after main dialog is dismissed |
The beginning of the evening (starting at 7:30pm) will be a RANDOM ACCESS discussion. The main presentation will discuss the article.
Our download site has code and programs from most of our meetings. ( Source Code Files )
Sample Code =========== See the above links for the author's article. The Code Project site also has about 250 comments from other programmers about the article. There are many, many tips and features. The following is an example from his article: Expanding and Contracting your dialog boxes I bet you have seen programs with dialog boxes that start off at one size. They will have a button called "expanded view" or maybe something called "advanced" and when you click on that button the dialog box expands beautifully revealing some so-far hidden child controls. They might also have some button called "hide details", and when you click on that it will contract back to the original smaller size hiding the extra controls that were revealed on expansion. This can be easily achieved using SetWindowPos, which as you can see is quite an useful function. Assume that you have two buttons, "MakeSmall" and "Expand". Then this is what you need to put in their click-handler functions. Of course, you need to replace the cx and cy parameters with your own values. void CTest_deleteDlg::OnMakeSmall() { SetWindowPos(NULL,0,0,200,200,SWP_NOZORDER|SWP_NOMOVE); } void CTest_deleteDlg::OnExpand() { SetWindowPos(NULL,0,0,500,300,SWP_NOZORDER|SWP_NOMOVE); }