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.