DIVAquickref

From OO Lab
Jump to: navigation, search

* 2010/9/25

When menu->save MDS is clicked, I try to display a text above OK button So, in resource.rc I add a MDSSAVE_STRING static text control. I want it to display a message when OK of menu->save MDS is clicked.

At first, in MdsSaveDialog?.cpp, I added

          SendMessage(GetDlgItem(hDlg,MDSSAVE_STRING),WM_SETTEXT,sizeof(promptstring),(LPARAM)promptstring);  

This call fails. Later, I found, hDlg is the MDSSAVE_DIALOG, not mapping dialog. So, I add an extern variable mappingdialog to save the neodialog's handle.

After I wrie into


   SendMessage(GetDlgItem(mappingdialog,MDSSAVE_STRING),WM_SETTEXT,sizeof(promptstring),(LPARAM)promptstring); 


It succeeds. I also found the following call is equivalent

  SetDlgItemText(mappingdialog,MDSSAVE_STRING, promptstring);

lesson learned You need to understand which hDlg is hwich

To enable/disable a button in win32

         EnableWindow(GetDlgItem(hDlg, NEO_APPLY_BTN),FALSE);
Personal tools