C # windows api call example,

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.