Button Icon graphics in Vista

The following works in WinXp (VS2002 IDE):

 CButton   m_ButtonName;
....
BOOL CMyDlg::OnInitDialog()
{
....
 m_ButtonName.SetIcon (AfxGetApp()->LoadIcon(IDI_IconName)); 
....
}

The "Icon" property in visual studio is set true for the button.
There is no manifest file for the exe.

But the above doesn't work in Vista.  Specifically the icon graphics
is missing/not showing.  Also the button looks to be system drawn
(vertical shading).

Any ideas?

Thanks...

0
gumpy (11)
7/19/2007 4:33:59 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
601 Views

Similar Articles

[PageSpeed] 20

> CButton   m_ButtonName;
>...
>BOOL CMyDlg::OnInitDialog()
>{
>...
> m_ButtonName.SetIcon (AfxGetApp()->LoadIcon(IDI_IconName)); 
>...
>}
>
>The "Icon" property in visual studio is set true for the button.
>There is no manifest file for the exe.
>
>But the above doesn't work in Vista.  Specifically the icon graphics
>is missing/not showing.  Also the button looks to be system drawn
>(vertical shading).

Which bit is failing? Does LoadIcon return a valid icon?

Dave
0
davidl7375 (2060)
7/19/2007 8:49:05 AM
Motherboard Help By HAL web site:
http://home.comcast.net/~mobo.help/ 


On Thu, 19 Jul 2007 09:49:05 +0100, David Lowndes
<DavidL@example.invalid> wrote:

>> CButton   m_ButtonName;
>>...
>>BOOL CMyDlg::OnInitDialog()
>>{
>>...
>> m_ButtonName.SetIcon (AfxGetApp()->LoadIcon(IDI_IconName)); 
>>...
>>}
>>
>>The "Icon" property in visual studio is set true for the button.
>>There is no manifest file for the exe.
>>
>>But the above doesn't work in Vista.  Specifically the icon graphics
>>is missing/not showing.  Also the button looks to be system drawn
>>(vertical shading).
>
>Which bit is failing? Does LoadIcon return a valid icon?
>
>Dave

LoadIcon does seem to be working as 

 HICON icon = AfxGetApp()->LoadIcon(IDI_IconName);
 SetIcon(icon, TRUE);
 SetIcon(icon, FALSE);

does successfully load the button graphics onto the window in Vista.

0
gumpy (11)
7/19/2007 11:34:28 PM
On Thu, 19 Jul 2007 09:49:05 +0100, David Lowndes
<DavidL@example.invalid> wrote:

>> CButton   m_ButtonName;
>>...
>>BOOL CMyDlg::OnInitDialog()
>>{
>>...
>> m_ButtonName.SetIcon (AfxGetApp()->LoadIcon(IDI_IconName)); 
>>...
>>}
>>
>>The "Icon" property in visual studio is set true for the button.
>>There is no manifest file for the exe.
>>
>>But the above doesn't work in Vista.  Specifically the icon graphics
>>is missing/not showing.  Also the button looks to be system drawn
>>(vertical shading).
>
>Which bit is failing? Does LoadIcon return a valid icon?
>
>Dave

I found the problem.

Vista doesn't work with buttons that have 2 color (monochrome) icons.
It seems a CButton icon must have at least 16 colors.

Fix for Vista SP1 ?

0
gumpy (11)
7/20/2007 6:30:00 PM
>I found the problem.
>
>Vista doesn't work with buttons that have 2 color (monochrome) icons.
>It seems a CButton icon must have at least 16 colors.

You're right, now I've found time to try it, it doesn't work for me
either.

>Fix for Vista SP1 ?

The hard part is getting MS to acknowledge it - I think the only way
you can reliably do that is to phone them and report it that way.

If you give them a sample EXE (and the source for it if they need it)
that works fine on XP and doesn't on Vista it's clearly a bug/quirk so
you should not be charged to report it.

Let us know how you go on.

Dave
0
davidl7375 (2060)
7/22/2007 12:57:47 PM
On Sun, 22 Jul 2007 13:57:47 +0100, David Lowndes
<DavidL@example.invalid> wrote:

