{"id":379,"date":"2013-01-02T17:50:51","date_gmt":"2013-01-02T06:50:51","guid":{"rendered":"http:\/\/blog.quppa.net\/?p=379"},"modified":"2013-01-02T17:50:51","modified_gmt":"2013-01-02T06:50:51","slug":"pinvoke-and-choosefont-comdlg32-dll","status":"publish","type":"post","link":"https:\/\/www.quppa.net\/blog\/2013\/01\/02\/pinvoke-and-choosefont-comdlg32-dll\/","title":{"rendered":"P\/Invoke and ChooseFont (Comdlg32.dll)"},"content":{"rendered":"<p><a title=\"Mister Goodcat: Silverlight 5 PInvoke fun - System Font Dialog\" href=\"http:\/\/www.pitorque.de\/MisterGoodcat\/post\/Silverlight-5-PInvoke-fun-System-Font-Dialog.aspx\">Mister Goodcat wrote a good article<\/a> a little while ago about using P\/Invoke in Silverlight 5 to display the native font chooser dialog with the <a title=\"MSDN: ChooseFont function\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms646914.aspx\">ChooseFont function<\/a>. I couldn\u2019t get the code working for a 64-bit executable, however, as the definition of the <a title=\"MSDN: CHOOSEFONT Structure\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms646832.aspx\">CHOOSEFONT structure on MSDN<\/a> he used as a basis for the managed implementation doesn\u2019t match with what\u2019s in the Windows SDK. I\u2019ve created a <a title=\"PInvoke.net: ChooseFont\" href=\"http:\/\/www.pinvoke.net\/default.aspx\/comdlg32\/ChooseFont.html\">page on PInvoke.net<\/a> for the function that includes a definition of CHOOSEFONT that works in both 32-bit and 64-bit versions of Windows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Font Chooser Dialog\" style=\"margin: 5px auto; border: 0px currentcolor; float: none; display: block; background-image: none;\" border=\"0\" alt=\"Screenshot of Font Chooser Dialog\" src=\"https:\/\/www.quppa.net\/blog\/wp-content\/uploads\/Font.png\" width=\"467\" height=\"505\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mister Goodcat wrote a good article a little while ago about using P\/Invoke in Silverlight 5 to display the native font chooser dialog with the ChooseFont function. I couldn\u2019t get the code working for a 64-bit executable, however, as the definition of the CHOOSEFONT structure on MSDN he used as a basis for the managed &hellip; <a href=\"https:\/\/www.quppa.net\/blog\/2013\/01\/02\/pinvoke-and-choosefont-comdlg32-dll\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;P\/Invoke and ChooseFont (Comdlg32.dll)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,9],"tags":[28,29,36,56,96],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-programming","category-windows","tag-c","tag-choosefont","tag-comdlg32","tag-fonts","tag-pinvoke"],"_links":{"self":[{"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/comments?post=379"}],"version-history":[{"count":0,"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/posts\/379\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/media?parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/categories?post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quppa.net\/blog\/wp-json\/wp\/v2\/tags?post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}