I am creating a simple Win32 GUI application for windows 10. I want to set an icon that will appear in the taskbar when it is open. I have already defined an icon in my resource file, but it only appears next to the exe file in file explorer. when I open the app it still just shows the default icon. I'm a huge noob when it comes to windows programming, so I'm sorry if I'm missing something obvious.
Any help is appreciated.
My resources.rc file:
#include "winuser.h"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "TDAssist.exe.manifest"
id ICON "icon.ico"
The taskbar uses the icon from the window, not the first icon in the resources.
Use LoadImage(GetModuleHandle(0),..., LR_SHARED) to get a HICON and assign it to the window when you register the window class or by sending WM_SETICON.
The taskbar and Alt+Tab dialogs might display the .exe icon in some versions but it depends on the window style and other undocumented specifics.
Related
When the mouse cursor moves from my application's window over any Finder window that may be open, how do I get in my application the current folder which is opened in that Finder window?
My application runs on both Windows and MacOS, but I have only found an answer on Stack Overflow for the Windows case, and don't know how to achieve this for Mac as well.
Image of the main application and child application
Im using Linux Ubuntu 16.04 and Qt Application
I have a problem about a windowflags in qt, that when I enter in full screen mode, my application model bar and menu bar hides since my application opens 2 application.
So I decided to make another application to Qt::FramelessWindowhint in order the other application cannot be open and only the main application will be shown.
My problem is when I dragged the application to another monitor, the 2nd application will hide.
Can anyone help me about this problem?
I recently started developing an app in C++ & Qt 5.1 and I would like to have the double-arrowed icon on the title bar of my window like other Mac apps.
I created a QtQuick 2 Application project and the default code doesn't make this button appear.
I noticed that QtQuick 2 UI default project shows this button.
I really don't understand why. Is there someone who can help me ?
Thanks a lot for your answers,
jnconte.
I don't have experience with qtquick, but if it's the same project file as Qt, you would create the icon (icns file) and add it to the project file like this: -
ICON = images/icon.icns
The icon.icns file, in this case, is in a folder called images, relative to the project file.
In a simple Qt application starting like this:
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
app.setWindowIcon(QIcon(":/qapp/appicon.ico"));
...
we set the icon in the second line (this line and icon file in resources is the only difference between my test program and application generated by Qt wizard). This application works perfect on Windows XP, but on Windows 7 we can't see our icon in top-left corner of the window (system shows default icon instead of my appicon.ico).
Configuration of developer's computer:
Windows XP-SP3,
Qt 5.1,
MSVS2010-SP1.
UPDATE:
Operating system of developer is Windows XP, so we have temporary answer. When we compiled this application on computer with Windows 7, the problem disappeared (application shows the icon correctly on WinXP and Win7). So now we have to compile releases of this application on Windows 7. But it does not looks like perfect solution.
Do you have any ideas, how to solve this problem better?
Similar question is .ico icons not showing up on Windows.
Solution is simple:
create directory imageformats in application dir,
copy qico.dll in it.
Without this plugin QIcon can't read .ico files. So the problem was not in Windows 7 and Windows XP. The problem was in default paths variables on different computers.
My guess is you've got to create a resource file windows_icon.rc with the following content:
IDI_ICON1 ICON DISCARDABLE "images/app-icon-48.ico"
and add this line to your app's .pro file:
RC_FILE = windows_icon.rc
This is the way you set the app icon on Windows (the one that becomes the icon of the exe-file)
I am using Visual Studio 2010 Ultimate. I created a new MDI Application, with Tabbed Documents, Document/View Architecture Enabled, Project Style MFC Standard and all other default options in the MFC Application Wizard. The View of my Application derives from CFormView. I add a CRichEditCtrl in the View using the Resource Editor. When, I run this application, I get an error showing a message box "Failed To Create Empty Document". However, everything runs fine for all other controls. Please Help!!
Make sure that you initialize rich edit libraries.
Insert AfxInitRichEdit or AfxInitRichEdit2 (if using Rich edit control ver. 2.0) call.
Both are loading appropriate version of the for you RICHED20.DLL (ver2.0) or RICHED32.DLL.
The best place to place this call is App's InitInstance.
add the this code in .h file:
DECLARE_DYNCREATE(YourClassName)
and add this code in .cpp file:
IMPLEMENT_DYNCREATE(YourClassName)
to replace DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC if they were there.