>>I found the problem.
>>
>>Vista doesn't work with buttons that have 2 color (monochrome) icons.
>>It seems a CButton icon must have at least 16 colors.
>
>You're right, now I've found time to try it, it doesn't work for me
>either.
>
>>Fix for Vista SP1 ?
>
>The hard part is getting MS to acknowledge it - I think the only way
>you can reliably do that is to phone them and report it that way.
>
>If you give them a sample EXE (and the source for it if they need it)
>that works fine on XP and doesn't on Vista it's clearly a bug/quirk so
>you should not be charged to report it.
>
>Let us know how you go on.
>
>Dave

I've found so many coding solutions just searching newsgroups.  The
important thing for me is that the problem is documented here.

Thanks for the confirmation.

0
gumpy (11)
7/27/2007 2:13:26 PM
Reply:

Similar Artilces:

Do not Email Button
Folks, can anyone tell me if there is a way to insure that a contact marked as do not email, using the radio button on their record, does not get emailed? thanks Pat No this does not work consistently throughout the system. I believe it has been logged as a bug but no resolution has been provided as far as I am aware. "Phifunk" <Phifunk@discussions.microsoft.com> wrote in message news:DD32EE5B-4BCD-419F-BA5E-FBE7A31843E1@microsoft.com... > Folks, > > can anyone tell me if there is a way to insure that a contact marked as do > not email, using the radio button...

Option Buttons/Radio Buttons
Hi I run Excel 2000 I have 2 option buttons in each row (total of 20 rows) I would like the only one of the 2 buttons in each row are on or off. The problem I am having is that it dosent matter which button on which row I select, only that button is active. All the other buttons go blank. I have tried changing the source for each pair of buttons but when I do all the other button sources change as well. How do i set up the buttons so that I can select one of the 2 in every row.? Example 20 buttons in total - 10 buttons active and 10 buttons inactive Thanks John You have to grou...

Settings Button , Customize Button and Service Calendar
Here are the links you can put inside the outlook client to access this menu's inside outlook without having to use the web client to make the changes in your organization Just creat a new folder in the CRM structure ( or not ) , in the properties windows ( homepage ) Insert the following info. Settings http://crm:port/tools/home_tools.aspx?pid=0 System Customization http://crm:port/tools/systemcustomization/systemcustomization.aspx?pid=0 Service Calendar http://crm:port/sm/home_apptbook.aspx You have to creat a folder for each link . Im using this , i dont know if microsoft recommen...

Import Vista Winmail into Outlook 2007
Please advise how I can import Vista WinMail emails and contacts into Outlook 2007? Thanks Malcolm Both apps need to be installed & configured on the same PC Export msgs from Mail to Outlook In OL Import Contacts (Though you may have to export Mail contacts to a scv file, then import that into OL) "Buchanan Family" <buchann@iimetro.com.au> wrote in message news:245F49C7-A7B1-455B-9E12-33CA1372C66E@microsoft.com... > Please advise how I can import Vista WinMail emails and contacts into > Outlook 2007? > Thanks > Malcolm > All works, Thanks Malcolm ...

Moving a Button in a Dialog
I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN) pBtnOK->GetWindowRect( &Rect ) Rect.left += 1 Rect.right += 1 pBtnOK->MoveWindow( &Rect, TRUE) Thanks in advance. Rahvin wrote: > I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command: > > CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN); > pBtnOK->GetWindowRect( &Rect ); > Rect.left +...

Missing Send Button #3
My kids messed up something in Outlook. I have XP Hmoe and office 2000. My outlook works fine (under my user) but my wife's is now missing the send button in the toolbar. Thus seh cannot send emails. I cannot check the response toolbar under customize. Do I need to uninstall then reinstall or is there a way to fix it without having to do that? Thanks for any help anyone can offer. Is her mail account installed and working? Does reinstalling the account clear up the situation? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. D...

Radio Button
I have a form someone created in Excel and somehow three buttons are linked together so that if I click on one, it selects the one I click on and clears one selected before. Is there a way to have it clear the button that was selected if I click on the same button again. As it is, I cannot clear all the buttons once a button is selected. Hi This is what radiobuttons (option buttons) are for. Either Male or Female, no None or Both or Not sure yet or Refuse to answer. For independent choices (Vegetarian, Blonde, Plays guitar, ... ) use checkboxes. HTH. Best wishes Harald "Debb...

