|
|
Comments and Discussions
|
|
 |

|
HI,
can you give me more information about the application?The detailed steps
thanks!
The best post to my email
|
|
|
|

|
Sure, what kind of information would you like? All of the code is in the download package, so feel free to inspect it and experiment with it at your leisure.
|
|
|
|

|
Great stuff!
I tried to apply it to a small utility of mine, which has functionality slightly beyond what is defined in the standard buttons, so I'd like, if possible, to combine 'standard' with 'propietary' bitmaps. The code, as far as I have seen, does not provide for that option. Have I missed something?
Do you know of anyone who has done it?
Thank you for your article,
Pablo.
Pablo_A
|
|
|
|

|
You're welcom, Pablo, and sorry for taking so long to answer this one. I was planning a sequel to this article to address this very issue, and I thought I had some code somewhere to back it up. I've rummaged through my drawers and swept aside the cobwebs, but I can't seem to find either the article or the code. I'm rather swamped with projects right now, but I hope to post the follow-up article by the end of April. In the meantime, all I can say is that the answer involves creating a toolbar button in the array that includes a local resource ID as the bitmap ID, and passing that ID as a parameter to the static CreateSysToolbarCtrl method. I didn't provide an example of it because I haven't actually finished and tested the code for the special case in the CreateSysToolbarCtrl logic. Hope this helps!
Jon.
|
|
|
|

|
Thanks for this very useful article.
Please give me the link to Platform SDK October 2002 update .
Thanks ....
|
|
|
|
|

|
Thank you very much for help !!!
My best regards
|
|
|
|

|
I've had reports that this doesn't work under XP, but I only have win2k and win9x boxes, so I can't verify them myself. Is this true? Has anybody tried downloading the executable and running it under XP?
|
|
|
|

|
For the very quick look the problem (I have no idea about the initial reasons of it) looks like the following: the "LISTVIEW" window (the child of "SHELLDLL_DefView" aka your m_hWndShellView) is not shown (it has not VISIBLE flag). So as a quick "fix" (of course it is not correct, but just to "get it working") I've put ::ShowWindow(hWndListView,SW_NORMAL); as the last string of CMainFrame::BrowseObject() method (before return NOERROR; ). It's been checked on XP+SP1. Let us know about the proper fix.
|
|
|
|

|
Thanks! I still don't have access to an XP machine for coding, so it may be a while before I get a chance to play around with it
|
|
|
|

|
Do a search for ILCombine on this site. There is an article that has the definitions for the IL... stuff.
Add the following to PIDL.cpp:
// dupicate an idlist
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILClone)(LPCITEMIDLIST pidl);
extern fnILClone ILClone;
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILCombine)(LPCITEMIDLIST pidl, LPCITEMIDLIST pidlsub);
extern fnILCombine ILCombine;
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILFindLastID)(LPCITEMIDLIST);
extern fnILFindLastID ILFindLastID;
// free an idlist using the shell allocater
// (how is this func diffrent from SHFree?
typedef WINSHELLAPI void (WINAPI *fnILFree)(LPITEMIDLIST pidl);
extern fnILFree ILFree;
// Creates a new list with the last tiem removed.
typedef WINSHELLAPI BOOL (WINAPI *fnILRemoveLastID)(LPCITEMIDLIST);
extern fnILRemoveLastID ILRemoveLastID;
static HINSTANCE g_hShell32;
-------------
Add the following to mainfrm.cpp:
// dupicate an idlist
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILClone)(LPCITEMIDLIST pidl);
extern fnILClone ILClone;
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILCombine)(LPCITEMIDLIST pidl, LPCITEMIDLIST pidlsub);
extern fnILCombine ILCombine;
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILFindLastID)(LPCITEMIDLIST);
extern fnILFindLastID ILFindLastID;
// free an idlist using the shell allocater
// (how is this func diffrent from SHFree?
typedef WINSHELLAPI void (WINAPI *fnILFree)(LPITEMIDLIST pidl);
extern fnILFree ILFree;
// Creates a new list with the last tiem removed.
typedef WINSHELLAPI BOOL (WINAPI *fnILRemoveLastID)(LPCITEMIDLIST);
extern fnILRemoveLastID ILRemoveLastID;
static HINSTANCE g_hShell32;
fnILClone ILClone;
fnILFree ILFree;
fnILCombine ILCombine;
fnILFindLastID ILFindLastID;
fnILRemoveLastID ILRemoveLastID;
-----------------
In OnCreate() of Mainfrm.cpp add:
g_hShell32 = ::LoadLibrary("shell32.dll");
ILClone = (fnILClone)::GetProcAddress(g_hShell32, (const char *)18);
ILFree = (fnILFree)::GetProcAddress(g_hShell32, (const char *)155);
ILCombine = (fnILCombine)::GetProcAddress(g_hShell32, (const char *)25);
ILFindLastID = (fnILFindLastID)::GetProcAddress(g_hShell32, (const char *)16);
ILRemoveLastID = (fnILRemoveLastID)::GetProcAddress(g_hShell32, (const char *)17);
That should be it.
|
|
|
|

|
Actually, if you have a recent enough version of the Platform SDK, none of that should be necessary. The declarations are in <shlobj.h>, which is part of the Platform SDK. I'm not sure when it was included, but it's there in mine, which is the October 2002 update. <shlobj.h> is included by <atldlgs.h>, which is included in my stdafx.h file. If this works for those who don't have a new SDK though, it looks like you've done an awful lot of work. Thanks!
|
|
|
|

|
Another article people might want to look at:
http://www.codeproject.com/shell/shlext.asp
The source files even include some declarations which might work too. I haven't tried them, but if anybody can, I'd like to know whether they work.
|
|
|
|

|
Hi !
Where is declarations of ILFree and other IL** ?
I have PSDK July 2002 and WTL 7, but cannot build
your project.
Best regards,
Stas
|
|
|
|

|
The declarations are in <shlobj.h>, which is part of the Platform SDK. I'm not sure when it was included, but it's there in mine, which is the October 2002 update. <shlobj.h> is included by <atldlgs.h>, which is included in my stdafx.h file.
|
|
|
|

|
Hi !
OK, i see.
Thanks for answer, will try posted solution.
This is very good that the WTL used more widely,
so i read closely each article where it used,
because i think WTL demands higher class of programming
than other libraries.
When i build, will rate (i think very high)
Best regards,
Stas
|
|
|
|

|
Good luck! Sorry about the "roadblocks". I'd forgotten about some of the intricacies of building this stuff, because this article is a small chunk I broke off from a much larger project I've been working on for some time. I initially went through some of the same gyrations as you and others are going through now trying to build this project, but I'd forgotten some of them. This is proving to be a good refresher course.
|
|
|
|

|
Hi,
While building the project: "cannot open include file 'atlres.h'"
Thanks.
|
|
|
|
|

|
Thanks.
For information, in this article about Wtl, the link "WTL 3.1" seems to be no longer available...
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
A WTL mix-in class for creating toolbar controls using common controls bitmaps instead of local resources.
| Type | Article |
| Licence | CPOL |
| First Posted | 2 Nov 2003 |
| Views | 86,097 |
| Bookmarked | 21 times |
|
|