wxString DocumentListCtrl::OnGetItemText (long item, long column) const { int sorteditem = _sortedIndices[(int)item]; int num_docs = _ferretparent->GetDocumentList().Size(); if (num_docs > 0) { int doc1 = _document1 [sorteditem]; int doc2 = _document2 [sorteditem]; int position = 0; if (column == 0) { return GetDisplayName (doc1); } else if (column == 1) { return GetDisplayName (doc2); } else // if (column == 2) { return wxString::Format("%f", _ferretparent->GetDocumentList().ComputeResemblance (doc1, doc2, _remove_common_trigrams, _ignore_template_material)); } } else { return "No items in document list"; } }
void Explorerplusplus::HandleAddressBarText(void) { LPITEMIDLIST pidl = NULL; TCHAR szAddressBarTitle[MAX_PATH]; pidl = m_pActiveShellBrowser->QueryCurrentDirectoryIdl(); TCHAR szParsingPath[MAX_PATH]; GetDisplayName(pidl,szParsingPath,SHGDN_FORPARSING); /* If the path is a GUID (i.e. of the form ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}), we'll switch to showing the in folder name. Otherwise, we'll show the full path. Driven by the principle that GUID's should NOT be shown directly to users. */ if(IsPathGUID(szParsingPath)) { GetDisplayName(pidl,szAddressBarTitle,SHGDN_INFOLDER); } else { StringCchCopy(szAddressBarTitle,SIZEOF_ARRAY(szAddressBarTitle), szParsingPath); } SetComboBoxExTitleString(m_hAddressBar,pidl,szAddressBarTitle); CoTaskMemFree(pidl); }
int CBillReview::OnCreate(LPCREATESTRUCT lpCreateStruct) { int is_business; //CAMqa66752 TCHAR bill_company[GAL_SI_SERVICE_COMPANY_LEN]; GAL_ERROR Error; CString AccountName; if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here // get the account info.... m_sBillRevAccountId = GetDisplayID(); is_business = m_lpAccount->GetIsBusinessCode(); //CAMqa66752 if (is_business) { if(galGetAccount_bill_company(m_lpAccount->m_Account, bill_company, &Error ) == GAL_FAILURE ) AccountName = GetDisplayName(); else AccountName = bill_company; } else { AccountName = GetDisplayName(); } m_sBillRevAccountName = AccountName; return 0; }
void ExeComponent::Wait(DWORD tt) { ProcessComponent::Wait(tt); DWORD exitcode = ProcessComponent::GetProcessExitCode(); LOG(L"Component '" << id << "' return code " << exitcode << DVLib::FormatMessage(L" (0x%x).", exitcode)); // check for reboot if (! returncodes_reboot.empty() && IsReturnCode(exitcode, returncodes_reboot)) { LOG(L"Component '" << id << "' return code '" << exitcode << L", defined as reboot required in '" << returncodes_reboot << L"."); return; } // check for explicit success, where defined if (returncodes_success.empty()) { CHECK_BOOL(ERROR_SUCCESS == exitcode, L"Error executing '" << id << "' (" << GetDisplayName() << L"): " << exitcode << DVLib::FormatMessage(L" (0x%x)", exitcode)); } else { CHECK_BOOL(IsReturnCode(exitcode, returncodes_success), L"Error executing component '" << id << "' (" << GetDisplayName() << L"), return code " << exitcode << DVLib::FormatMessage(L" (0x%x)", exitcode) << L" is not in '" << returncodes_success << L"'"); LOG(L"Component '" << id << "' (" << GetDisplayName() << L") return code " << exitcode << DVLib::FormatMessage(L" (0x%x)", exitcode) << L", defined as success in '" << returncodes_success << L"'."); } }
bool CUDisks2Provider::FilesystemPropertiesChanged(const char *object, DBusMessageIter *propsIter, IStorageEventsCallback *callback) { if (m_filesystems.count(object) > 0) { auto fs = m_filesystems[object]; CLog::Log(LOGDEBUG, LOGDBUS, "UDisks2: Before update: %s", fs->toString()); bool wasMounted = fs->m_isMounted; auto ParseFilesystemProperty = std::bind(&CUDisks2Provider::ParseFilesystemProperty, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); ParseProperties(fs, propsIter, ParseFilesystemProperty); CLog::Log(LOGDEBUG, LOGDBUS, "UDisks2: After update: %s", fs->toString()); if (!wasMounted && fs->m_isMounted && fs->IsApproved()) { CLog::Log(LOGINFO, "UDisks2: Added %s", fs->m_mountPoint); if (callback) callback->OnStorageAdded(fs->GetDisplayName(), fs->m_mountPoint); return true; } else if (wasMounted && !fs->m_isMounted) { CLog::Log(LOGINFO, "UDisks2: Removed %s", fs->m_block->m_device); if (callback) callback->OnStorageSafelyRemoved(fs->GetDisplayName()); return true; } } return false; }
inline VmbErrorType EnumEntry::GetDisplayName( std::string &rStrDisplayName ) const { VmbErrorType res; VmbUint32_t nLength; res = GetDisplayName( NULL, nLength ); if ( VmbErrorSuccess == res ) { if ( 0 < nLength ) { rStrDisplayName.resize( nLength ); res = GetDisplayName( &rStrDisplayName[0], nLength ); if ( VmbErrorSuccess == res ) { size_t nPos = rStrDisplayName.find( '\0' ); if ( nLength-1 > nPos ) { rStrDisplayName.resize( nPos ); } } } else { rStrDisplayName.clear(); } } return res; }
int CALLBACK CShellBrowser::SortByType(int InternalIndex1,int InternalIndex2) const { if(m_bVirtualFolder) { TCHAR FullFileName1[MAX_PATH]; LPITEMIDLIST pidlComplete1 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex1].pridl); GetDisplayName(pidlComplete1,FullFileName1,SHGDN_FORPARSING); CoTaskMemFree(pidlComplete1); TCHAR FullFileName2[MAX_PATH]; LPITEMIDLIST pidlComplete2 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex2].pridl); GetDisplayName(pidlComplete2,FullFileName2,SHGDN_FORPARSING); CoTaskMemFree(pidlComplete2); BOOL IsRoot1 = PathIsRoot(FullFileName1); BOOL IsRoot2 = PathIsRoot(FullFileName2); if(IsRoot1 && !IsRoot2) { return -1; } else if(!IsRoot1 && IsRoot2) { return 1; } } std::wstring Type1 = GetTypeColumnText(InternalIndex1); std::wstring Type2 = GetTypeColumnText(InternalIndex2); return StrCmpLogicalW(Type1.c_str(),Type2.c_str()); }
int CALLBACK CShellBrowser::SortByType(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const { if(m_bVirtualFolder) { TCHAR FullFileName1[MAX_PATH]; GetDisplayName(itemInfo1.pidlComplete.get(),FullFileName1,SIZEOF_ARRAY(FullFileName1),SHGDN_FORPARSING); TCHAR FullFileName2[MAX_PATH]; GetDisplayName(itemInfo2.pidlComplete.get(),FullFileName2,SIZEOF_ARRAY(FullFileName2),SHGDN_FORPARSING); BOOL IsRoot1 = PathIsRoot(FullFileName1); BOOL IsRoot2 = PathIsRoot(FullFileName2); if(IsRoot1 && !IsRoot2) { return -1; } else if(!IsRoot1 && IsRoot2) { return 1; } } std::wstring Type1 = GetTypeColumnText(itemInfo1); std::wstring Type2 = GetTypeColumnText(itemInfo2); return StrCmpLogicalW(Type1.c_str(),Type2.c_str()); }
BOOL CDownloadWithTiger::SetHashset(BYTE* pSource, DWORD nSource) { if ( m_nSize == SIZE_UNKNOWN ) return FALSE; if ( m_pHashset.IsAvailable() ) return TRUE; if ( nSource == 0 && m_bED2K ) { m_pHashset.FromRoot( &m_pED2K ); } else if ( m_pHashset.FromBytes( pSource, nSource, m_nSize ) ) { MD4 pRoot; m_pHashset.GetRoot( &pRoot ); if ( m_bED2K && m_pED2K != pRoot ) { m_pHashset.Clear(); theApp.Message( MSG_ERROR, IDS_DOWNLOAD_HASHSET_CORRUPT, (LPCTSTR)GetDisplayName() ); return FALSE; } else if ( ! m_bED2K ) { m_bED2K = TRUE; m_pED2K = pRoot; } } else { theApp.Message( MSG_ERROR, IDS_DOWNLOAD_HASHSET_CORRUPT, (LPCTSTR)GetDisplayName() ); return FALSE; } m_nHashsetBlock = m_pHashset.GetBlockCount(); m_pHashsetBlock = new BYTE[ m_nHashsetBlock ]; ZeroMemory( m_pHashsetBlock, sizeof(BYTE) * m_nHashsetBlock ); SetModified(); theApp.Message( MSG_DEFAULT, IDS_DOWNLOAD_HASHSET_READY, (LPCTSTR)GetDisplayName(), (LPCTSTR)Settings.SmartVolume( ED2K_PART_SIZE, FALSE ) ); Neighbours.SendDonkeyDownload( reinterpret_cast<CDownload*>( this ) ); return TRUE; }
void CDownload::OnDownloaded() { ASSERT( m_bComplete == false ); theApp.Message( MSG_NOTICE, IDS_DOWNLOAD_COMPLETED, GetDisplayName() ); m_tCompleted = GetTickCount(); m_bDownloading = false; StopSearch(); CloseTransfers(); //AppendMetadata(); if ( GetTaskType() == dtaskMergeFile || GetTaskType() == dtaskPreviewRequest ) AbortTask(); // LibraryBuilder.m_bBusy = true; // ? m_pTask.Copy(); Statistics.Current.Downloads.Files++; SetModified(); }
TSharedRef<ITableRow> FDetailCategoryImpl::GenerateNodeWidget( const TSharedRef<STableViewBase>& OwnerTable, const FDetailColumnSizeData& ColumnSizeData, const TSharedRef<IPropertyUtilities>& PropertyUtilities ) { return SNew( SDetailCategoryTableRow, AsShared(), OwnerTable ) .DisplayName( GetDisplayName() ) .HeaderContent( HeaderContentWidget ); }
void VideoBackend::ShowConfig(void* parent_handle) { if (!m_initialized) InitBackendInfo(); Host_ShowVideoConfig(parent_handle, GetDisplayName(), "gfx_opengl"); }
bool pawsConfigKeys::OnFingering(csString string, psControl::Device device, uint button, uint32 mods) { if (fingWnd == NULL || !fingWnd->IsVisible()) return true; bool changed = false; if (string == NO_BIND) // Removing trigger { psengine->GetCharControl()->RemapTrigger(editedCmd,psControl::NONE,0,0); changed = true; } else // Changing trigger { changed = psengine->GetCharControl()->RemapTrigger(editedCmd,device,button,mods); } if (changed) { SetTriggerTextOfCommand(editedCmd,string); dirty = true; return true; // Hide fingering window } else // Map already exists { const psControl* other = psengine->GetCharControl()->GetMappedTrigger(device,button,mods); CS_ASSERT(other); if (other->name != editedCmd) { fingWnd->SetCollisionInfo(GetDisplayName(other->name)); return false; // Keep fingering window up; invalid combo to set } else return true; // Hide fingering window; combo is the same as old } }
void Explorerplusplus::OnTreeViewSetFileAttributes(void) { HTREEITEM hItem = TreeView_GetSelection(m_hTreeView); if(hItem == NULL) { return; } std::list<NSetFileAttributesDialogExternal::SetFileAttributesInfo_t> sfaiList; NSetFileAttributesDialogExternal::SetFileAttributesInfo_t sfai; LPITEMIDLIST pidlItem = m_pMyTreeView->BuildPath(hItem); HRESULT hr = GetDisplayName(pidlItem,sfai.szFullFileName,SIZEOF_ARRAY(sfai.szFullFileName),SHGDN_FORPARSING); CoTaskMemFree(pidlItem); if(hr == S_OK) { HANDLE hFindFile = FindFirstFile(sfai.szFullFileName,&sfai.wfd); if(hFindFile != INVALID_HANDLE_VALUE) { FindClose(hFindFile); sfaiList.push_back(sfai); CSetFileAttributesDialog SetFileAttributesDialog(m_hLanguageModule, IDD_SETFILEATTRIBUTES,m_hContainer,sfaiList); SetFileAttributesDialog.ShowModalDialog(); } } }
void pawsConfigKeys::UpdateNicks(pawsTreeNode * subtreeRoot) { if (subtreeRoot == NULL) subtreeRoot = tree->GetRoot(); if (subtreeRoot == NULL) return; pawsSeqTreeNode * rootAsSeq; pawsTreeNode * child; pawsTextBox * label; rootAsSeq = dynamic_cast<pawsSeqTreeNode*> (subtreeRoot); if (rootAsSeq != NULL && rootAsSeq != tree->GetRoot()) { label = dynamic_cast<pawsTextBox*> (rootAsSeq->GetSeqWidget(0)); CS_ASSERT(label); psCharController* manager = psengine->GetCharControl(); // Update the name label const psControl* ctrl = manager->GetTrigger( subtreeRoot->GetName() ); if (ctrl) label->SetText( GetDisplayName(ctrl->name) ); } child = subtreeRoot->GetFirstChild(); while (child != NULL) { UpdateNicks(child); child = child->GetNextSibling(); } }
void CDownload::Remove() { AbortTask(); StopTrying(); CloseTorrent(); CloseTransfers(); theApp.Message( MSG_NOTICE, IDS_DOWNLOAD_REMOVE, (LPCTSTR)GetDisplayName() ); IsCompleted() ? CloseFile() : DeleteFile(); DeletePreviews(); if ( ! m_sPath.IsEmpty() ) { DeleteFileEx( m_sPath + L".png", FALSE, FALSE, TRUE ); DeleteFileEx( m_sPath + L".sav", FALSE, FALSE, TRUE ); DeleteFileEx( m_sPath, FALSE, FALSE, TRUE ); m_sPath.Empty(); } Downloads.Remove( this ); }
void Explorerplusplus::OnTreeViewCopyUniversalPaths(void) { HTREEITEM hItem; LPITEMIDLIST pidl; TCHAR szFullFileName[MAX_PATH]; UNIVERSAL_NAME_INFO uni; DWORD dwBufferSize; DWORD dwRet; hItem = TreeView_GetSelection(m_hTreeView); if(hItem != NULL) { pidl = m_pMyTreeView->BuildPath(hItem); GetDisplayName(pidl,szFullFileName,SIZEOF_ARRAY(szFullFileName),SHGDN_FORPARSING); dwBufferSize = sizeof(uni); dwRet = WNetGetUniversalName(szFullFileName,UNIVERSAL_NAME_INFO_LEVEL, (void **)&uni,&dwBufferSize); if(dwRet == NO_ERROR) CopyTextToClipboard(uni.lpUniversalName); else CopyTextToClipboard(szFullFileName); CoTaskMemFree(pidl); } }
/* =================== GLW_ChangeDislaySettingsIfNeeded Optionally ChangeDisplaySettings to get a different fullscreen resolution. Default uses the full desktop resolution. =================== */ static bool GLW_ChangeDislaySettingsIfNeeded( glimpParms_t parms ) { // If we had previously changed the display settings on a different monitor, // go back to standard. if ( win32.cdsFullscreen != 0 && win32.cdsFullscreen != parms.fullScreen ) { win32.cdsFullscreen = 0; ChangeDisplaySettings( 0, 0 ); Sys_Sleep( 1000 ); // Give the driver some time to think about this change } // 0 is dragable mode on desktop, -1 is borderless window on desktop if ( parms.fullScreen <= 0 ) { return true; } // if we are already in the right resolution, don't do a ChangeDisplaySettings int x, y, width, height, displayHz; if ( !GetDisplayCoordinates( parms.fullScreen - 1, x, y, width, height, displayHz ) ) { return false; } if ( width == parms.width && height == parms.height && ( displayHz == parms.displayHz || parms.displayHz == 0 ) ) { return true; } DEVMODE dm = {}; dm.dmSize = sizeof( dm ); dm.dmPelsWidth = parms.width; dm.dmPelsHeight = parms.height; dm.dmBitsPerPel = 32; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL; if ( parms.displayHz != 0 ) { dm.dmDisplayFrequency = parms.displayHz; dm.dmFields |= DM_DISPLAYFREQUENCY; } common->Printf( "...calling CDS: " ); const char * const deviceName = GetDisplayName( parms.fullScreen - 1 ); int cdsRet; if ( ( cdsRet = ChangeDisplaySettingsEx( deviceName, &dm, NULL, CDS_FULLSCREEN, NULL) ) == DISP_CHANGE_SUCCESSFUL ) { common->Printf( "ok\n" ); win32.cdsFullscreen = parms.fullScreen; return true; } common->Printf( "^3failed^0, " ); PrintCDSError( cdsRet ); return false; }
bool pawsConfigKeys::OnButtonPressed(int /*mouseButton*/, int /*keyModifier*/, pawsWidget* widget) { editedCmd = GetCommandOfButton(widget); if (editedCmd.IsEmpty()) return false; fingWnd->ShowDialog(this, GetDisplayName(editedCmd)); return true; }
BOOL CDownloadWithTiger::SetTigerTree(BYTE* pTiger, DWORD nTiger) { if ( m_nSize == SIZE_UNKNOWN ) return FALSE; if ( m_pTigerTree.IsAvailable() ) return TRUE; if ( ! m_pTigerTree.FromBytes( pTiger, nTiger, Settings.Library.TigerHeight, m_nSize ) ) { theApp.Message( MSG_ERROR, IDS_DOWNLOAD_TIGER_CORRUPT, (LPCTSTR)GetDisplayName() ); return FALSE; } TIGEROOT pRoot; m_pTigerTree.GetRoot( &pRoot ); if ( m_bTiger && m_pTiger != pRoot ) { m_pTigerTree.Clear(); theApp.Message( MSG_ERROR, IDS_DOWNLOAD_TIGER_MISMATCH, (LPCTSTR)GetDisplayName() ); return FALSE; } else if ( ! m_bTiger ) { m_bTiger = TRUE; m_pTiger = pRoot; } m_nTigerSize = m_pTigerTree.GetBlockLength(); m_nTigerBlock = m_pTigerTree.GetBlockCount(); m_pTigerBlock = new BYTE[ m_nTigerBlock ]; ZeroMemory( m_pTigerBlock, sizeof(BYTE) * m_nTigerBlock ); SetModified(); theApp.Message( MSG_DEFAULT, IDS_DOWNLOAD_TIGER_READY, (LPCTSTR)GetDisplayName(), m_pTigerTree.GetHeight(), (LPCTSTR)Settings.SmartVolume( m_nTigerSize, FALSE ) ); return TRUE; }
void CShellBrowser::QueryFullItemNameInternal(int iItemInternal,TCHAR *szFullFileName,UINT cchMax) const { LPITEMIDLIST pidlComplete = NULL; pidlComplete = ILCombine(m_pidlDirectory,m_pExtraItemInfo[iItemInternal].pridl); GetDisplayName(pidlComplete,szFullFileName,cchMax,SHGDN_FORPARSING); CoTaskMemFree(pidlComplete); }
TEST(GetDisplayName, Simple) { TCHAR szFullFileName[MAX_PATH]; GetTestResourceFilePath(L"Metadata.jpg", szFullFileName, SIZEOF_ARRAY(szFullFileName)); TCHAR szDisplayName[MAX_PATH]; HRESULT hr = GetDisplayName(szFullFileName, szDisplayName, SIZEOF_ARRAY(szDisplayName), SHGDN_FORPARSING | SHGDN_INFOLDER); ASSERT_TRUE(SUCCEEDED(hr)); EXPECT_STREQ(L"Metadata.jpg", szDisplayName); }
/* Determines the drop effect based on the location of the source and destination directories. Note that the first dropped file is taken as representative of the rest (meaning that if the files come from different drives, whether this operation is classed as a copy or move is only based on the location of the first file). */ BOOL CMyTreeView::CheckItemLocations(IDataObject *pDataObject,HTREEITEM hItem, int iDroppedItem) { FORMATETC ftc; STGMEDIUM stg; DROPFILES *pdf = NULL; LPITEMIDLIST pidlDest = NULL; TCHAR szDestDirectory[MAX_PATH]; TCHAR szFullFileName[MAX_PATH]; HRESULT hr; BOOL bOnSameDrive = FALSE; int nDroppedFiles; ftc.cfFormat = CF_HDROP; ftc.ptd = NULL; ftc.dwAspect = DVASPECT_CONTENT; ftc.lindex = -1; ftc.tymed = TYMED_HGLOBAL; hr = pDataObject->GetData(&ftc,&stg); if(hr == S_OK) { pdf = (DROPFILES *)GlobalLock(stg.hGlobal); if(pdf != NULL) { /* Request a count of the number of files that have been dropped. */ nDroppedFiles = DragQueryFile((HDROP)pdf,0xFFFFFFFF,NULL,NULL); if(iDroppedItem < nDroppedFiles) { pidlDest = BuildPath(hItem); if(pidlDest != NULL) { /* Determine the name of the first dropped file. */ DragQueryFile((HDROP)pdf,iDroppedItem,szFullFileName, SIZEOF_ARRAY(szFullFileName)); GetDisplayName(pidlDest,szDestDirectory,SIZEOF_ARRAY(szDestDirectory),SHGDN_FORPARSING); bOnSameDrive = PathIsSameRoot(szDestDirectory,szFullFileName); CoTaskMemFree(pidlDest); } } GlobalUnlock(stg.hGlobal); } } return bOnSameDrive; }
void Explorerplusplus::OnTBGetInfoTip(LPARAM lParam) { NMTBGETINFOTIP *ptbgit = reinterpret_cast<NMTBGETINFOTIP *>(lParam); StringCchCopy(ptbgit->pszText,ptbgit->cchTextMax,EMPTY_STRING); if(ptbgit->iItem == TOOLBAR_BACK) { if(m_pActiveShellBrowser->IsBackHistory()) { LPITEMIDLIST pidl = m_pActiveShellBrowser->RetrieveHistoryItemWithoutUpdate(-1); TCHAR szPath[MAX_PATH]; GetDisplayName(pidl,szPath,SIZEOF_ARRAY(szPath),SHGDN_INFOLDER); TCHAR szInfoTip[1024]; TCHAR szTemp[64]; LoadString(m_hLanguageModule,IDS_MAIN_TOOLBAR_BACK,szTemp,SIZEOF_ARRAY(szTemp)); StringCchPrintf(szInfoTip,SIZEOF_ARRAY(szInfoTip),szTemp,szPath); StringCchCopy(ptbgit->pszText,ptbgit->cchTextMax,szInfoTip); } } else if(ptbgit->iItem == TOOLBAR_FORWARD) { if(m_pActiveShellBrowser->IsForwardHistory()) { LPITEMIDLIST pidl = m_pActiveShellBrowser->RetrieveHistoryItemWithoutUpdate(1); TCHAR szPath[MAX_PATH]; GetDisplayName(pidl,szPath,SIZEOF_ARRAY(szPath),SHGDN_INFOLDER); TCHAR szInfoTip[1024]; TCHAR szTemp[64]; LoadString(m_hLanguageModule,IDS_MAIN_TOOLBAR_FORWARD,szTemp,SIZEOF_ARRAY(szTemp)); StringCchPrintf(szInfoTip,SIZEOF_ARRAY(szInfoTip),szTemp,szPath); StringCchCopy(ptbgit->pszText,ptbgit->cchTextMax,szInfoTip); } } }
//-------------------------------------------------------------------------------- BOOL CNTService::InstallService() { AFX_MANAGE_STATE_IF_DLL TCHAR szPath[1024]; if(GetModuleFileName( 0, szPath, 1023 ) == 0 ) return FALSE; BOOL bRet = FALSE; SC_HANDLE schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if(schSCManager != NULL) { DWORD nServiceType = GetServiceType(); DWORD nStartType = GetStartType(); SC_HANDLE schService = CreateService( schSCManager, GetServiceName(), GetDisplayName(), GetDesiredAccess(), nServiceType, nStartType, GetErrorControl(), szPath, GetLoadOrderGroup(), ((nServiceType == SERVICE_KERNEL_DRIVER || nServiceType == SERVICE_FILE_SYSTEM_DRIVER) && (nStartType == SERVICE_BOOT_START || nStartType == SERVICE_SYSTEM_START)) ? &m_dwTagID : NULL, GetDependencies(), GetUserName(), GetPassword() ); if(schService != NULL) { CloseServiceHandle(schService); bRet = TRUE; } CloseServiceHandle(schSCManager); } if(bRet) // installation succeeded. Now register the message file RegisterApplicationLog(szPath, EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE); return bRet; }
void Explorerplusplus::HandleTreeViewSelection(void) { HTREEITEM hItem; LPITEMIDLIST pidlDirectory = NULL; TCHAR szDirectory[MAX_PATH]; TCHAR szRoot[MAX_PATH]; UINT uDriveType; BOOL bNetworkPath = FALSE; if(!m_bSynchronizeTreeview) { return; } pidlDirectory = m_pActiveShellBrowser->QueryCurrentDirectoryIdl(); GetDisplayName(pidlDirectory,szDirectory,SIZEOF_ARRAY(szDirectory),SHGDN_FORPARSING); if(PathIsUNC(szDirectory)) { bNetworkPath = TRUE; } else { StringCchCopy(szRoot,SIZEOF_ARRAY(szRoot),szDirectory); PathStripToRoot(szRoot); uDriveType = GetDriveType(szRoot); bNetworkPath = (uDriveType == DRIVE_REMOTE); } /* To improve performance, do not automatically sync the treeview with network or UNC paths. */ if(!bNetworkPath) { hItem = m_pMyTreeView->LocateItem(pidlDirectory); if(hItem != NULL) { /* TVN_SELCHANGED is NOT sent when the new selected item is the same as the old selected item. It is only sent when the two are different. Therefore, the only case to handle is when the treeview selection is changed by browsing using the listview. */ if(TreeView_GetSelection(m_hTreeView) != hItem) m_bSelectingTreeViewDirectory = TRUE; SendMessage(m_hTreeView,TVM_SELECTITEM,(WPARAM)TVGN_CARET,(LPARAM)hItem); } } CoTaskMemFree(pidlDirectory); }
wxString TagEntry::GetFullDisplayName() const { wxString name; if(GetParent() == wxT("<global>")) { name << GetDisplayName(); } else { name << GetParent() << wxT("::") << GetName() << GetSignature(); } return name; }
HRESULT GetCsidlDisplayName(int csidl, TCHAR *szFolderName, UINT cchMax, DWORD uParsingFlags) { LPITEMIDLIST pidl = NULL; HRESULT hr = SHGetFolderLocation(NULL, csidl, NULL, 0, &pidl); if(SUCCEEDED(hr)) { hr = GetDisplayName(pidl, szFolderName, cchMax, uParsingFlags); CoTaskMemFree(pidl); } return hr; }
int CALLBACK CShellBrowser::SortByName(int InternalIndex1,int InternalIndex2) const { if(m_bVirtualFolder) { TCHAR FullFileName1[MAX_PATH]; LPITEMIDLIST pidlComplete1 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex1].pridl); GetDisplayName(pidlComplete1,FullFileName1,SHGDN_FORPARSING); CoTaskMemFree(pidlComplete1); TCHAR FullFileName2[MAX_PATH]; LPITEMIDLIST pidlComplete2 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex2].pridl); GetDisplayName(pidlComplete2,FullFileName2,SHGDN_FORPARSING); CoTaskMemFree(pidlComplete2); BOOL IsRoot1 = PathIsRoot(FullFileName1); BOOL IsRoot2 = PathIsRoot(FullFileName2); if(IsRoot1 && !IsRoot2) { return -1; } else if(!IsRoot1 && IsRoot2) { return 1; } else if(IsRoot1 && IsRoot2) { /* If the items been compared are both drives, sort by drive letter, rather than display name. */ return StrCmpLogicalW(FullFileName1,FullFileName2); } } std::wstring Name1 = GetNameColumnText(InternalIndex1); std::wstring Name2 = GetNameColumnText(InternalIndex2); return StrCmpLogicalW(Name1.c_str(),Name2.c_str()); }
void Explorerplusplus::OnTreeViewCopy(BOOL bCopy) { IDataObject *pClipboardDataObject = NULL; HTREEITEM hItem; TVITEM tvItem; HRESULT hr; hItem = TreeView_GetSelection(m_hTreeView); if(hItem != NULL) { LPITEMIDLIST pidl = m_pMyTreeView->BuildPath(hItem); std::list<std::wstring> FileNameList; TCHAR szFullFileName[MAX_PATH]; GetDisplayName(pidl,szFullFileName,SIZEOF_ARRAY(szFullFileName),SHGDN_FORPARSING); std::wstring stringFileName(szFullFileName); FileNameList.push_back(stringFileName); if(bCopy) { hr = CopyFiles(FileNameList,&pClipboardDataObject); } else { hr = CutFiles(FileNameList,&pClipboardDataObject); if(SUCCEEDED(hr)) { m_hCutTreeViewItem = hItem; m_iCutTabInternal = m_iObjectIndex; tvItem.mask = TVIF_HANDLE|TVIF_STATE; tvItem.hItem = hItem; tvItem.state = TVIS_CUT; tvItem.stateMask = TVIS_CUT; TreeView_SetItem(m_hTreeView,&tvItem); } } if(SUCCEEDED(hr)) { m_pClipboardDataObject = pClipboardDataObject; } CoTaskMemFree(pidl); } }