Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Open a file with its default application when it is double-clicked

 
Subscribe to the RSS feed for this forum  Forum Index -> FolderView ActiveX Control
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Sat Jan 03, 2009 10:53 am    Post subject: HOWTO: Open a file with its default application when it is double-clicked

To execute the default command on a file when it is double-clicked (typically 'open', which opens the file with its associated application), handle the FolderView.NodeDoubleClick event and use the following code in the event handler:

[C++]
Code:
void CFdrViewVCDlg::OnNodeDoubleClickFolderviewctrl1(LPDISPATCH Node)
{
 CTreeNode node;
 node.AttachDispatch(Node,FALSE);
 
if (!node.IsFolder()) // Only execute default command for files
 {
  node.ExecuteShellCommand(cmdDefault);
 }
}


[VB6]
Code:
Private Sub fldrVw_NodeDoubleClick(ByVal Node As FolderViewControl.ITreeNode)

If (Node.IsFolder() = False) Then ' Only execute default command for files
 Node.ExecuteShellCommand CmdTypes.cmdDefault
End If

End Sub
Back to top
Display posts from previous:   
Forum Index -> FolderView ActiveX Control All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group