M Morten Wennevik Dec 16, 2004 #2 Hi KL, You use P/Invoke (Platform Invoke) with DllImport (found in system.Runtime.InteropServices). Win 32 API code HWND FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName); To call this method put something like this in your code (C#) [DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); There is more to DllImport that lets you rename the methodname and specify unicode etc, but this is the basic way.
Hi KL, You use P/Invoke (Platform Invoke) with DllImport (found in system.Runtime.InteropServices). Win 32 API code HWND FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName); To call this method put something like this in your code (C#) [DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); There is more to DllImport that lets you rename the methodname and specify unicode etc, but this is the basic way.
G Guest Dec 16, 2004 #3 Don't know if I can point to one good article on PInvoke, but wrapping unmanaged dlls has been covered in parts all over the net. Take a look at this: http://home.comcast.net/~victorhansonsmith/professional/writing_samples/thats_a_wrap.html It get's you started. I have a lot of wrapping info (VB) on my weblog, mkenyo2.blogspot.com Also, try this: http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp
Don't know if I can point to one good article on PInvoke, but wrapping unmanaged dlls has been covered in parts all over the net. Take a look at this: http://home.comcast.net/~victorhansonsmith/professional/writing_samples/thats_a_wrap.html It get's you started. I have a lot of wrapping info (VB) on my weblog, mkenyo2.blogspot.com Also, try this: http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp