BOOL FileExists(const char* pszFile) { WIN32_FIND_DATA fStruct; HANDLE hFile = FindFirstFile(pszFile, &fStruct); if(hFile == INVALID_HANDLE_VALUE) return 0; FindClose(hFile); return 1; }
BOOL ExtractCmdLineFile(char* pszCmdLine) { char *c = strchr(pszCmdLine, '"'); if(c) strcpy(m_szFile, c + 1); else strcpy(m_szFile, pszCmdLine); if(c = strchr(m_szFile, '"')) *c = 0; return FileExists(m_szFile); }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hbidon, PSTR szCmdLine, int iCmdShow) { if(szCmdLine[0]) { if(!ExtractCmdLineFile(szCmdLine)) return 0; if(!bnuGetMetafile()) { MessageBox(0, "Impossible de charger le métafichier", szAppName, MB_ICONEXCLAMATION); return 0; } } etc.... }
BruNews, ciao...
|