|
Here you go.
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;
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);
}
}
|
|
|
|
|
http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/cc4a702f-1b2f-4d19-bf68-c88967544172[^]
Where do RefreshFolderSelectionPacket and RefreshSelection() come from?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
uh huh, I ripped that code from there
|
|
|
|
|
I get compile error for RefreshFolderSelectionPacket
how to call UpdateItem
|
|
|
|
|
In my CFormView drived class, why OnInitialUpdate() is not getting executed?
|
|
|
|
|
Could you please post code from your header definition and source file, only relevant parts please.
At a guess tho, I would say it is because you didn't declare it as a virtual function.
In the header file it should be declared as virtual void OnInitialUpdate();
|
|
|
|
|
Andrew Brock wrote: At a guess tho, I would say it is because you didn't declare it as a virtual function.
In the header file it should be declared as virtual void OnInitialUpdate();
Not likely since once virtual, always virtual. You don't need to declare an overridden virtual function virtual. However good it might be for readability, it's not necessary.
|
|
|
|
|
Hi,
I have changed the background colour of one of my dialogs by handling the WM_CTLCOLOR message. This works OK but the child controls are still painted using the original dialog background colour. I have set the transparent property of the child controls but this makes no difference.
Is there something else I need to do?
Thanks
Tony
|
|
|
|
|
What are your child controls? Static text?
Typically you would need to override the WM_ERASEBKGND (OnEraseBkgnd in MFC) in the child controls to stop it painting the background or to copy the parent background (depending on what you are doing). Check out some of the transparent controls[^] in the articles section.
|
|
|
|
|
My dialog contains a mixture of control types, including CStatic, CEdit etc. I have discovered that if I call pDC->SetBkMode(TRANSPARENT) in my dialog's OnCtlColor() handler then all of the child static controls have a transparent background - GREAT! - but unfortunately, so do my edit controls.
So close but yet so far
I was hoping that I would be able to create a generic dialog class which would allow me to set the background colour without me having to fiddle with the child controls on an individual basis.
|
|
|
|
|
Ok, great start. Check out the MSDN page[^] for OnCtlColor().
Notice the nCtlColor parameter? Only do pDC->SetBkMode(TRANSPARENT) if it is equal to CTLCOLOR_STATIC and you should be set.
EDIT:
If you only want to set specific controls as transperent, rather than all controls of a type, check if pWnd is the instance you want to set instead.
|
|
|
|
|
Thanks Andrew - works a treat
|
|
|
|
|
hi i need source genetic algorithm function sphere,schwefel, rosenberg, Ackley, Giewank with languages c++
|
|
|
|
|
I would suggest a Google search, this forum does not provide code on demand.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Do your own homework.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Hi,
I created the CFromView dynamically, Form is having CListCtrl where should set the style for CListCtrl?
the below code is giving error as m_ListDriveis is NULL .
bool CRecoverDriveDlg::CreateView(UINT Style, CRect rect,CWnd *Parent)
{
Create(NULL,NULL,Style,rect,Parent,0x10,NULL);
m_ListDrive.SetExtendedStyle(LVS_EX_FULLROWSELECT);
return 1;
}
|
|
|
|
|
What is m_ListDrive supposed to be and where is it initialised?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I'm guessing what you mean is m_ListDrivis.m_hwnd is null. The variable somehow needs to be attached to the dialog control.
This can be done with Dynamic Data eXchange (DDX) or the SubclassDlgItem[^] function, which must be called before m_ListDrive.SetExtendedStyle(LVS_EX_FULLROWSELECT); .
You could also make it into a pointer in the class definition, and then use
m_ListDrive = (CListCtrl *)GetDlgItem(IDC_MY_LIST); m_ListDrive->SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
|
|
|
|
Where did you get all this about a dialog? The OP's question is about creating a window.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I have not used MFC for about a year now, so my memory could be a bit flaky, but:
"These controls are laid out based on a dialog-template resource."
- CFormView Class[^].
The form view is a pretty way of embedding a dialog into a MFC view. All of the controls on it have a dialog ID associated with them.
|
|
|
|
|
That may well be true but it does not seem to be the way OP is implementing it. I'm ready to stand corrected, however.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I could be completely wrong on this, but to me, it appears that he has defined a variable, something like CListCtrl m_ListDrive in the CRecoverDriveDlg class.
He is expecting this variable to automatically attach to some list control he has in the dialog template (I dont see a call to m_ListDrive.Create() ).
My suggestion was to manually attach m_ListDrive to this control somehow.
It is possible that he has called m_ListDrive.Create() elsewhere in his code and simply hasn't shown it and hence I am completely wrong. Since the original issue is m_ListDrive is NULL, then this call has failed, and that code would be relevant to helping him find a solution.
|
|
|
|
|
I agree, which is why my question to him was "what is this variable and where is it initialised?". We will see; or not!
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Why shouldn't it be NULL ?
I mean, you didn't show us the code initializing it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
As I know IOCP which is called one powerful model to meet socket program in scalable case, from then on I have a question on IOCP.Today, still puzzle me.
The question is What will happen if you post more than one WSASend() request in one client socket which has been associated with the existing completion port. The scenario is as follows:
IO Request:
WSASend(...,wsaBuff1,1,...); WSASend(...,wsaBuff2,1,...); WSASend(...,wsaBuff3,1,...);
What will happen in the completion port?
1/ How many completion packet will be received?
2/ What is the order of the completion packet?
3/ Is it possbile to require more than one send request for each buffer? It means one time send request can't finish the data transmission. The user need to post another or more WSASend request for the rest data.
|
|
|
|