{"id":2559,"date":"2019-04-24T22:34:25","date_gmt":"2019-04-25T02:34:25","guid":{"rendered":"http:\/\/ninecrows.com\/career\/?p=2559"},"modified":"2019-04-24T13:48:18","modified_gmt":"2019-04-24T17:48:18","slug":"more-fun-with-pinvoke","status":"publish","type":"post","link":"https:\/\/ninecrows.com\/career\/2019\/04\/24\/more-fun-with-pinvoke\/","title":{"rendered":"More Fun with PInvoke"},"content":{"rendered":"\n<p>I&#8217;m getting more comfortable with PInvoke from C#. I&#8217;ve been using a <a href=\"https:\/\/www.pinvoke.net\/index.aspx\">web site<\/a> that contains a pretty wide variety of recipes for getting at Win32 API calls with PInvoke.<\/p>\n\n\n\n<p>At some point soon I need to take a look at the <a fgid=\"23898\" href=\"https:\/\/www.nuget.org\/packages\/WindowsAPICodePack-Core\/\">WindowsAPICodePack-Core <\/a>which appears to have pre-built versions of some of these things. For now I&#8217;m happy that I&#8217;m getting closer to the point where I know how to invoke most API calls directly using PInvoke.<\/p>\n\n\n\n<p>I do wish there was a more comprehensive reference document discussing all of the capabilities and ins and outs of using this facility. As is there are examples and specific documentation for some items (I&#8217;ve been using my copy of <a fgid=\"26154\" href=\"https:\/\/www.amazon.com\/NET-2-0-Interoperability-Recipes-Problem-Solution\/dp\/B01FGLST96\/ref=sr_1_fkmrnull_3?keywords=interoperability+recipes&amp;qid=1556127715&amp;s=gateway&amp;sr=8-3-fkmrnull\">.NET 2.0 Interoperability Recipes: A Problem-Solution Approach<\/a> to work out the basics and the PInvoke web site to extend that to more complicated examples.<\/p>\n\n\n\n<p>I&#8217;ve put some of the sample code I&#8217;ve been playing with on GitHub at <a fgid=\"32488\" href=\"https:\/\/github.com\/ninecrows\/DupScan\">DupScan<\/a>. This project is again code aimed at deduplicating file trees for archiving and management. The big driver here is the unique file ID API. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m getting more comfortable with PInvoke from C#. I&#8217;ve been using a web site that contains a pretty wide variety of recipes for getting at Win32 API calls with PInvoke. At some point soon I need to take a look at the WindowsAPICodePack-Core which appears to have pre-built versions of some of these things. For &hellip; <a href=\"https:\/\/ninecrows.com\/career\/2019\/04\/24\/more-fun-with-pinvoke\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">More Fun with PInvoke<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[72,43,7,44],"tags":[],"class_list":["post-2559","post","type-post","status-publish","format-standard","hentry","category-c-topics","category-c","category-topics","category-win32"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7F2Qc-Fh","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/2559"}],"collection":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/comments?post=2559"}],"version-history":[{"count":2,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/2559\/revisions"}],"predecessor-version":[{"id":2561,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/2559\/revisions\/2561"}],"wp:attachment":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/media?parent=2559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/categories?post=2559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/tags?post=2559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}