How do I add recent items to my program's jump list on the Windows 7 taskbar? - delphi

I'm using Delphi XE and would like to add "recent items" in the Windows 7 taskbar jump list for my application, like when right-clicking on Microsoft Word brings up recently opened documents.
I've found information on how to set the progress but nothing on jump-list items. Any help would be greatly appreciated.

This will happen automatically if, for instance, you only use the standard Windows file dialogs. At least my text editor, Rejbrand Text Editor, has got such a MRU list by Windows. It lists all files I have recently edited using Rejbrand Text Editor, even though I have not written any code at all for it.
I think that Windows observes the files you
open and save in your application by means of standard Windows file dialogs
open in your application by starting yourapp.exe <file name>, for instance by double-clicking a file that opens in your application
and automatically display these in the list.
If you want to control the task bar button and menu programmatically, you can use the Windows API. Delphi-specific examples are found in this blog post.

In my opinion the best way to do this is to make the following simple API call:
SHAddToRecentDocs(SHARD_PATH, PChar(FileName));
This not only deals with Windows 7 jump lists but also adds your file into the system's list of recently used documents which has an effect on early versions of Windows too.
Call the function whenever you open or save a file.
For your convenience, a link to the documentation of SHAddToRecentDocs().

Here are some resources that I have found useful when making my programs vista ready
http://code.google.com/p/theunknownones/wiki/TaskbarListComponents
http://www.installationexcellence.com/articles/VistaWithDelphi/Index.html
http://www.theabsolute.net/sware/delphivista.html

Related

How to write a "child" application in Delphi like Office does?

Office 2016 behaves like an MDI application, although it isn't: if you open many files in Taskmgr.exe there is one EXCEL.EXE process running (tab "Details"):
But there are multiple entries in the tab "Processes" (which actually lists windows):
When I open the first file Excel starts slow. But when I open the second and third file Excel is faster than first.
How to do this in a Delphi program?
Windows' Task Manager unneedingly uses misleading terms to what actually happens:
The tab "Processes" actually lists windows for its category "Apps" and either succeeds in listing multiple windows for one process or doesn't. In older versions of Windows the Task Manager listed the windows this way, already having the suspicious tab title "Applications", but without grouping and associating multiple windows to one process:
The tab "Details" lists the actual processes that run, unbound to how many windows they have or display. In previous versions this tab was titled "Processes":
Which situation do we have? One process displaying multiple windows. This can be accomplished easily just like ages ago: you just ensure only running one instance which handles multiple documents. Does not even need to be a true MDI for that.
What you want on top is, that the Task Manager also groups multiple windows. How does Excel achieve this? Look at your taskbar: for each document a separate button exists, not only one in general for Excel itself. In your Delphi program you must ensure that each window must also appear on the taskbar: How to correctly have modeless form appear in taskbar along with its answer has evaluated many ways of doing so.
In Delphi you program one single application. It will have several secondary windows. The main window and the secondary windows shall have an MDI style.
When the application is started, it first looks if a copy of itself is already running. If not, it simply continues; if a previous copy is running, it sends to it the document (filename) that should be opened and then quits. The previously running application will open the passed document in a new secondary window.
This is the overall way of doing it. If there is something you don't know how to do then please open separate questions for each topic.
Please read the help pages, take the SO tour, read How to Ask, as well as this question checklist.

Which tool can I use for viewing WRX files?

