Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Bmp's in Dialogs under Vista Pin
PJ Arends6-Oct-09 14:41
professionalPJ Arends6-Oct-09 14:41 
GeneralRe: Bmp's in Dialogs under Vista Pin
Bram van Kampen7-Oct-09 15:10
Bram van Kampen7-Oct-09 15:10 
QuestionCMFCPropertyGridCtrl from Dll and exe assert Pin
f.fuga6-Oct-09 10:57
f.fuga6-Oct-09 10:57 
AnswerRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
«_Superman_»6-Oct-09 12:14
professional«_Superman_»6-Oct-09 12:14 
GeneralRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
f.fuga6-Oct-09 20:23
f.fuga6-Oct-09 20:23 
GeneralRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
«_Superman_»7-Oct-09 7:07
professional«_Superman_»7-Oct-09 7:07 
GeneralRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
f.fuga7-Oct-09 9:46
f.fuga7-Oct-09 9:46 
GeneralRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
«_Superman_»7-Oct-09 10:43
professional«_Superman_»7-Oct-09 10:43 
GeneralRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
f.fuga7-Oct-09 23:41
f.fuga7-Oct-09 23:41 
AnswerRe: CMFCPropertyGridCtrl from Dll and exe assert Pin
Oza Priyanka4-Apr-18 6:35
Oza Priyanka4-Apr-18 6:35 
QuestionCStdioFile::ReadString() Method. Pin
Chris Meech6-Oct-09 9:43
Chris Meech6-Oct-09 9:43 
AnswerRe: CStdioFile::ReadString() Method. Pin
PJ Arends6-Oct-09 10:36
professionalPJ Arends6-Oct-09 10:36 
GeneralRe: CStdioFile::ReadString() Method. Pin
Chris Meech7-Oct-09 2:09
Chris Meech7-Oct-09 2:09 
QuestionCreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
rambojanggoon6-Oct-09 8:58
rambojanggoon6-Oct-09 8:58 
AnswerRe: CreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
CPallini6-Oct-09 9:49
mveCPallini6-Oct-09 9:49 
AnswerRe: CreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
«_Superman_»6-Oct-09 12:21
professional«_Superman_»6-Oct-09 12:21 
Questionto change cricheditctrl's window border Pin
prithaa6-Oct-09 8:34
prithaa6-Oct-09 8:34 
AnswerRe: to change cricheditctrl's window border Pin
«_Superman_»6-Oct-09 10:53
professional«_Superman_»6-Oct-09 10:53 
GeneralRe: to change cricheditctrl's window border Pin
PJ Arends6-Oct-09 11:58
professionalPJ Arends6-Oct-09 11:58 
GeneralRe: to change cricheditctrl's window border Pin
prithaa7-Oct-09 0:25
prithaa7-Oct-09 0:25 
QuestionProperty sheet-based app has icon problems Pin
rfparker6-Oct-09 8:03
rfparker6-Oct-09 8:03 
I am developing a property sheet-based application on XP using VC++ 6. When it starts it talks briefly to an instrument over a serial port in app::InitInstance(), creates the property sheet, adds a few pages, and does an appSheet.DoModal() to make it appear. In order to get an icon to appear in the taskbar and Alt-Tab, I use this code in appSheet::OnInitDialog():
// Set the icons for the app
AfxGetMainWnd()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
AfxGetMainWnd()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);

The app works just fine, and until I added a slight twist mentioned next the icons appeared as expected.

For the several seconds during which the app is initially talking to the instrument the user sees nothing happening. So at the beginning of app::InitInstance() I create a modeless dialog that asks the user to be patient while the app starts up, and then hide the dialog at the end of the startup property page's OnInitDialog(). This works fine and looks great. Except that now SetIcon(), above, returns 0 and I get the generic white window icon for Alt-Tab and nothing in the taskbar. The icon in the title bar is still correct.

If I use the following code in place of the previous code, I can get the icon to display when I do an Alt-Tab, but nothing shows up in the taskbar.
HICON hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);
CWnd* pFrame=AfxGetMainWnd();
::SetClassLong(pFrame->GetSafeHwnd(), GCL_HICON, (long)hIcon);

Interestingly, until I do this the generic MFC icon shows up in the taskbar.

Any ideas why this is happening and how to get my icon and app name to appear in the taskbar?
Thanks
AnswerRe: Property sheet-based app has icon problems Pin
PJ Arends6-Oct-09 10:42
professionalPJ Arends6-Oct-09 10:42 
GeneralRe: Property sheet-based app has icon problems Pin
rfparker6-Oct-09 11:03
rfparker6-Oct-09 11:03 
GeneralRe: Property sheet-based app has icon problems Pin
PJ Arends6-Oct-09 11:23
professionalPJ Arends6-Oct-09 11:23 
GeneralRe: Property sheet-based app has icon problems Pin
rfparker7-Oct-09 11:11
rfparker7-Oct-09 11:11 

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.