{"published":"2026-08-17 20:22:05","author_url":"https://blog.hatena.ne.jp/potisan/","author_name":"potisan","image_url":null,"url":"https://potisan-programming-memo.hatenablog.jp/entry/2026/08/17/202205","categories":["C#","Windows"],"description":"C#\u304b\u3089Shell.Application\u3092\u4f7f\u3046\u5834\u5408\u306f[STAThread]\u306e\u6307\u5b9a\u304c\u5fc5\u8981\u307f\u305f\u3044\u3067\u3059\u3002\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3046\u3068\u81ea\u52d5\u7684\u306b[MTAThread]\u306b\u306a\u308b\u305f\u3081\u304bvar shell = new Shell();\u3067System.InvalidCastException\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002 \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002 // \u30bf\u30fc\u30b2\u30c3\u30c8OS\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u4e0d\u8981\u3067\u3059\u3002 [assembly: SupportedOSPlatform(\"windows\")] // Main\u95a2\u6570\u306e\u305f\u3081\u306b\u5fc5\u8981\u3067\u3059\u3002 static class Program { // [STAThre\u2026","provider_name":"Hatena Blog","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2026%2F08%2F17%2F202205\" title=\"C#&amp;Windows Shell.Application\u3092\u4f7f\u3046\u5834\u5408\u306f[STAThread]\u304c\u5fc5\u8981 - potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","blog_url":"https://potisan-programming-memo.hatenablog.jp/","height":"190","title":"C#&Windows Shell.Application\u3092\u4f7f\u3046\u5834\u5408\u306f[STAThread]\u304c\u5fc5\u8981","type":"rich","blog_title":"potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2","width":"100%"}