Windows Shell Context Menu recreated with qt - api

Is there a way to query from qt the entries of the shell context menu (name and command)? Only if the application is run on Windows of course.

This is very similar to this question, basically SHParseDisplayName+SHBindToParent to get IShellFolder, then call GetUIObjectOf on that to get IContextMenu. That is the "native" way to do it, not sure if qt has any wrappers you can use.

Related

How can I set a wait cursor for potentially long running custom actions in wix?

I have an installer built with wix that works well - except that one of my Custom Actions can potentially take a long time. To make my install kit more user-friendly, I'd like to change the mouse cursor to a spinning hourglass (or something similar) while the Custom Action completes. How can I achieve this?
Unless there are new features in WIX, I think the way to achieve this is with a custom progress bar. This is a little more involved to get working than you might think.
Here is a thread I would read in its entirety: How to interactive a silently installing msi? (Progress data and cancel it)
And here is a direct link to source code for an external progress bar as well as other, similar code for Windows Installer use: http://sourceforge.net/projects/msiprogramming/files/msiprogramming/ . This code looks OK, but somewhat dated. You may have some updating to do.
Make sure to try the MSI command line builder from Wise - it helps a lot to forget the command line issues as a source of errors when you try your coding.

Porting CLI/GUI Windows program to OS X

I have a Windows program that has a GUI which also uses a command line interface (a cmd Window) as a debugging console. Basically, when it is double clicked, it launches a command line window and then the program creates all the GUI windows. Then you'd have two Windows: the main GUI and a debugging console.
I'm trying to port this pogram to OS X. Because OS X (and all Unix OSs for that matter) doesn't automatically launch a command line window when you run a command line application. So, I obviously need another way to port this application.
My initial thought was simply to import the source code into a XCode project, redirect standard input and output and then port the GUI. The GUI and console would run side by side just like in Windows. I don't think this is the most optimal solution since that would mean I'd essentially have to write a terminal emulator.
My other thought would be to port the application as a command line application which creates its GUI just like in Windows. The application would then have to be run from Terminal.app which could handle all the I/O. Unfortunately, I don't think you can use the Cocoa framework without using a NSApplication loop.
Any ideas how I could approach this?
You can of course create a run loop from a terminal-launched app. But that generally isn't what you want to do.
It sounds like on Windows, the CLI is just being used as a shortcut to creating a real debugging console window. So the simplest answer is to create a debugging console window. It's pretty easy to create a window which contains just a multi-line text or list view. (If you want something fancier, consider borrowing code from iTerm2 or other open source projects instead of trying to build a complete terminal.) If your debug information is being printed with some fancy macros, just change the macros to log to your list view.
If you're directly doing something like fprintf or syslog to do your logging, it might be simpler to create a wrapper app that launches the main app, and the wrapper creates the debugging console window and displays the main app's stdout and/or stderr. (This might be as simple as using popen.)

Can you attach a drawer to another application in Cocoa?

Is there a way for one Cocoa application to attach drawer-like windows to another application? We might for example want a terminal drawer that followed around a particular Finder window.
There is a program called DTerm that opens little transparent windows over Finder windows, but one might prefer persistence.
You may want to checkout SIMBL. It allows you to write nifty bundles that are loaded into the application your targeting. If you go along with it I'd reccomend using class dump to gather more information on the application your working with (although Im not sure it would work with Finder)

possible to modifer the properties of windows in Objective C?

These are windows besides those that belong to the application. For example, how could I change the title of an open application, for example, TextEdit
You could use mach_inject and mach_override to load code into the target application and then simply use the Objective-C API's to access the window.
You could also try using applescript, but no idea if or how that is done.

Adding an item to the system context menu

How do you add an item to the system context menu? I would like to let my users be able to right click anywhere and launch this program. I cannot seem to find it documented anywhere either.
Thanks for your help!
I am coding in vb.net
What you're looking for is creating a Shell Extension Handler for Windows Explorer.
Reference: http://msdn.microsoft.com/en-us/library/bb776881(VS.85).aspx
Unfortunately doing this in a .Net application is a bit of a problem due to the way in which the CLR is loaded for COM plug-in style extensions. Raymond did a great job of exploring this problem here
http://blogs.msdn.com/oldnewthing/archive/2006/12/18/1317290.aspx