Taskbar extension (like contacts) - c++

In Windows 10, you can activate different buttons (e.g. task view button, windows ink workspace button, contacts button) by opening the context menu of the taskbar.
This is something different than the classic tray icons, and similar to deskbands (which has been deprecated?).
An example of the contacts button:
How can one achieve this? Is there a API for this? Are there documents available?

I think that you might be interested in Shell Extensions/ Taskbar Extensions - Deskbands, please refer to following web-sides for more informations:
https://learn.microsoft.com/en-us/windows/desktop/shell/taskbar-extensions#deskbands
https://msdn.microsoft.com/en-us/library/windows/desktop/ff468984(v=vs.85).aspx
How to write a shell extension in C++?
https://msdn.microsoft.com/en-us/magazine/dd942846.aspx
Perhaps the Taskbar API of Windows should be helpful in your case. Please note that the explorer.exe would be responsible for loading your extension, so that writing it in C# might have some limitations due to different CLR runtimes loaded.

It's commonly called a tray icon or NotifyIcon.
The official class is still in Windows Forms, if you want to be more modern have a look here on what your options are in WPF.

Related

How to put system icons in menus?

I have run the menu example from Qt and there are no icons on menus, only text. Most apps (like pcmanfm and caja from Ubuntu) have similar icons, so I suppose they are system-wide and not application specific. How could I put icons in menu items? A code sample would be interesting.
To obtain the icons of the systems you must use the method QIcon::fromTheme()
Example:
newAct = new QAction(tr("&New"), this);
newAct->setIcon(QIcon::fromTheme("document-new"));
Qt uses as a backend to freedesktop icon, it has a rule in the names, the updated list of them can be found in the following link
The QIcon::fromTheme() function found in the other answer is unfortunately not portable to Mac or windows. You may have better luck using QStyle::standardIcon().

How to create an Evernote kind of widget for global menu of a MacOS/X desktop using QT?

How to create an application which stays in top of MacOS, something similar to below image. You can see the Evernote elephant icon.
I don't want to use xcode - because my application already built in QT, it has nice GUI, now I wanted to add extended feature something similar to Evernote. If I click on an elephant it will open a dialog box to write notes. In my case- it's a simple event like on/off buttons.
I have tried and created GUI widget apps but how to make one which resides like Evernote app ?
A custom pop up menu like the one pictured can be done several ways in Qt.
QML is the most modern way of making the menu with the customized styling you are looking for.
Apply the appropriate flags to the window/widget so it appears as a popup.
The same effects can also be done in QWidgets, but takes more code and probably will take longer to make. The flags you are looking for will be found under Qt Window Flags and/or under Qt Widget Attributes.
The stock stylings for Qt for different OS's deal mostly with title bars, status bars, buttons, drop downs, etc.
The base styles for Mac can be found here:
http://doc.qt.io/qt-5/gallery-macintosh.html
Once you go to a customized popup, you have to draw all of it yourself... but the native drawing elements in Qt are friendly enough and get you that look you are trying to do.
There are even some tools for exporting from Photoshop or Gimp directly to QML.
http://doc.qt.io/qtcreator/quick-export-to-qml.html
Hope that helps.
You are looking for a tray icon. Qt implements it in QSystemTrayIcon.
Further information
You may take a look at the System Tray Icon Example.
Many StackOverflow posts exist on this topic.
If you already have a program written for Qt, then you can compile and run it under MacOS/X much the same way you could compile it under (whatever OS you're using now). You'll need to install Xcode because Xcode includes the C++ compiler (clang) you'll need in order to compile your Qt program, but you don't have to use the Xcode IDE if you don't want to. Rather, you can either use the QtCreator IDE under MacOS/X, or you can simply open up a Terminal window and do a "qmake ; make" in the directory where your Qt-based program's .pro file is, and build it from the command line that way.
If, on the other hand, your question is actually about how to add an icon to the global menu of a MacOS/X desktop, then I don't think Qt has an API for that, so you'll need to drop down to using one of MacOS/X's native APIs. That will probably involve learning some Objective-C (or Objective-C++, if you prefer), but integrating a bit of Objective-C/C++ into your Qt app is doable with a bit of work.

How can I change the language in AfxMessageBox?

I have an MFC app that uses AfxMessageBox to display message boxes. The app itself lets an end-user to change the user interface language. On the inside it does so by loading resources using LCIDs (or FindResourceEx API.) My issue is that I can't seem to make AfxMessageBox to take LCID to change the language for OK, Cancel buttons, etc. This also affects File and Folder Open dialog windows.
Any ideas how to do this?
PS. This approach must work under Windows XP and up.
According to this SO article, there are no standard functions for this, there's a link to a CodeProject article "Localizing System MessageBox" with source code for a DLL (it's in c# but seems simple enough to be rewritten in C++) which uses Windows Hook so that you can supply your own text for the MessageBox buttons; there's even a suggestion for sizing buttons to the text in the discussion part of the same article.

Make a custom taskbar and shell area for my own custom explorer program?

What I would like to do is to create my own custom explorer instead of windows explorer.exe but I would like to be able to create my own taskbar with the active programs and the shell area with the icons as well.
I looked online for a day and can't find anything out about. My main language is c++ and I am very familiar with the windows api calls, resources, and even extracting resources from dlls as well.
I just don't know how to start with the task bar.
Like I said I want to be able to make my own explorer program for windows with the taskbar and all.
I just don't know where to look or start.
Thank you all :)

Skin a dialog box

I am writing a C++ application and I have a Login Box that's shown in a regular Dialog Box Frame. I see that some people can SKIN the entire dialog box and makes it look really nice. I was wondering if anyone can give me some pointers as to how to do that.
I'd need more details to give you a good answer.
The answer very much depends on which OS you're using and how you're programming your GUI (for example on Windows - plain Win32, MFC, ATL, Qt, Windows Forms, WPF etc etc).
If you're just using the Windows API here's a link to get you started.
http://www.codeproject.com/KB/dialog/skinstyle.aspx
Beware: custom skinning dialog boxes can be a very large task if you want to customise the look of every control as you end up writing very complicated custom controls.
Alternatively do you just want to make sure that your dialogs appear with Windows XP visual style rather than pre-XP style? This will require changes to your application to use the new common controls and visual style. Note that this changes the behaviour of some Windows APIs and can potentially have side effects (see ISOLATION_AWARE_ENABLED).