Custom preview for open dialog using Delphi - delphi

I need to preview several CAD formats in the file open dialog box in Windows 7 / Vista. In the past I used a Delphi Preview Open Dialog and I could register and implement the CAD format that I had to preview. I have found some articles on how to create a preview handler in Vista, this is unfortunately not going to work for me. What I would like to know if there is a way that I can get hold of the IPreviewHandler interface of the dialog that I have created

I've searched about these before, but I couldn't find exact solution.
I found that Microsoft offers the IFileDialogCustomize interface to modify new file dialogs for vista or later.
According to this article, we can't add any custom controls like as XP or before, and the controls we can add are very limited as below.
The provided controls are:
* Menu
* Button
* Combo box
* Radio button list
* Check button (check box)
* Edit
* Separator
* Label
If there's no other interfaces provided from MS, we can't properly extend the file dialog.
I think the things we can provide at this time is:
open custom window on the side of the file dialog.
Have you ever used IrfanView ? If you save image as png or jpeg format, IrfanView shows option setting window on the right side of the save dialog(below one is customized in traditional way, but perhaps we can do similar with new dialog).
alt text http://img208.imageshack.us/img208/9128/irfanviewsaveas.png
mimic new dialog using shell controls & some new custom controls
It's probably not so good because perhaps we can't find enhanced tree control on the left side, but with rkSmartPath we can mimic new path bar as below.
(I think it's great work!)
If someone implement mimic control of Windows 7's new place bar/tree using virtual tree view or something, we could provide good customized dialog. (even for XP users.)
# I think it's chance for component vendors to develop solution for this problem...
# It's a gift from Microsoft for you! :-)

Related

How can I change the textbox (Edit) in a Find dialog to a Combobox in Delphi?

I currently use a standard TFindDialog in my Delphi application:
How can I change the textbox to a combobox? I'd like to set it up so that the user can easily see and select from the history, like this:
I currently use a standard FindDialog in my Delphi application.
How can I change the text box to a combo box?
You can't, at least not with TFindDialog, as it does not allow the use of a custom dialog template (the underlying FindText() API does, though).
However, there is another workaround for your situation...
In the TFindDialog.OnShow event, use FindWindowEx() to manually find the HWND of the Edit field in the dialog, and then use the Shell's IAutoComplete interface to enable a drop-down list on that HWND. You can write a class that implements the IEnumString interface to provide the entries that you want to appear in that drop-down list (for instance, by wrapping a TStringList that you store your entries in).
See MSDN documentation for more details:
Using Autocomplete
How to Enable Autocomplete Manually
Also see:
This answer to Google like edit/combo control for Delphi?
This answer to Auto append/complete from text file to an edit box delphi
This answer to How to use IAutoComplete together with TStringsAdapter?

how to create a window in firefox that looks like "lookup" window in mac os

I am trying to design a firefox extension which shows some information for the selected word in the page.
for those information I like to have a window with no boarders and with a pointer pointing to the selected word. something like this picture (lookup feature in mac os):
sample1
here is another example from firefox itself:
sample2
any idea on how I can create this kind of windows is highly appreciated.
I think you're looking for a Panel to do this and you could likely use the Selection module as well to work with the text. However you'll find it a little challenging to get your panel to point to the text like you want, currently the Panel doesn't easily support positioning like that.

Capturing folder path from Windows Explorer

I would like to add to a Delphi application a way for the user to call Windows Explorer (possibly using something like ShellExecute, perhaps).
However, and this is where I need some help, please, the application would need to capture ^H^H^H^H^H^H read the folder path that the user navigates to while within Windows Explorer.
Is it possible to obtain this information from Windows Explorer?
[edit: If not possible, or unrealistic, my fallback plan is to provide a separate "Browse for folder" button, to allow the user to select the folder first, then they can launch the Window explorer afterwards].
Thanks for any advice.
PhilW.
I dont know your exact needs, but most likely, this is not the way to go. For details, Microsoft developer Raymond Chen has written a blog post about this. What you should do, I think, is to embed an explorer browser control in a custom form in your own application.
For letting a user browse to and select a folder, I use TOrtusShellBrowseFolder.
Ortus Shell Components
Can't you just use the TOpenDialog? From Delphi Help:
Description
TOpenDialog displays a modal Windows dialog box for selecting and opening files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Open, the dialog closes and the selected file or files are stored in the Files property.
if OpenDialog1.Execute then
filename := OpenDialog1.FileName;

How to retrieve the file previews used by windows explorer in Windows vista and seven?

I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer.
I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the user chooses to view "big icons". Is there a way to retrieve that preview?
MyTImage := GiveMePreviewForFile('C:\Test\File.pdf');
#user193655, using the IExtractImage interface is the way to go, this interface exposes methods that request a thumbnail image from a Shell folder
you can find a very complete sample in this site and the source code is here.
check this image
Take a look at the docs for IExtractImage. Basically you use IShellFolder with IExtractImage to get the picture you are looking for.

Download a static file in Silverlight 3 without using SaveFileDialog

I have a Silverlight 3 app that that will let users download PDF files of static content. The problem is that the SaveFileDialog in Silverlight 3 does not allow you to specify the default filename that appears in the dialog box. This means that users have to type the name themselves and this is confusing for them since they are accustomed to a "simple" save dialog which only asks them to either Save or Cancel. All users are using IE7 or IE8.
I've tried to find a solution by the following methods:
Open the file new window using HtmlPage.Window.Navigate hoping to prompt a download (which obviously fails since it opens the file in a new window)
Using the SaveFileDialog (which we don't want to use for the aforementioned reason)
How can a file be downloaded in Silverlight such that a user-initiated save dialog only gives users the option to Save/Cancel instead of prompting to type a file name?
This is a well-known issue with SL3 SaveFileDialog. Unfortunately, there is currently nothing on the horizon that says it will get fixed other than someone at MSFT saying something to the effect of "if we have some time, we'll fix it for SL4". There is a bit of a riot by developers over at http://forums.silverlight.net/forums/p/117702/265216.aspx.
Did you try setting the default extension on the SaveFileDialog? See MSDN documentation: http://msdn.microsoft.com/en-us/library/system.windows.controls.savefiledialog.defaultext%28VS.95%29.aspx

Resources