.NETに関するmiyakawa_takuのブックマーク (1)

  • P/Invoke - Wikipedia

    P/Invokeの宣言は、System.Runtime.InteropServices.DllImportAttribute属性をメソッドの宣言につけることで行う。 次のC#コード例では、user32.dll内に定義されているFindWindow関数を呼び出している。 using System.Runtime.InteropServices; namespace Example { class ExampleClass { // FindWindowのアンマネージシグネチャは HWND FindWindow(LPCTSTR, LPCTSTR) [DllImport("user32.dll")] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); public void Test(string w

  • 1