============================================================================= OpenWithDlg()
| 511 | // OpenWithDlg() |
| 512 | // |
| 513 | BOOL OpenWithDlg ( HWND hwnd, LPCWSTR lpstrFile ) |
| 514 | { |
| 515 | DLITEM dliOpenWith; |
| 516 | dliOpenWith.mask = DLI_FILENAME; |
| 517 | if ( IDOK == ThemedDialogBoxParam ( g_hInstance, MAKEINTRESOURCE ( IDD_OPENWITH ), |
| 518 | hwnd, OpenWithDlgProc, ( LPARAM ) &dliOpenWith ) ) { |
| 519 | SHELLEXECUTEINFO sei; |
| 520 | WCHAR szParam[MAX_PATH]; |
| 521 | WCHAR wchDirectory[MAX_PATH] = L""; |
| 522 | if ( lstrlen ( szCurFile ) ) { |
| 523 | lstrcpy ( wchDirectory, szCurFile ); |
| 524 | PathRemoveFileSpec ( wchDirectory ); |
| 525 | } |
| 526 | ZeroMemory ( &sei, sizeof ( SHELLEXECUTEINFO ) ); |
| 527 | sei.cbSize = sizeof ( SHELLEXECUTEINFO ); |
| 528 | sei.fMask = 0; |
| 529 | sei.hwnd = hwnd; |
| 530 | sei.lpVerb = NULL; |
| 531 | sei.lpFile = dliOpenWith.szFileName; |
| 532 | sei.lpParameters = szParam; |
| 533 | sei.lpDirectory = wchDirectory; |
| 534 | sei.nShow = SW_SHOWNORMAL; |
| 535 | // resolve links and get short path name |
| 536 | if ( ! ( PathIsLnkFile ( lpstrFile ) && PathGetLnkPath ( lpstrFile, szParam, COUNTOF ( szParam ) ) ) ) { |
| 537 | lstrcpy ( szParam, lpstrFile ); |
| 538 | } |
| 539 | //GetShortPathName(szParam,szParam,sizeof(WCHAR)*COUNTOF(szParam)); |
| 540 | PathQuoteSpaces ( szParam ); |
| 541 | ShellExecuteEx ( &sei ); |
| 542 | return ( TRUE ); |
| 543 | } |
| 544 | return ( FALSE ); |
| 545 | } |
| 546 | |
| 547 | |
| 548 | //============================================================================= |
no test coverage detected