English 中文(简体)
Does anyone know where I can find the standard windows file dialog toolbar icons?
原标题:

I m trying to roll my own implementation of IShellBrowser because I need to have a more full-featured File Open and Save As dialog than Windows allows that is compatible with XP (and ideally with W2000)*

At this point I need to add the standard toolbar that you see in upper right of the dialog (manifest styles for XP and earlier) - a back button, a parent-folder button, a new folder button, and a "tools" drop down.

But so far I ve been unsuccessful in finding these icons / images. I ve looked in USER32.dll, comdlg32.dll, comctl32.dll, but haven t found anything that quite matches.

I could simply take screen shots of an application where I can find them - but it would possibly more useful to know where they come from, so I can access the various versions of these buttons (high rez, low rez, shallow color, deep color, etc.).

Any ideas?

[Edit: I need it to be compatible with Vista & Windows 7 also. Its just that starting with Vista, they broke the old common dialog model, and their new model is brain-damaged IMO - I no longer have enough access to the state of the dialog to perform the necessary duties that our dialogs used to do - so we are forced to approach the problem from another angle]

最佳回答

Try shell32.dll, in WindowsSystem32.

问题回答

I found this table containing a list of system files containing embedded icons. Perhaps you might find what you re looking for in one of them:

Filename     Number of Icons
-----------------------------
compstui.dll    99
comres.dll      38
cryptui.dll     20
csc.dll         22
dsuiext.dll     35
explorer.exe    18
iexplore.exe    23
inetcpl.cpl     34
inetcpl.dll     14
mmcndmgr.dll    129
mmsys.cpl       40
moricons.dll    140
netshell.dll    157
ntbackup.exe    26
pfmgr.dll       38
progman.exe     48
setupapi.dll    37
SHDOCVW.DLL     35
shell32.dll     238
stobject.dll    31
wiashext.dll    23
wmploc.dll      60
xpsp2res.dll    19

Try looking in imageres.dll. You should find most of the image resources for Vista there.

If you just ask the shell for it s image list, it will give it to you.

Shell_GetImageLists()

And then you can use whichever ones you want. Yay.

Edit: Looks like SHGetImageList() might be the more-better way of doing it.

Use your own icons. Resource Ids in Shell32.dll are not documented and can change in a Windows Update.

Windows has 3 "standard" toolbars. From CommCtrl.h (source):

  • Standard: enter image description here (IDB_STD_SMALL_COLOR)
  • View: enter image description here (IDB_VIEW_SMALL_COLOR)
  • History: enter image description here (IDB_HIST_SMALL_COLOR)

The indexes for the images are documented, and can be found in CommCrtl.h. For example, the Standard image indexes are:

  • STD_CUT (0): Cut operation.
  • STD_COPY (1): Copy operation
  • STD_PASTE (2): Paste operation.
  • STD_UNDO (3): Undo operation.
  • STD_REDOW (4): Redo operation. (yes, typow)
  • STD_DELETE (5): Delete operation.
  • STD_FILENEW (6): New file operation.
  • STD_FILEOPEN (7): Open file operation.
  • STD_FILESAVE (8): Save file operation.
  • STD_PRINTPRE (9): Print preview operation.
  • STD_PROPERTIES (10): Properties operation.
  • STD_HELP (11): Help operation.
  • STD_FIND (12): Find operation.
  • STD_REPLACE (13): Replace operation.
  • STD_PRINT (14): Print operation.

You load a standard set of images into a toolbar s imagelist by sending the TB_LOADIMAGES message:

// hWndToobar is the window handle of the toolbar control.
SendMessage(hWndToolbar, 
      TB_LOADIMAGES, 
      (WPARAM)IDB_STD_SMALL_COLOR, 
      (LPARAM)HINST_COMMCTRL);




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签