[API] Win32 Resources - List Icon Resource Names

C#

    Next

  • 1. Javascript generated source of a Webbrowser Control
    Hello, I want to retrieve the source of an HTML-Site in a string. For must cases webBrowser1.Document.Body.InnerText is suitable, but in my case the javascript generated content is not included. I can only see the javascript-code but not HTML which is generated by it. the Webbrowser Control ittself shows the correct content of the page. How can retrieve Javascript generated HTML source in C#? Thanks in advance! Matthias
  • 2. dotnetfx35 on CD only
    Hi , I have some musician friends of mine who are not on high speed internet and can't get download dotnetfx35.exe (over 200 meg).. I want to be able to put it on a cd and open it with my Visual Studio 2008 project bootstrap loader somehow... Anyone have an idea on how this is done? I used to do it in earlier versions of Visual Studio and dotnet. Now I have been digging through all the documentation and still have no idea what they want me to do !
  • 3. quite easy question about linq
    Hello! I have this linq query below which works as expected but I have one question. If I just change the .Select operator to *.Select(eo => new {id = e.id, optionsCount = eo.optionsCount}));* Here as you can see I have taken the id from variable e which is employee insted of eo will the result be the same ? I'm almost sure it will but I just want to be 100 % sure. Employee[] employees = Employee.GetEmployeesArray(); EmployeeOptionsEntry[] empOptions = EmployeeOptionEntry.GetEmployeeOptionEntries(); var employeeOptions = employees .SelectMany(e => empOptions .Where(eo => eo.id == e.id) .Select(eo => new {id = eo.id, optionsCount = eo.optionsCount})); foreach (var item in employeeOptions) Console.WriteLine(item); //Tony .
  • 4. Native C DLL Call.
    Hi, I need to create a wrapper for following native function scenario. typedef struct _myinfo { char *buf; int max_size; }myinfo; void getdata(struct myinfo *obj) buf ==> is the pointer to the buffer which is filled by the getdate function. max_size ==> it the max. size of buf Before calling getdata function i need to allocate the buffer and assign its pointer to "buf" and and assign the "max_size" to the size of that buffer. The function would just fill up that buffer to the "max_size". how do i deal with this ??? Thanks Sudeep.
  • 5. Popping dialogs up on a console app
    In a console app, I can create and use FolderBrowserDialog and similar objects, but they often pop up behind, rather than in front of, the console window. What can I do about that? I understand FolderBrowserDialog.Show( ) will take an argument to identify the parent window, but I don't know what to put there.

[API] Win32 Resources - List Icon Resource Names

Postby Mythran » Fri, 23 Dec 2005 09:27:33 GMT

wrote some code that is supposed to enumerate through the specified file's
win32 resources and return a string-array of all icon names. When it runs,
it returns a string-array with a bunch of numbers in sequential order (1-55
when ran against iexplore.exe).

When I open up iexplore.exe in Visual Studio, I see 23 icons. Each icon has
1 or more sizes of the icon...I'm assuming that there are, in fact, 55 icon
resources in iexplore.exe, and the code I wrote is returning the indexes of
the icons? If so, how do I get the names/identifiers for the icons?

The following is my code for the ResourceExtracter class that hopefully
shows what I am trying to do...To use, just create a ResourceExtracter
instance and call GetIconNames passing the path to an exe or dll file
(C:\Program Files\Internet Explorer\iexplore.exe is the path I am using to
test with).

Thanks in advance :)

-------------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;
using System.Collections;
using System.ComponentModel;

namespace Tests.Applications.ResourceViewer.UI
{
/// <summary>
/// Provides the methods to extract resources from a Win32 binary.
/// </summary>
public class ResourceExtracter
{

#region Private Members
//
=================================================================
// Private Members
//
=================================================================

private enum ResourceType : int
{
Cursor = 0x00000001,
Bitmap = 0x00000002,
Icon = 0x00000003,
Menu = 0x00000004,
Dialog = 0x00000005,
String = 0x00000006,
FontDir = 0x00000007,
Font = 0x00000008,
Accelerator = 0x00000009,
RcData = 0x0000000a,
MessageTable = 0x0000000b
}

private const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
private const int ERROR_RESOURCE_TYPE_NOT_FOUND = 0x00000715;

private string mFilePath = null;

private delegate bool EnumResNameDelegate(
IntPtr ModuleHandle,
IntPtr Type,
IntPtr Name,
IntPtr Param
);
#endregion

#region API Declarations
//
=================================================================
// API Declarations
//
=================================================================

[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr LoadLibraryEx(
string FileName,
IntPtr FileHandle,
uint Flags
);

[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool FreeLibrary(IntPtr ModuleHandle);

[
DllImport(
"kernel32.dll",
EntryPoint = "EnumResourceNamesW",
CharSet = CharSet.Unicode,
SetLastError = true
)
]
private static extern bool EnumResourceNamesWithName(
IntPtr ModuleHandle,
Res

Similar Threads:

1.Win32 Icon Resource for C# Project

I want to add multiple icons to my C# assembly (exe/dll). Visual Studio .NET 
doesn't support this.

It seems it can be done by using a Win32 .rc file which is compiled into a 
.res file, and then linked into the assembly by using the /win32icon or 
/win32res switch on the csc.exe or vbc.exe command line compiler.

BUT there is no support for this in Visual Studio .NET. I have a large 
Visual Studio project, and I cannot compile it from the command line every 
time. Howcome VS.NET doesn't support this and how can I make it work?

Please, waiting for Visual Studio 2005 or using a C++ project to do it is 
not a good enough answer for me. There has to be a way... 


2.Resources 'file1' and 'file2' have the same manifest resource name 'name'

I created an aspx file and ascx file with the same base name.  This gave me
the above error.

The help on this says rename file1 and file2 which I have done ( renamed my
original aspx and ascx files in solution explorer), but I still get this
error when building my project!

How do I solve this problem?

I'm using VS.Net2003

Thanks
Martin


3.Getting the names of all the REsources embedded in a REsource File

4.Loading Icon Resource from Win32 DLL

Is there a nice way in the .NET framework to load an icon resource that is
embedded within a Win32 DLL?  I noticed that the SystemIcons class comes
close (it is probably invoking the same Win32 call I need to invoke), but
doesn't allow me to specify an icon name.

I have also looked at the Icon class, but it doesn't seem to have anything
to do what I want either.  I would like to avoid having to use interop to
get the HICON and the create an Icon class.

Thanks, Tyler


5.Resources have the same manifest resource name

Resources 'Beneficiary.aspx.resx' and 'OveraAge.aspx.resx' have the
same manifest resource name 'Enroll.Beneficiary.resources'.

Umm... what's this mean?  The first two are aspx page resource files.
I don't know what Enroll.Beneficiary.resources is, I don't have a page
by that name.  The entire project is called Enroll.  What's VS talking
about?

Thanks!

6. "Resources... have the same manifest resource name" error

7. Resource manager problem: naming for embedded resource.

8. getting small icon from embded icon resource



Return to C#

 

Who is online

Users browsing this forum: No registered users and 68 guest