Buttons Issue with Access 2007 on Vista
Hi there! I have a client who has a simple access DB. If he runs it onXP/Access 2007 no issue, but if he runs it on vista/access2007, he can't click any of the buttons on any of theforms! Could someone shed some light please?...

Outlook Custom Button
Hi All, Is there a way to add a custom button to Outlook 2003 SP-2 standard tool bar and have it replicate to all the users in the domain? Thanks CG You'd need to add it using a script or vba and push it out via a logon script. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Cen...

Folder icons change when moved to another computer
I've changed the folder icon of several folders. When I move them onto a data CD they remain as I changed them. But when I open the CD on another computer they revert to the old yellow default folder. How do I get them to keep the changes? On another forum I was told to place that icon file into that particular folder (no problem) and to create a "desktop.ini file" and make it a system file (problem). I'm not a programmer. No one responds with exactly how that is done. Can anyone help with basic - "beginner" steps? "MW" <changeabl...

Superscript Button and Subscript Button
I am trying to customize my toolbars, and I can't seem to find the superscript or subscript command. Is there a way to make the superscript and subscript commands into a button in Excel? "=?Utf-8?B?U2xvdGg=?=" <Sloth@discussions.microsoft.com> wrote in news:3D6FC2A9-56DD-49DD-B2A3-0DC028A12184@microsoft.com: > I am trying to customize my toolbars, and I can't seem to find the > superscript or subscript command. Is there a way to make the > superscript and subscript commands into a button in Excel? > Record a macro for each and tie them to buttons. ...

Volume Icon In Taskbar
Hi! Hope someone can help me I can not get my volume icon ( speaker ) to appear on the taskbar, dispite having ticked the box ( place icon on taskbar ) It used to be there before Mike from Africa South Africa Mike van der Merwe;3370931 Wrote: > Hi! > Hope someone can help me > I can not get my volume icon ( speaker ) to appear on the taskbar, > dispite > having ticked the box ( place icon on taskbar ) > It used to be there before > > Mike from Africa > South Africa I believe the second method suggested at this link from Microsoft will ...

Vista Laptop Won't Shutdown (Restarts Instead)
Ok, I have a Toshiba M300 Laptop that just recently has begun to restart when I tell it to shutdown. I have never had a problem like this before and can't think of anything I've downloaded that would cause a problem like this. I have Vista. Anyone have any ideas on why this happened or how I can fix it? Any help/suggestions would be appreciated. If you have any questions I'll try to answer them in the morning. Thanks. -- thechad ------------------------------------------------------------------------ thechad's Profile: http://forums.techarena.in/membe...

Problem with VBA code on command button
I have a form that has a combo box to select a month. The name of the combo box is txtmontha (I realise it would have been better to name it cmb???) The is a command button that when clicked should open a form where the date selected from the combo box is the same value as the date on the form. Here is the code behind the command button: Private Sub cmdopenrecord_Click() On Error GoTo Err_cmdopenrecord_Click Dim strqtr As String strqtr = Me.txtmontha.Value Forms!frmMain!SubForm1.SourceObject = "frmFDA" Forms!frmMain!SubForm1.Form.RecordSou...

ActiveX Option Buttons
:confused: Hello, I need to know how to tell an option button what value to return. I have a group of 4 option buttons and I have linked them all to th same cell. That's when they stop working, because they all want to say 'true' o 'false' - how do I get them to return a value instead (i.e. 1-4) so can do a calculation on the value in the linked cell? Please help -- veci ----------------------------------------------------------------------- vecia's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=211 View this thread: http://www.excelfor...

Recording a command button name
I have an application where the user is prompted to save when they leave the the data entry form either by previewing a report of the data or by closing the form completely. There are two buttons a user can use to do this cmdPreview or cmdClose. I use a module to promt the user for svae. What I would like to do is differentiate to the module which button was clicked. Is there a way to do this? thanks You could take a look at Screen.ActiveControl.Name -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "E" <...

