 |
|
 |
I need to open the PickIconDialog window in a program written in C#
[DllImport("shell32.dll",CharSet = CharSet.Auto, CallingConvention =
CallingConvention.Winapi)]
public static extern int PickIconDlg(IntPtr hwndOwner,
System.Text.StringBuilder lpstrFile, int nMaxFile, ref int
lpdwIconIndex);
Using the declaration above, it work perfectly in Windows XP but in
Windows 2000 SP4 it gives me the exception
System.EntryPointNotFoundException: Unable to find an entry point
named PickIconDlg in DLL shell32.dll
What am I doing wrong?
|
|
|
|
 |
|
 |
I don't believe you can do it. According to the documentation PickIconDlg requires Minimum DLL Version shell32.dll version 6.0 or later, Minimum operating systems Windows XP
PickIconDlg Function[^]
|
|
|
|
 |
|
 |
you can use SetIcon(TRUE or FALSE) to set the large and small icon to the app.
but how can i only add the small icon to a image list?
Thank you.
|
|
|
|
 |
|
 |
'Declare the routine.
Private Declare Function SHSelectIcon Lib "shell32" Alias _
"#62" (ByVal owner As Long, _
ByVal pszFileName As String, _
pdwBufferSize As Long, _
pdwIndex As Long) As Boolean
'Call from VB
Sub CallSelectIcon()
Dim LibName As String
Dim cbLibName, dwIndex As Long
LibName = "C:\WINDOWS\MORICONS.DLL"
cbLibName = Len(LibName)
dwIndex = 0
Call SHSelectIcon(0, LibName, cbLibName, dwIndex)
If InStr(LibName, vbNullChar) <> 0 Then
LibName = Left$(LibName, Len(LibName) - 1)
End If
MsgBox "Lib: " & LibName & " Index: " & CStr(dwIndex)
End Sub
'
Willian S. Rodrigues
willians@bb.com.br
willians_cpp_br@hotmail.com
willian.cpp@bol.com.br
(VB, VC++, Qt, MFC, Cobol,Clipper, Pascal)
|
|
|
|
 |
|
 |
First I must say great discovery !
As the function is not documented I wonder how you found it and how you figured out the function's declaration.
Are there any helpfull tools to examine undocumented DLL-funtions ?
TC
|
|
|
|
 |
|
 |
Really very useful, thanks a lot.
|
|
|
|
 |
|
 |
Have any idea about how to invoke a context menu on right
click of Network Neighborhood computer. Say u want to display two menu
items like connect and disconnect of a n/w neighborhood computer using
ShellExtensions.
Any idea or suggestions highly appreciated..
Pls. provide how to register the component , i mean under what hive to be
registered.
Thanks & Regards,
soma
|
|
|
|
 |
|
 |
To do this, you have to write a context menu handler. This is a shell extension that handles IContextMenu.
This is very well documented.
For registering it, i think you should take a look at the following registry location:
HKAY_CLASSES_ROOT\Network.
On my machine, there's a key Type, then a Key 2, and this key has a property sheet handler installed. I think you should add a key ContextMenuHandlers there and add your clsid.
|
|
|
|
 |
|
 |
First Thanks for reply . Well i tried all this network/Type/2 and ShellFolder too.. some how it does not work. If you have been tried can you pls. provide any working registry entries.
thanks
soma
|
|
|
|
 |
|
|
 |
|
 |
How to save the selected icon in a .ico file ?
Thank's for your help
Xavier
savier.lelievre@dip-systemes.f
|
|
|
|
 |
|
 |
Dear Xavier,
The Microsoft 'Platform SDK' provides sample code called "IconPro" that shows how to grab icons out of .EXE and .DLL and save them into an .ICO file. If you don't have the SDK, E-mail me, and I send you the sample.
Christiaan
|
|
|
|
 |