How to hide an application based on the NetBeans Platform? - user-interface

I'm not referring to a GUI-less application. I'm trying to have an application based on the NetBeans platform as a System Tray application. I was able to do the System Tray part quite easy but I'm having issues trying to figure out how to Hide/Show the GUI. I'll keep looking in the API meanwhile.
Any ideas?

WindowManager.getDefault().getMainWindow().setVisible(true/false) should work to hide and show the entire GUI, unless it has multiple windows (pure Swing Frame.getFrames() should give you all JFrame based windows, if that helps).
Not sure if that will solve the problem if you want the main window hidden on startup (but if it is a very simple UI, as is true of many tray apps, you might be able to just work with a dead-simple implementation of WindowManager such as WindowManager.Trivial and leave out the standard NetBeans windowing system entirely).

Related

How can I integrate with a Windows application which lacks a plug-in architecture?

I need to make minor modifications to a legacy Win32 application, but have no access to the original developer or source code. The application was not designed to be extended by third parties. What are my options for doing this?
The changes required are not extensive: I need to launch an external application when a specific text label is clicked.
Is it possible to access and modify the controls in the target application from an outside application?
What you are asking for can be accomplished by either using a SetWindowsHookEx() hook, or subclassing the label directly, to detect when the label is clicked. Your hook/subclass can then launch the external process.
If you need to react when a text is clicked, you could try to use the Microsoft UI Automation technology, and in this case, UI Automation Events.
Note that depending on how the application is written, it may or may not work.
You can try the cool Inspect and Accessible Event Watcher tools at least to check if its seems feasible.

How to edit Windows 7 logon screen and general UI

Is there a way to create a custom Windows 7 logon screen and UI? I don't mean just customizing the picture, I mean something in the sense of a flash splash screen on a website. And then having the whole UI customized in the sense that, instead of a start button, I have can have like... a plus sign that opens up a customized start menu.
Is there anything in the Windows GUI library that will enable this? I know quite a few languages except for assembly, not sure if it would require that anyway.
In other words, if you go to www.sony.com you see how it loads up? Is that possible in a Windows environment? If not, where or how could I do it in another environment? Thanks!

Start external exe within own process

I have a VB6 executable we use as a Starter executable for our real program.
The problem is that windows 7 shows a new icon in the taskbar for the new process, instead of the one i clicked on to start my program (of course, because the starter exe has already ended, and the new exe seems to be a new program).
Currently I use the Shell object to start the other exe. Is there a better way to do it from vb6, maybe by using a native C function with declare that does start an exe in the current process, without spawning a new process?
EDIT:
Thanks to atzz for the great information about Application Model IDs. I now have a shortcut to my app starter with a well defined id, and my app also sets the ID when started, and is now accesssible beautifully from the right icon in the toolbar. However, two problems persist:
The app is a Java App started with Exe4J, and I don't have any chance to set the AppID before Exe4J shows the splash screen, so while showing the splash screen there is a second icon in the taskbar.
If I don't manually drag my starter app icon from the Desktop to the toolbar, but instead use my apps icon and set it to be "sticky", the real app is sticked, and not the launcher.
Both problems would be beautifully solved if my launcher would start the app from within its own process. I heard something of using exec() instead of fork() for linux programs to achive this... is there something similar for windows?
I believe there is a way to accomplish what you need via Windows 7 taskbar API, though I never did it myself and thus don't remember clearly enough what I've read on the subject. Look around the Application ID concept.
Some links:
Developing for the Windows 7 Taskbar – Application ID
Inside Windows 7 - Introducing The Taskbar APIs
If the problem is the icon, why not give both programs the same icon (and the same App.Title). Then the user won't be able to tell the difference between the two taskbar entries. Presumably they aren't both visible at the same time.
Alternatively set your starter app not to appear in the taskbar (Form property ShowInTaskbar = False in the design view)

Desktop app noob question: best cross-platform library that can listen for window-change events (focus, lose focus, etc)?

I've only ever done server, web, and database programming, never any desktop programming. I now want to learn and have a small project I want to attempt, but am not sure which library/framework to use.
I'd like to create a small cross-platform app that runs in the system tray (and whatever the OSX equivalent is), and listens for changes to windows on the Desktop. Specifically:
Windows XP, Vista, 7, Gnome, KDE, OSX. BSD, Android, and/or iOS would be nice too but not required.
Listens for when any window gains focus, loses focus, is opened or closed, or if the window title changes (for example when switching tabs in a tabbed browser). Any other information it can scrape from the window would be useful as well.
Can store these events, preferably in an embedded database like SQLLite.
The lighter-weight the better.
Includes an options GUI accessible via a right-click menu from the system-tray icon.
Preferably FOSS, but if you know any non-FOSS please list too.
Is there a single library or framework that can do all that across multiple platforms? QT? Python? Java? Something else? TIA.
Almost any GUI framework can easily let you know when your own application gains or loses focus (or the other operations you mention). However, listening for these events for other arbitrary applications is definitely platform-specific and may or may not even be possible.
One framework for doing this on Windows is the CBT callback hook. See the question CBT Hook not working in Windows Vista for information about possible limitations on using this technique.

new Windows 7 systray - how to show information to users now

new Windows 7 hides systray icons by default.
what is the recommended way to show information to users now?
I need to have a small clickable icon visible to user so user can access my "tool" anytime. Should I use the gadget to show my GUI instead? Can it communicate with my Delphi app somehow?
Without more information it's a little difficult to provide a recommendation.
However, I would imagine that a sufficiently important tool, the user would simply keep minimized. They could then use Jumplists to access quick functionality.
For example, Live Messenger uses this setup on Win7.
If your users really like your icon/application they can always choose to not hide your application.
The only difference is that only the user can choose which icon is shown, instead of every application claiming it's "real estate".
In my opinion this is a good functionality and if I were you I wouldn't change the application, just provide a first run GUI which explains how to make your tray icon visible in windows 7.
The entire reason why change was made, was to stop programs like yours. If you need to show information, go ahead and do so. But the notification areas ("systray") is not where shortcuts go. For that, you've got the start menu, desktop and/or the quick launch bar (and please let the user decide).

Resources