Custom Button for a Report
Thanks,Tom It is posible create Custom Button for a Report create in Store Operations Manager(Reports/Memorized) or In Store Operation Adminstratrator(SQL FILE) Wilfredo It might be possible, but it'd be beyond the scope of my ability at present. Good luck, Tom -- The worst words in business: "We''ve always done it that way" -- Stop Fishing for eMail. "Wilfredo De Jesus" wrote: > Thanks,Tom > > It is posible create Custom Button for a Report create in Store Operations > Manager(Reports/Memorized) or In Store Operation Adminstratrator(SQL FI...

Force TRUE in a check box as result from an option button??
I have a set of option buttons and a set of check boxes. One of the check boxes is for a certain value that is similar to one of the option buttons. Essentially, what I want is for that check box to automatically go to a "TRUE" (checked) state when the certain option button is selected. When the other option buttons are selected, the check box will remain in it's normal state which will allow the user to select it or not depending on other variables. But, if the option button is on that certain selection, I would like to make it so that check box MUST remain on TRUE, and ...

Make a button the default button
Hi all If got a form with 3 buttons. First they need to search for a customer and after that for all the articles related for that customer. So in the code for searching a customer I put: Me.knp_Bok_Zoeken.Default = True at the end. But he doesnot make this the default button :S Or at least when I enter a customer and press enter he searches for that customer and if I press enter again he does nothing (instead of running the code to find the articles) Does anybody now what I'm doing wrong? Kind regards Erwin Erwin If you open the form in design view, select the button you wi...

Print button on toolbar linked to specific printer, way to do?
Argggh, they keep changing colour printers on us <lol>! I'm in a govt dept that balloons up/deflates due to election events! In the last 2 weeks, they've changed all the printers around on us as they move them to accommodate needs! At the end of the event, the printers will all return back to their original configurations and locations <phew>! The colour printer is the one that concerns me. Is there a way to just assign a printer, via a macro maybe, to a button on the toolbar? That way, no matter what printer was actually there and no matter where it was locat...

Button
I know this is simple, but i've been staring at it for so long that it's not going to be obvious. I have put a button on a sheet so I could run a macro with it. The button wouldn't let me assign the macro to it, I right clicked and it didn't give me the assign macro shortcut selection. I copied a button from another sheet and pasted it and redid the macro, that is fine. My problem is that I can't get the button that wouldn't let me assign a macro, to go away. I tried to right click and nothing happens. I left click and it just pushes in. I can't find a sett...

Back button and toolbar keys...
don't seem to work. Sometimes, but then they stop and nothing can be done. Quite frustrating. Read something about a corrupted cache. Any suggestions? Do I just uninstall and reinstall the program? Using Win7 Pro 64 bit. "citizen53" <citizen53@discussions.microsoft.com> wrote in message news:09C97EF7-7614-4A8E-990C-56895AD30BA9@microsoft.com... > don't seem to work. Sometimes, but then they stop and nothing can be > done. > Quite frustrating. Read something about a corrupted cache. Any > suggestions? > Do I just uninstall and r...

Resizing Option Button?
Hello Friends, I have asked a Question in mrexcel.com. But, the reply was it is not possible. Please check the below link and tell me is doable. http://www.mrexcel.com/board2/viewt...7747&highlight= Thanks, Nawaf -- countryfan_nt ------------------------------------------------------------------------ countryfan_nt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=11051 View this thread: http://www.excelforum.com/showthread.php?threadid=482535 No you can't, at least not the actual button part. -- HTH RP (remove nothere from the email address if ...

Submit button #4
I'm building an intranet for our company and here's what's going on. I've created page with a standard publisher form with a Submit button and in the properties, naturally it gives one of three options for the button; HTM, E-mail or another ISP program. I want it to email me the results. The problem is that because of the way our network is setup (not my doing), getting Frontpage Extensions to work would be nothing short of a miracle. What other options do I have that don't involve Frontpage anything? Ted, I haven't used it, but others claim it is easy and ...

MessageBox buttons
Hello, Is this possible to change language of buttons caption for :MessageBox, or AfxMessageBox() funtions? or I need to write customized dlg box? thanks I think the language is based on the version of the OS or MFC installed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfcnotes_tn056.asp http://www.codeproject.com/cpp/introtolocalization.asp Tom "alladyn" <alladyn@yahoo.com> wrote in message news:OiWCzLysFHA.332@tk2msftngp13.phx.gbl... > Hello, > Is this possible to change language of buttons caption for :MessageBox, > or AfxMe...