Adding a tile to an MFC application
Asked Answered
T

2

6

I have a C++ MFC application that has a bunch of dialogs which are defined in an .rc file. I need to add a tile to the application for pinning it to the start menu because the default "tile" that Windows creates from the icon doesn't look very good. Rewriting the whole application to use XAML instead of the .rc file isn't an option right now. The tile doesn't need to be interactive, just display a better looking picture than just slapping the small icon in.

Is there a way to add a tile to an MFC application with an .rc file?

If not, the other idea I had was to create a wrapper application which uses XAML to create a tile, and the only thing the wrapper application would do is launch the MFC application. Does anybody have a better solution?

I am using Visual Studio 2015. The .ico file I'm using has 768x768, 512x512, 256x256, 150x150, 48x48, 32x32, and 16x16 versions of the image in it.

Edit

There was some confusion about what exactly I needed. Here is an annotated screen shot which hopefully shows the issue clearly. annotated screen shot showing, default tile with small icon

One other clarification, I don't think this makes any difference, but I thought I'd add it just to be safe. The program does not need to run on Windows 8/8.1, just Windows7 and Windows10

Terylene answered 12/8, 2015 at 15:53 Comment(2)
this might not solve the problem, but have you tried to have an image with the background as the alpha channel? I'm asking this because all the other images shown look like just monocolored alphachannel images, except the "blast kills at least 50 in china" widgetBehan
Yeah, I've tried using the alpha channel. It is still just a small image on the tile.Terylene
T
2

After extensive research it is clear that this is not possible. Not only is it not possible with MFC, but the only way to create a tile (live or static) is with a Windows Universal App. So my solution here is to create a simple launcher program that starts up the MFC application and then exists. However, one caveat here is that Windows Universal programs are not allowed to directly run other programs. What they are allowed to do is open a file with it's default program. So I created a new file extension and assigned the default application to be the MFC program.

Terylene answered 27/8, 2015 at 15:56 Comment(0)
A
0

this->SetWindowText("SudeshMFCDemo");

https://msdn.microsoft.com/en-us/library/yhczy8bz(v=vs.90).aspx

Audie answered 27/8, 2015 at 11:55 Comment(2)
You are right.I misread the question here. But I have another link, I think that is suitable solution for you. ucancode.net/Visual_C_MFC_Samples/…Audie
No that is not helpful. That link is dealing with an image inside an application and has nothing to do with start menu tiles.Terylene

© 2022 - 2024 — McMap. All rights reserved.