How to find if an document can be OPENed via ShellExecute?
问题 I want to check if a particular file can be successfully "OPEN"ed via ShellExecute, so I'm attempting to use AssocQueryString to discover this. Example: DWORD size = 1024; TCHAR buff[1024]; // fixed size as dirty hack for testing int err = AssocQueryString(0, ASSOCSTR_EXECUTABLE, ".mxf", NULL ,buff , &size); openAction->Enabled = ((err == S_OK) || (err == S_FALSE)) && (size > 0); Now, this almost works. If there's a registered application, I get the string. But, there's a catch: On Vista,