Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://codecav.blogspot.in/
- IntPtr title = Marshal.StringToHGlobalAnsi("Title");
- IntPtr msg = Marshal.StringToHGlobalAnsi("Message");
- IntPtr[] args = {IntPtr.Zero, msg, title, (IntPtr) (MessageBoxButtons.YesNo)};
- IntPtr retValue;
- bool res = DynamicApi.TryExecute("user32.dll", "MessageBoxA", args, out retValue);
- if (res)
- {
- MessageBox.Show("Return value: " + retValue.ToString("D"));
- }
- Marshal.FreeHGlobal(title);
- Marshal.FreeHGlobal(msg);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement