C # windows api call example,
Here is the running result:
Using System; using System. runtime. interopServices; using System. windows. forms; namespace HoverTreeWinForm {public partial class FormHewenqi: form {// <summary> /// http://hovertree.com/h/bjaf/v4y0b2l6.htm /// </summary> /// <param name = "h"> </param> /// <param name = "m"> </param> // <param name = "c"> </param> // <param name = "type"> </param>/ // <returns> </returns> [DllImport ("User32.dll")] public static extern int MessageBox (int h, string m, string c, int type); public FormHewenqi () {InitializeComponent ();} private void button_hewenqi_Click (object sender, EventArgs e) {MessageBox (0, "Hello Win32 API HoverTree", "", 4);} private void linkLabel_help_LinkClicked (object sender, LinkLabelLinkClickedEventArgs e) {System. diagnostics. process. start ("http://hovertree.com/h/bjaf/v4y0b2l6.htm ");}}}
Reprinted from: http://hovertree.com/h/bjaf/psjdasa2.htm
Source code download: http://pan.baidu.com/s/1bnPPgL5
Http://roucheng.cnblogs.com/
In the preceding example, the parent window handle is not specified in the pop-up window. After the pop-up window is displayed, you can operate the main form without closing it. For example, you can click the button multiple times to pop up multiple information boxes. To bring up the mode dialog box, first obtain the handle of the current form, see: http://hovertree.com/h/bjaf/8vw6i2yr.htm
Mode dialog box Demo: http://pan.baidu.com/s/1bnNN2b1 password: dq8u
Source code download: https://github.com/shangyuxian/HoverTree