I'm working with Progress-4GL, release 11.6, appBuilder and procedure editor.
While working with OCX components, a WRX-file gets automatically created by the appBuilder. I would like to see the content of that WRX-file.
Currently, I've found this website, which also mentions that Progress IDE should contain such a viewer, but even after checking all Pro*tools, I didn't find any tool.
Does anybody know which tool of the Progress-4GL appBuilder/procedure editor toolchain allows viewing WRX-files?
Thanks in advance
According to Progress Knowledgebase, WRX files contain only design and runtime license keys (if required by the ActiveX Controls) along with any custom property settings that were made to any ActiveX Control in the windows. WRX files do not contain any ABL source or .r code.
If it indeed is an OCX you want to look into you can use the Com Object Viewer.
It can be found a couple of different ways.
Quick Access Search in Developer Studio:
Via Pro*Tools under the Tools menu in the AppBuilder
Once started you can use it to open OCXes and Automation Objects to look at the internal API's of those.
You need to locate the file it's stored in. This could be either by knowledge of it's location or other way. If you add an OCX to a ABL Windows/Dialog program you will see the location of the control there:
Then you can open it in the Com Object Viewer to see methods, events and such and also get some short coding help.

Delphi 10 Seattle do NOT open last used project on start

I'm new to Delphi, coming from Visual Studio it's a simple question (I guess): how do I prevent Delphi 10 Seattle to open last use project(group) when I start the IDE?
I've found some information about the .dsk file and what it does:
The .dsk file records your current settings for:
Desktop layout
Breakpoints
Watch items
Files currently open in the IDE
When you reopen the project later, the .dsk file is read, and your
desktop layout, your breakpoints, and your watches are all restored.
Also, all files that were opened when the project was closed are
opened again, regardless of whether they are used by the project.
I'm fine with that when I open a project. But please do not open it when I start the IDE. Mostly I want to start or open another project than the last one I was working on.
I've searched the options and the internet, but couldn't find a solution. Anyone?
Disable "Project desktop" in the IDE Autosave options (Tools\Options\Envinroment options).
But please do not open it when I start the IDE. Mostly I want to start or open another project than the last one
Granted, I do no have Seattle at hands, I settled in XE2.
But try changing the shortcut.
-np: No welcome page. Does not display the welcome page after starting the IDE. np also stands for No Project. Independently of Environment Options Project desktop the last opened project will not be opened
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/IDE_Command_Line_Switches_and_Options
saving the layout and position of the tool windows like Refactorings,
That is what the "Layout" combo-box on the "Desktop" toolbar does. Unless you want different layouts in different projects. R-click over your IDE's tool buttons or go View|Toolbars menu to turn "Desktop" bar on. Alternatively use View|Desktops menu.

Display all images in a folder using a list view item in Delphi

I am using RAD Studio xe6 and I have a simple Firemonkey form, what I want to do is get all Images that are in a folder and display them in a list for the user to see, is this possible, and if yes how.
Delphi already ships with a sample program which does similar thing that you seek. The sample program is called FireFlow. If you haven't installed sample programs while installing Delphi you can get the sample program from:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.FireFlow_Sample
But othervise what you want to do is first search the specific directory for supported image files. To do this use FindFirst, FindNext.
Then you need to decide how are you going to display these images. Now if you intend to display them inside the listbox controll do check the CustomListBox sample which you can also get from web here:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.CustomListBox_Sample

Delphi 7 - Embedded file open dialog in a form

Does anyone know if it is possible to embed a file open dialog inside your own form?
We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc.
I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components
I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\suggestion
I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest "recreating the dialog with some 3rd party components" but with VirtualShellTools.
VirtualShellTools can be downloaded from this SVN archive.
And here's the google code project page.
(At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.
The places bar is not that difficult to implement using a TListView component set to large icons. The Raize Components library also has some source that would help in this arena.
Just a small note, it's fairly easy to add an auto-completing combobox with SHAutoComplete.
See this article for details.
Maybe this Shell Controls Demo can help you.
Edit: ATM the site seems to be down. The Wayback Machine helps.
Here's the latest download link for the controls involved from the wayback machine:
I would re-create it: it shouldn't take long with the VCL Components. The autocomplete is not hard, and you can get the rest of the data if you look through the windows docs long enough.
You can try and cheat by detecting the tab change and displaying the open dialog as if it were the tab page. You will have to detect the user clicking outside of the dialog (e.g. on a different tab) and prevent it closing until you want to change tabs.
Cheers

Resources