Click here to Skip to main content
15,900,713 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can I calculate??? help Pin
Snyp7-May-04 15:00
Snyp7-May-04 15:00 
AnswerRe: How can I calculate??? help Pin
valikac7-May-04 18:47
valikac7-May-04 18:47 
GeneralRe: How can I calculate??? help Pin
Rafael Fernández López7-May-04 23:14
Rafael Fernández López7-May-04 23:14 
GeneralRe: How can I calculate??? help Pin
Snyp8-May-04 13:04
Snyp8-May-04 13:04 
Generalwebbrowser control in dll Pin
dilip_sarangi7-May-04 14:59
sussdilip_sarangi7-May-04 14:59 
GeneralRe: webbrowser control in dll Pin
Rafael Fernández López7-May-04 23:17
Rafael Fernández López7-May-04 23:17 
GeneralHandling Minimize event Pin
Dev5787-May-04 12:55
Dev5787-May-04 12:55 
GeneralRe: Handling Minimize event Pin
Garth J Lancaster7-May-04 14:09
professionalGarth J Lancaster7-May-04 14:09 
Both of the links I posted to your previous question 'Running a program in the taskbar' show how to handle the minimize event (or, one way of doing it)

Did you look at these examples ??

There are plenty of other examples, you can search here, or google

In general terms, when designing (say a dialog app), you must set 'Minimise Box' under Dialogue Properties -> Styles.

You then write/modify the handler for the 'OnSysCommand' - an example of such is shown below :-

void CMBFGWMS1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
// Decide if minimize state changed
bool bOldMin = bMinimized_;
if (nID == SC_MINIMIZE) {
bMinimized_ = true;
}
else if (nID == SC_RESTORE) {
bMinimized_ = false;
}

CDialog::OnSysCommand(nID, lParam);

if (bOldMin != bMinimized_) {
// Minimize state changed. Create the systray icon and do
// custom taskbar button handling.
SetupTrayIcon();
SetupTaskBarButton();
}
}
}


the line

nID == SC_MINIMIZE

is actually the bit that checks to see if the minimise button/request was activated (since there are a number of different requests that all come through OnSysCommand) - this is how the request is handed to your program ...

How about you try using one of the examples, and post some code back to CP if you want more help - its easier for us to work with 'posted code' than vapour ....

'G'
GeneralRe: Handling Minimize event Pin
Joe Woodbury7-May-04 17:44
professionalJoe Woodbury7-May-04 17:44 
GeneralRe: Handling Minimize event Pin
nguyenvhn7-May-04 22:29
nguyenvhn7-May-04 22:29 
Generallistbox custom draw Pin
roel_7-May-04 12:46
roel_7-May-04 12:46 
GeneralRe: listbox custom draw Pin
Joe Woodbury7-May-04 17:47
professionalJoe Woodbury7-May-04 17:47 
GeneralRe: listbox custom draw Pin
roel_8-May-04 5:33
roel_8-May-04 5:33 
GeneralBMP trouble Pin
Rafael Fernández López7-May-04 11:40
Rafael Fernández López7-May-04 11:40 
GeneralRe: BMP trouble Pin
Monty27-May-04 20:30
Monty27-May-04 20:30 
GeneralRe: BMP trouble Pin
Rafael Fernández López7-May-04 23:09
Rafael Fernández López7-May-04 23:09 
GeneralNT Service - problem with re-registering Pin
Anonymous7-May-04 11:08
Anonymous7-May-04 11:08 
GeneralRe: NT Service - problem with re-registering Pin
2249177-May-04 19:19
2249177-May-04 19:19 
GeneralRe: NT Service - problem with re-registering Pin
Anonymous9-May-04 5:55
Anonymous9-May-04 5:55 
GeneralFile organization with larger projects Pin
Steve Messer7-May-04 10:07
Steve Messer7-May-04 10:07 
GeneralRe: File organization with larger projects Pin
Maarten Kools7-May-04 10:22
professionalMaarten Kools7-May-04 10:22 
GeneralRe: File organization with larger projects Pin
Steve Messer7-May-04 11:07
Steve Messer7-May-04 11:07 
GeneralRe: File organization with larger projects Pin
John M. Drescher7-May-04 10:24
John M. Drescher7-May-04 10:24 
GeneralRe: File organization with larger projects Pin
Steve Messer7-May-04 11:25
Steve Messer7-May-04 11:25 
GeneralRe: File organization with larger projects Pin
John M. Drescher8-May-04 16:07
John M. Drescher8-May-04 16:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.