How to create TitleAreaDialog using WTL or Windows SDK (no MFC)? - c++

I am trying to create a TitleAreaDialog using WTL or Windows SDK (please no MFC).
From the google I am able to find these two links:
http://www.codeproject.com/KB/dialog/dialogheader.aspx (MFC article)
http://www.codeproject.com/KB/dialog/taskdialogs.aspx (doubtful.. how to use it)
The desired output is like the eclipse JFace TitleAreaDialog (see the below image).
Kindly suggest a way to do this using sing WTL or Windows SDK (with c++).
Thanks

Finally able to solve it using the Dialog Header link. Just went through the code twice or may be thrice :) and then ported it for WTL.
There is another very good example in pure c++/win sdk:
xmessagebox. Its about replacing default windows messagebox with something good (although there is a mode which uses title area + icon).
If working for vista or greater and just want to grab very basic information via checkboxes, radio buttons etc then have a look at this: Vista_TaskDialog_Wrapper and VGTaskDialog

Related

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 to create a Window WIN32?

I just wondering how Windows create this window?
I mean what styles applied to that window, I just want these styles on my project.
As info I use MS Visual C++ 2008.
Thanks
There's no easy way! There's no public API for using "the Windows 8 style", or the style of any other release. You'll just have to replicate it by hand, comparing it pixel-for-pixel against a screenshot. Then update your application with the next release of Windows!
Because they change the metrics of these sorts of dialogs with each release, they can't produce a public library for "system-themed dialogs", because Microsoft would then be unable to change the design for fear of breaking someone's application that maybe uses a bit too much text, for example.

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.

wxWidgets create an app that lives on the desktop?

Is it possible, using wxWidgets and C++, to create an application that will show on the desktop? What I mean, is that it would only display on the desktop, like Geektools, Rainmeter, etc.
Not out of the box.
You could try to get the HWND of the Desktop and create your own control in wxWidgets by deriving a class from wxControl or wxWindow and do the Drawing yourself. It is not that hard to do it :). You could even use wxHTMLWindow or wxWebConnect (3rdParty, based on Webkit) for that.
See GetDesktopWindow() for that:
http://msdn.microsoft.com/en-us/library/ms633504(VS.85).aspx
Assuming you are on Windows. You have to check for your WindowManagers Documentation on Linux yourself though. If you are using KDE, I would suggest to use QT directly or the KDE API. Same for Gnome.
It would be easier to use the corresponding os/windowmanager api for that though.
Hope that helps.

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).