ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEnMView mask open any file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
masrnet2006 Posted - Apr 07 2013 : 00:59:27
I want show any file in ImageEnMView to open with other
ex.
open file *. autocad with application autocad and file doc with Microsoft Office Word
2   L A T E S T    R E P L I E S    (Newest First)
masrnet2006 Posted - Apr 07 2013 : 23:16:16
#1588;#1603;#1585;#1575; #1580;#1586;#1610;#1604;#1575;
thank you.
w2m Posted - Apr 07 2013 : 09:01:41
If you mean associate an image displayed in ImageENMView with a document then this will open the document on a double click.
You have to store the filename of the document somewhere, so for this example the document filename is stored in ImageTopText.

function ExecAssociatedApp(const FileName: string): Boolean;
// Executes the application associated with the given file name. Returns true if
// application is started successfully and false if not
begin
  Result := ShellAPI.ShellExecute(0, nil, PChar(FileName), nil, nil, Windows.SW_SHOW) > 32;
end;

procedure TMainForm.Open1Click(Sender: TObject);
var
  iFilename: string;
begin
  iFilename := ImageEnMView1.MIO.ExecuteOpenDialog('','',false,0,'');
  if iFilename <> '' then
  begin
    Caption := iFilename;
    ImageEnMView1.MIO.LoadFromFile(Caption);
    ImageEnMView1.SelectedImage:=0;
    // Store the path to the associated document here
    ImageEnMView1.ImageTopText[ImageEnMView1.SelectedImage].Caption := 'C:\Users\Bill\Documents\Example.doc;
    ImageEnMView1ImageSelect(self, 0);
  end;
end;

procedure TMainForm.ImageEnMView1DblClick(Sender: TObject);
var
  iFilename: string;
begin
  // This will open the image in the associated application
  //iFilename := ImageEnMView1.MIO.Params[ImageEnMView1.SelectedImage].FileName;
  // This will open the associated document 
  iFilename := ImageEnMView1.ImageTopText[ImageEnMView1.SelectedImage].Caption;
  if not ExecAssociatedApp(iFilename) then
    ShowMessage('Unable to execute ' + iFilename);
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html