[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Open With Dialog

Posted on 2000-05-12
6
Medium Priority
?
403 Views
Last Modified: 2010-04-04
Hi All!

There is an dialog in Windows called 'Open With'. It is not supported by Delphi and there is no information about it into MSDN. My question: How to use this dialog in my application in order to give user a way to open document thru this dialog for choosing application.

Jo.
0
Comment
Question by:Fatman121898
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:shenqw
ID: 2803817
listening
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 2803924
Fatman

I seem to remember playing with this a while ago, but never really got anywhere, one place to look is the IShellBrowser ot IShellExecute I think it was there that I saw related stuff to the IContextMenu etc...

Hope this helps a little...

Later
BoRiS

0
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 2806001
HI,
you can use it from url.dll
example:


unit UrlAPI;
 
interface
 
uses Windows;
 
function URLAssociationDialogA(
hwndParent: HWND;
  dwInFlags: DWORD;
  pcszFile: PAnsiChar;
  pcszURL: PAnsiChar;
  pszAppBuf: PAnsiChar;
  ucAppBufLen: UINT  ): Integer; stdcall;
 
function URLAssociationDialogW(
hwndParent: HWND;
dwInFlags: DWORD;
  pcszFile: PWideChar;
  pcszURL: PWideChar;
  pszAppBuf: PWideChar;
  ucAppBufLen: UINT ): Integer; stdcall;
 
function URLAssociationDialog(
hwndParent: HWND;
  dwInFlags: DWORD;
  pcszFile: PChar;
  pcszURL: Pchar;
  pszAppBuf: PChar;
  ucAppBufLen: UINT ): Integer; stdcall;
 
 
const
url = 'url.dll';
URLASSOCDLG_FL_USE_DEFAULT_NAME  = $0001;
URLASSOCDLG_FL_REGISTER_ASSOC    = $0002;
 
implementation
 
function URLAssociationDialogA; external url name 'URLAssociationDialogA'; function URLAssociationDialogW; external url name 'URLAssociationDialogW'; function URLAssociationDialog; external url name 'URLAssociationDialogA';
 
 
end.





unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,   StdCtrls, UrlAPI;

type
  TForm1 = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
hwndParent : integer;
  dwInFlags : dword;
pcszFile : string;
pcszURL : string;
  pszAppBuf : array[0..255]of char;
  ucAppBufLen : integer;
begin
with opendialog1 do begin
  if (execute) then begin
  hwndParent := self.handle;
  pcszFile := filename;
  //pcszURL := 'file://c|/windows/notepad.exe';
  pcszURL := 'file://C|/Program Files/Microsoft Office/Office/excel.exe';
  ucAppBufLen := sizeof(pszAppBuf);
  URLAssociationDialog(
    hwndParent,
    URLASSOCDLG_FL_REGISTER_ASSOC,
    pchar(pcszFile),
    pchar(pcszURL),
    @pszAppBuf,
    ucAppBufLen);
  end;{if}
end;{with}
end;

end.



Regards Barry
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:ptmcomp
ID: 2806065
On WinNT4 and Win95 that was just a DLL call (you found it in the registry (look for "open with" and what's written in it's command line). But now (on W2k) this is a COM interface and I don't know how to get that.
Regards, ptm.
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 2806068
When you have found it, please put the line here. I'll test it on Win2k.
0
 
LVL 1

Author Comment

by:Fatman121898
ID: 2813987
It works. Thanks, Barry!
Ptcomp, Barry found it.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question