|
Okay, I don't have any problem with the Registry API functions, I've used them before.
I just expected that ShellAPI would be a more conventional way to do this; something similar to what is done with setting desktop icon colors, where we start with:
HWND hwnd = FindWindow("Progman", "Program Manager");
hwnd = FindWindowEx(hwnd, NULL, "SHELLDLL_DefView", "");
hwnd = FindWindowEx(hwnd, NULL, "SysListView32", NULL);
[ error handling omitted for clarity ]
to gain access to elements under Program Manager...
For one thing, the ShellAPI process would eliminate issues with permissions, which I might have with Registry access..
Anyway, I'll look into the links you've mentioned, and try those out.
|
|
|
|
|
If you depend on your application code making those changes, your app would have to run first before being able to use the Explorer context menu. Your code would also have to remember to remove those changes when it closes or upon uninstall.
Doing it through registry pokes eliminates those problems and makes them permanent until uninstall, which can be handled entirely in the installer, not your code.
|
|
|
|
|
That's a good point...
for most situations that I'm thinking of using this tool, I wouldn't be removing the link once it was installed; it would be for situations such as "open this file in MyEditor", or "run MyUtility on this folder"... but yeah, initially creating the link has to be considered, in either case; My plan was to check for existence of my link when running the program, likely in WM_INITDIALOG.. if it's not there, create it.
I mostly write small utilities, so don't always use a dedicated installer...
|
|
|
|
|
In that case, add command line switch support for installing your context menu items and removing them.
|
|
|
|
|
Hi
I have an ownerdraw combobox I populate the entires thru the Drawitem method.
When I click on the dropdown icon I can see the entries formatted in the right font
However when I move the mouse over an item they start to disappear
Hard for me to debug this because when I make a break point on Drawitem it goes thru the code after tracing the code and going back to the combo box the listbox hasn't dropped down
This behavior only happens when I have a breakpoint on the Drawitem method
Other wise when I remove it the listbox displays and I can see all the entries I added
thanks
|
|
|
|
|
If you are interrupting the drawing process then that is probably what you would expect to see. The system erases the background and then expects your code to draw the entries. But if the drawing is prevented from happening it will show empty space.
|
|
|
|
|
I had the following lines around my draw
SendMessage(pdi->hwndItem, CB_GETLBTEXT, pdi->itemID, &text[0]);
DrawText(pdi->hDC, (LPCTSTR)&text[0], -1, &pdi->rcItem, nFormat);
Not sure when you click the dropdown ICN that you get ODA_SELECT and/or ODA_FOCUS
Thanks
|
|
|
|
|
You can use TRACE to see the exact value(s) of itemAction member.
|
|
|
|
|
I am not sure that you should be using CB_GETLBTEXT to get your items for drawing. The usual process for an owner drawn control, is that you would have your list of items somewhere in your application. However, it is some while since I have done this so would need to review my code.
|
|
|
|
|
My process is that I do Addstring with values I have
Then when clicking right icon dropdown on the combo box The Drawitem exit is invoked, allowing me to format that string with font, the rcitem RECT member has Dimensions from the MeasureItem exit
the problem is at the end of stepping thru DrawItem the listbox remains intact non displayable.
Victor Suggested I use TRACE have to look into that
Thanks
|
|
|
|
|
Hi
I need to detect BackSpace as well as Delete Key in a Edit Box placed on Dialog Box in a Dialog based Application. The Problem is that Edit Box has no more Events like WM_CHAR, WM_KEYDown and WM_Key Up.
Thanks
|
|
|
|
|
|
I want to start learning C++ and create kind of windows applications like what is made in C# and WPF. I have three options: VS 2022, Code::Blocks, and QT creator 6. Which one is good for developing elegant windows applications? 
modified 29-May-22 13:56pm.
|
|
|
|
|
I will address the question in the title. There`s only one IDE left (for 10 years now) so it`s not like you have too many options.
|
|
|
|
|
Is Code:Blocks good for this purpose? Can I create elegant GUIs using it?
|
|
|
|
|
I had to look up Code::Blocks and noticed that it incorporates wxWidgets. I don't develop GUI apps, but when I looked into the area a while ago, I bookmarked wxWidgets so I could return to it if I ever needed to. C++ doesn't have a GUI library, so you have to find one. And if you want to support different platforms, not just Windows, you need something like wxWidgets, not WPF.
As far as an IDE goes, VS2022 (Community Edition) is free and an excellent IDE. You can probably develop using wxWidgets within VS2022, but you'd likely have to spend some time configuring it, whereas Code::Blocks looks like it should work immediately. But I know next to nothing about this, so you need to get input from someone who does.
|
|
|
|
|
|
Perhaps poorly worded. Not part of the C++ standard, in the same way that it doesn't have sockets.
How many platforms does Windows Controls support?
|
|
|
|
|
I take your points. But C# does not have those features either, as part of the standard. The libraries are implemented in the same way that the Win32 or MFC libraries are.
Yes, Windows controls only work in the Windows OS.
|
|
|
|
|
Is it possible to have relative element position in C++ GUI (using visual studio) like what we have in WPF?
|
|
|
|
|
No, you have to do the layout calculations yourself. And TBH if GUI applications are your main focus then I would suggest you stick to .NET with C# or VB.NET.
|
|
|
|
|
I'd only heard of VS2022, so I had to do a search on the others. I assumed that your response meant that the others were no longer in business, but they still seem to be undergoing development.
|
|
|
|
|
When your project is causing you enough headake on its own, last thing you want is errors because of a buggy IDE/compiler.
There is no serious match for VS from what I know.
|
|
|
|
|
Qt Creator is worthwhile ONLY if you embrace Qt. Qt is great but is like its own OS. I still vastly prefer Visual Studio and so did my Qt development with it. Had I ported my last app to Linux, only then would I use Qt Creator.
Don't bother with Code::Blocks. It's adequate for Linux but a waste of time for Windows. Moreover, for Linux CLion is vastly superior.
|
|
|
|
|
Visual Studio is always the best choice for creating Win32 GUI applications as it integrates all the tools you will need. It also includes a simple template to create your first GUI program (although it is a bit clunky). And the standard Windows Controls - Win32 apps | Microsoft Docs[^] cover most control types you are likely to need.
|
|
|
|