L_DlgFilesAssociation

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgFilesAssociation(hWndOwner, pDlgParams)

L_HWND hWndOwner;

owner of the dialog

LPFILESASSOCIATIONDLGPARAMS pDlgParams;

pointer to a structure

Displays the File Association dialog, in order to change file association options.

Parameter

Description

hWndOwner

Handle of the window that owns the dialog.

pDlgParams

Pointer to a FILESASSOCIATIONDLGPARAMS used to initialize the dialog.

Comments

The File Association dialog.

Use this dialog to control how the shell treats certain types of files. This lets you link your application to a certain file type, which causes the application to take ownership of that file type.

The parameters are used as input only and will not be updated by the dialog.

If the function was successful, then file formats will be associated or de-associated accordingly.

The same filter group string can be passed for both L_DlgOpen and L_DlgFilesAssociation because they have the same format.

Returns

SUCCESS_DLG_OK

The "OK" button was pressed, and the dialog exited successfully.

SUCCESS_DLG_CANCEL

The "Cancel" button was pressed, and the dialog exited successfully.

< 1

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDLGFILE
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTFIL
LTDIS
LTIMG
LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_DlgInit, L_DlgOpen

Topics:

Dialogs: Maintenance and General Use

 

Using Imaging Common Dialog

Example

Example 2:

L_INT DlgFilesAssociationExample(HWND hWnd,L_TCHAR*  pszServerName) 
{ 
   L_INT nRet; 
   FILESASSOCIATIONDLGPARAMS DLGPARAMSFileAssociation ; 
   L_TCHAR* pszFormats = 
   { 
      TEXT("LEAD (*.cmp)\0")           TEXT("*.cmp\0") 
      TEXT("DICOM (*.dic)\0")          TEXT("*.dic\0") 
      TEXT("Windows Bitmap (*.bmp)\0") TEXT("*.bmp\0") 
      TEXT("\0") 
   } ; 
   L_TCHAR* pszSelectedFormats = 
   { 
      TEXT(".cmp\0") 
      TEXT(".dic\0") 
      TEXT("\0") 
   } ; 
   memset ( &DLGPARAMSFileAssociation, 0, sizeof ( FILESASSOCIATIONDLGPARAMS ) ) ; 
   DLGPARAMSFileAssociation.uStructSize           = sizeof ( FILESASSOCIATIONDLGPARAMS ) ; 
   DLGPARAMSFileAssociation.pszFormats            = pszFormats ; 
   DLGPARAMSFileAssociation.pszServerAppName      = pszServerName ; 
   DLGPARAMSFileAssociation.pszSelectedExt        = pszSelectedFormats ; 
   DLGPARAMSFileAssociation.pHelpCallBackUserData = NULL ; 
   DLGPARAMSFileAssociation.pfnHelpCallback       = NULL ; 
   nRet = L_DlgInit ( DLG_INIT_COLOR ) ; 
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) 
      return nRet; 
   nRet = L_DlgFilesAssociation ( hWnd, &DLGPARAMSFileAssociation ) ; 
   if(nRet < 1) 
      return nRet; 
   nRet = L_DlgFree () ; 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Common Dialog C API Help