I use ShellExecute to open files by taking advantage of the file
association. What about files which are not associated with any default app?
Windows bring up the "Open With" window.... I want to do something like
that. Is that an api call?
Thanks,
Mary
When calling ShellExecute you'll get HINSTANCE return value:
// launch the file with its associated application
HINSTANCE hInst = ::ShellExecute(...);
If returned value is greater than 32 - everything is OK. Else check
returned value for error.
// launch "Open With.." dialog
if(SE_ERR_NOASSOC == (int)hInst) {
SHELLEXECUTEINFO se = { 0 };
se.cbSize = sizeof(SHELLEXECUTEINFO);
se.fMask = SEE_MASK_CLASSNAME;
se.hwnd = hParentWnd; // parent window
se.lpVerb = _T("openas");
se.lpFile = pcszPath; // name of the file to open
se.lpClass = _T("Unknown");
::ShellExecuteEx(&se);
}
HTH
Alex
Amazing! That did it!! Thanks very much!!
Mary
Alex Blekhman <tk...@yahoo.NOSPAM.com> wrote in message
news:Ezth5.4488$TT2....@telenews.teleline.es...