How to import "user32.dll'' from C# application [modified]
-
Hello, I want to do some windows API operation from C#. and for that i want to import user32.dll please give me specific syntax for importing dll from the .cs page at runtime Rahul Patel, Software Engineer, Gateway Technolabs -- modified at 6:26 Tuesday 13th February, 2007
-
Hello, I want to do some windows API operation from C#. and for that i want to import user32.dll please give me specific syntax for importing dll from the .cs page at runtime Rahul Patel, Software Engineer, Gateway Technolabs -- modified at 6:26 Tuesday 13th February, 2007
-
[DllImport("user32")] private static extern UInt32 GetKeyboardLayoutList(int nBuff,ref int lpList);
-
Hello, I want to do some windows API operation from C#. and for that i want to import user32.dll please give me specific syntax for importing dll from the .cs page at runtime Rahul Patel, Software Engineer, Gateway Technolabs -- modified at 6:26 Tuesday 13th February, 2007
You need to use something like this: [DllImport("user32.dll")] < Declaration of function in user32.dll to be used here preceded by static extern > You have to declare each function you want to use in C# code in the above manner.Moreover you should write this code where you are declaring other variables of your class which is normally at the start of the class. After that you can use those functions in your C# code. Keep in mind that all the types used while declaring function prototypes must be C# types and must not contains Win32 or other languages types. Regards, Wasif Ehsan.