アセンブリ情報まわり
アセンブリ情報を使うとファイル埋め込みとか色々でけて便利!
こうやって取得したあと、
//現在実行中のアセンブリを取得
Assembly thisExe = Assembly.GetExecutingAssembly();
これでリソース名げった〜。何故かハンドルが欲しい時は、
foreach (string resourceName in thisExe.GetManifestResourceNames())
{
Console.WriteLine(resourceName);
}
こんなのでいけますの。
//ハンドル取得
Module[] ms = thisExe.GetModules();
IntPtr hInstance = Marshal.GetHINSTANCE(ms[0]);
Console.WriteLine(hInstance.ToString());