{"id":1361,"date":"2012-04-30T18:51:31","date_gmt":"2012-04-30T16:51:31","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1361"},"modified":"2012-04-28T13:49:45","modified_gmt":"2012-04-28T11:49:45","slug":"resource-tools-custom-resource-types","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1361","title":{"rendered":"Resource Tools: Custom Resource Types"},"content":{"rendered":"<p>This update for <a href=\"https:\/\/alax.info\/blog\/352\">Resource Tools<\/a> adds an option to access custom resource types, such as <code>FILE<\/code>, <code>TYPELIB<\/code>, <code>REGISTRY<\/code> etc. It lets enumerate the resource, and load\/save them. The COM interafce adds new <code>Items<\/code> property; the code snippet below accesses type library of <code>image2.dll<\/code> and saves it into external tyle library file <code>image2.tlb<\/code>:<\/p>\n<pre style=\"color: #000000; background: #ffffff;\">image <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000; font-weight: bold;\">new<\/span> <span style=\"color: #797997;\">ActiveXObject<\/span><span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">AlaxInfo.ResourceTools.Image<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nimage<span style=\"color: #808030;\">.<\/span>Initialize<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">C:<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">Windows<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">syswow64<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">imapi2.dll<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nimage<span style=\"color: #808030;\">.<\/span>Items<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">TYPELIB<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">.<\/span>Item<span style=\"color: #808030;\">(<\/span><span style=\"color: #008c00;\">1<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">.<\/span>SaveToFile<span style=\"color: #808030;\">(<\/span><span style=\"color: #0f4d75;\">null<\/span><span style=\"color: #808030;\">,<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">imapi2.tlb<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span><\/pre>\n<p>Additionally, <code>image.EndUpdate(false)<\/code> call makes the object close all references to the underlying file so that it can be available for other operations (e.g. overwrite), and the COM object might be further re-initialized and reused.<\/p>\n<p>Download links:<\/p>\n<ul>\n<li>Title: Alax.Info Resource Tools<\/li>\n<li>Version: 1.0.7<\/li>\n<li>Download (32-bit, Win32): <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/ResourceTools\/ResourceToolsSetup.msi\">ResourceToolsSetup.msi<\/a><\/li>\n<li>Download (64-bit, x64): <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/ResourceTools\/ResourceToolsSetup-x64.msi\">ResourceToolsSetup-x64.msi<\/a><\/li>\n<li>License: This software is free to use<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This update for Resource Tools adds an option to access custom resource types, such as FILE, TYPELIB, REGISTRY etc. It lets enumerate the resource, and load\/save them. The COM interafce adds new Items property; the code snippet below accesses type library of image2.dll and saves it into external tyle library file image2.tlb: image = new&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1361\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,12],"tags":[373,374,198,166,318,132],"class_list":["post-1361","post","type-post","status-publish","format-standard","hentry","category-resource-tools","category-technology","tag-rc","tag-res","tag-automation","tag-resource","tag-tool","tag-utility"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1361"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1361\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}