Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to kill the MFC icon Pin
Chris Losinger20-Sep-06 7:55
professionalChris Losinger20-Sep-06 7:55 
AnswerRe: How to kill the MFC icon Pin
David Crow20-Sep-06 7:52
David Crow20-Sep-06 7:52 
Questionmouse Pin
viliam20-Sep-06 5:50
viliam20-Sep-06 5:50 
AnswerRe: mouse Pin
tanvon malik20-Sep-06 6:21
tanvon malik20-Sep-06 6:21 
QuestionUser Control Developed in C# not appearing in VC++ Pin
rickettsd20-Sep-06 5:48
rickettsd20-Sep-06 5:48 
AnswerRe: User Control Developed in C# not appearing in VC++ Pin
Zac Howland20-Sep-06 8:18
Zac Howland20-Sep-06 8:18 
QuestionCalling SHBrowseForFolder from unmanaged VC++ code? Pin
BarryOg20-Sep-06 4:38
BarryOg20-Sep-06 4:38 
AnswerRe: Calling SHBrowseForFolder from unmanaged VC++ code? Pin
Chris Losinger20-Sep-06 4:40
professionalChris Losinger20-Sep-06 4:40 
(i forget where i got this - Google search, most likely)

// The initial folder, and the result of the function are contained in buf

bool BrowseForFolder(HWND hWnd, char *buf)
{
	// Global pointer to the shell's IMalloc interface.
	
	LPMALLOC g_pMalloc;
	
	// Get the shell's allocator.
	
	if (!SUCCEEDED(::SHGetMalloc(&g_pMalloc)))
		return false;
	
	BROWSEINFO     bi;
	LPITEMIDLIST  pidlMyComputer;  // PIDL for MyComputer folder
	
	LPITEMIDLIST  pidlBrowse;      // PIDL selected by user
	
	
	// Get the PIDL for the Programs folder.
	
	if (!SUCCEEDED(::SHGetSpecialFolderLocation(hWnd, CSIDL_DRIVES, &pidlMyComputer)))
		return false;
	
	// Fill in the BROWSEINFO structure.
	
	bi.hwndOwner = hWnd;
	bi.pidlRoot = pidlMyComputer;
	bi.pszDisplayName = buf;
	bi.lpszTitle = "Select root folder";
        // 0x40 = new style dialog (includes "Make New Folder" button)
	bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_RETURNFSANCESTORS | 0x40; 
	bi.lpfn = BrowseCallbackProc;
	bi.lParam = (LPARAM)buf;
	
	// Browse for a folder and return its PIDL.
	
	pidlBrowse = ::SHBrowseForFolder(&bi);
	bool result = (pidlBrowse != 0);
	if (result) 
	{
		if (!::SHGetPathFromIDList(pidlBrowse, buf))
			result = false;
		
		// Free the PIDL returned by SHBrowseForFolder.
		
		g_pMalloc->Free(pidlBrowse);
	}
	
	// Clean up.
	
	g_pMalloc->Free(pidlMyComputer);
	
	return result;
}





AnswerRe: Calling SHBrowseForFolder from unmanaged VC++ code? Pin
led mike20-Sep-06 4:42
led mike20-Sep-06 4:42 
QuestionRe: Calling SHBrowseForFolder from unmanaged VC++ code? Pin
David Crow20-Sep-06 5:18
David Crow20-Sep-06 5:18 
AnswerRe: Calling SHBrowseForFolder from unmanaged VC++ code? Pin
Zac Howland20-Sep-06 5:25
Zac Howland20-Sep-06 5:25 
GeneralRe: Calling SHBrowseForFolder from unmanaged VC++ code? Pin
BarryOg20-Sep-06 9:06
BarryOg20-Sep-06 9:06 
Questioncopying HTML from a CWebBrowser in XP sp2 [modified] Pin
Maximilien20-Sep-06 4:04
Maximilien20-Sep-06 4:04 
AnswerRe: copying HTML from a CWebBrowser in XP sp2 Pin
led mike20-Sep-06 4:51
led mike20-Sep-06 4:51 
GeneralRe: copying HTML from a CWebBrowser in XP sp2 Pin
Maximilien20-Sep-06 5:00
Maximilien20-Sep-06 5:00 
GeneralRe: copying HTML from a CWebBrowser in XP sp2 Pin
led mike20-Sep-06 5:06
led mike20-Sep-06 5:06 
QuestionHow to read Windows Registry Pin
himuskanhere20-Sep-06 3:37
himuskanhere20-Sep-06 3:37 
GeneralRe: How to read Windows Registry Pin
Matt Godbolt20-Sep-06 3:59
Matt Godbolt20-Sep-06 3:59 
AnswerRe: How to read Windows Registry Pin
Hamid_RT20-Sep-06 4:03
Hamid_RT20-Sep-06 4:03 
AnswerRe: How to read Windows Registry Pin
pavan_sw20-Sep-06 20:48
pavan_sw20-Sep-06 20:48 
QuestionHow to read Windows Registry Pin
himuskanhere20-Sep-06 3:35
himuskanhere20-Sep-06 3:35 
AnswerRe: How to read Windows Registry Pin
Jörgen Sigvardsson20-Sep-06 3:38
Jörgen Sigvardsson20-Sep-06 3:38 
AnswerRe: How to read Windows Registry Pin
_AnsHUMAN_ 20-Sep-06 3:44
_AnsHUMAN_ 20-Sep-06 3:44 
AnswerRe: How to read Windows Registry Pin
David Crow20-Sep-06 3:56
David Crow20-Sep-06 3:56 
Questionquesion about string Pin
zizzzz20-Sep-06 3:29
zizzzz20-Sep-06 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.