FindFileAssociation.c

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------------*/
00002 /* INRIA 2007 */
00003 /* Allan CORNET */
00004 /*-----------------------------------------------------------------------------------*/ 
00005 #include <shlwapi.h>
00006 #include "FindFileAssociation.h"
00007 #include "MALLOC.h"
00008 /*-----------------------------------------------------------------------------------*/ 
00009 char *FindFileAssociation (char *ptrFindStr,char *Extra) 
00010 {
00011         char *ptrResult = NULL ;
00012 
00013         if ( ptrFindStr )
00014         {
00015                 char szDefault[MAX_PATH];
00016                 DWORD ccDefault = MAX_PATH;
00017                 HRESULT rc = AssocQueryString (0, ASSOCSTR_EXECUTABLE,ptrFindStr, Extra, szDefault, &ccDefault);
00018                 if (ccDefault)
00019                 {
00020                         if (rc==S_OK)
00021                         {
00022                                 ptrResult=(char*)MALLOC(sizeof(char)*(strlen(szDefault)+1));
00023                                 strcpy(ptrResult,szDefault);
00024                         }
00025                 }
00026         }
00027         return ptrResult;
00028 
00029 }
00030 /*-----------------------------------------------------------------------------------*/
00031 

Generated on Sun Mar 4 15:04:01 2007 for Scilab [trunk] by  doxygen 1.5.1