Click here to Skip to main content
15,887,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fopen crashed when special characters found. Pin
Andrew Brock27-Oct-11 8:36
Andrew Brock27-Oct-11 8:36 
AnswerRe: fopen crashed when special characters found. Pin
Pranit Kothari27-Oct-11 19:01
Pranit Kothari27-Oct-11 19:01 
AnswerRe: fopen crashed when special characters found. Pin
tagopi27-Oct-11 19:40
tagopi27-Oct-11 19:40 
QuestionHow to refresh folder Pin
MKC00227-Oct-11 0:52
MKC00227-Oct-11 0:52 
AnswerRe: How to refresh folder Pin
Chandrasekharan P27-Oct-11 0:59
Chandrasekharan P27-Oct-11 0:59 
AnswerRe: How to refresh folder Pin
Richard MacCutchan27-Oct-11 1:17
mveRichard MacCutchan27-Oct-11 1:17 
GeneralRe: How to refresh folder Pin
MKC0021-Nov-11 6:40
MKC0021-Nov-11 6:40 
AnswerRe: How to refresh folder Pin
App_27-Oct-11 5:38
App_27-Oct-11 5:38 
Here you go.

// Call for each explorer window

        HWND hExplorer = FindWindowEx(GetDesktopWindow(), NULL, L"ExploreWClass", NULL);

        while(hExplorer != NULL)
        {
            EnumChildWindows(hExplorer, RefreshFolderSelectionCB, (LPARAM)&packet);

            hExplorer = FindWindowEx(GetDesktopWindow(), hExplorer, L"ExploreWClass", NULL);
        }
...
...
...

BOOL CALLBACK    RefreshFolderSelectionCB(HWND hWnd, LPARAM lParam)
{
    WCHAR sBuffer[MAX_PATH] = {0};

    ::GetClassName(hWnd, sBuffer, MAX_PATH);

    if (wcscmp(L"SysTreeView32", sBuffer) == 0)
    {
        RefreshFolderSelectionPacket* pPacket = (RefreshFolderSelectionPacket*)lParam;

        // Refreshes the tree nodes that match the contained full paths, and all their open descendants
        // Paths are updated by calling UpdateItem (below)
        // Cache is used across explorer instances to ensure no path is updated twice.

        RefreshSelection(pPacket);
    }

    return TRUE;
}


...
...
static void UpdateItem(IShellFolder* pDesktop, const std::wstring& rsFullPath)
{
    PIDLIST_RELATIVE pIDL;

    if (SUCCEEDED(pDesktop->ParseDisplayName(NULL, NULL, (LPWSTR)rsFullPath.c_str(), NULL, &pIDL, NULL)))
    {
        SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_IDLIST|SHCNF_NOTIFYRECURSIVE|SHCNF_FLUSH, pIDL, NULL);

        ILFree(pIDL);
    }
}

QuestionRe: How to refresh folder Pin
David Crow27-Oct-11 5:55
David Crow27-Oct-11 5:55 
AnswerRe: How to refresh folder Pin
App_27-Oct-11 8:57
App_27-Oct-11 8:57 
GeneralRe: How to refresh folder Pin
MKC0024-Nov-11 7:22
MKC0024-Nov-11 7:22 
QuestionOnInitialUpdate Pin
john563226-Oct-11 7:43
john563226-Oct-11 7:43 
AnswerRe: OnInitialUpdate Pin
Andrew Brock26-Oct-11 8:50
Andrew Brock26-Oct-11 8:50 
GeneralRe: OnInitialUpdate Pin
Niklas L27-Oct-11 11:06
Niklas L27-Oct-11 11:06 
QuestionDialog Control Transparent Property Pin
softwaremonkey26-Oct-11 4:52
softwaremonkey26-Oct-11 4:52 
AnswerRe: Dialog Control Transparent Property Pin
Andrew Brock26-Oct-11 5:28
Andrew Brock26-Oct-11 5:28 
GeneralRe: Dialog Control Transparent Property Pin
softwaremonkey26-Oct-11 5:50
softwaremonkey26-Oct-11 5:50 
GeneralRe: Dialog Control Transparent Property Pin
Andrew Brock26-Oct-11 5:54
Andrew Brock26-Oct-11 5:54 
GeneralRe: Dialog Control Transparent Property Pin
softwaremonkey26-Oct-11 7:23
softwaremonkey26-Oct-11 7:23 
Questionsource c++ genetic algorithm function Pin
hasan rad26-Oct-11 1:15
hasan rad26-Oct-11 1:15 
AnswerRe: source c++ genetic algorithm function Pin
Richard MacCutchan26-Oct-11 1:28
mveRichard MacCutchan26-Oct-11 1:28 
AnswerRe: source c++ genetic algorithm function Pin
TheGreatAndPowerfulOz26-Oct-11 5:04
TheGreatAndPowerfulOz26-Oct-11 5:04 
QuestionCFromView Pin
john563225-Oct-11 22:19
john563225-Oct-11 22:19 
AnswerRe: CFromView Pin
Richard MacCutchan25-Oct-11 22:38
mveRichard MacCutchan25-Oct-11 22:38 
AnswerRe: CFromView Pin
Andrew Brock25-Oct-11 23:31
Andrew Brock25-Oct-11 23:31 

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.