2014年1月20日 星期一

C++/CLI call MessageBox(Unmanaged)

using namespace System;
using namespace System::Runtime::InteropServices;

//typedef void* HWND;
[DllImport("User32.dll", EntryPoint = "FindWindow")]
extern "C" Int32 SW32Api_FindWindow (String^ lpClassName,String^ lpWindowName);
[DllImport("User32.dll", EntryPoint = "SendMessage")]
extern "C" Int32 SW32Api_SendMessage(Int32 hWnd, UInt32 Msg, Int32 wParam, Int32 lParam);
[DllImport("User32.dll", EntryPoint = "MessageBox", CharSet=CharSet::Auto)]
extern "C" Int32 SW32Api_MessageBox(Int32 hwnd, String^ Contain, String^ caption, UInt32 type);

沒有留言:

張貼留言