⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nativemethods.cs

📁 语音视频功能 里面实现了基本的QQ与语音对话
💻 CS
字号:
using System;
using System.Runtime.InteropServices;

namespace ToolTipLibrary
{
	/// <summary>
	/// A static class that exposes some Win32 P/Invoke methods and structures.
	/// </summary>
	public sealed class NativeMethods
	{
		public static readonly IntPtr HWND_TOPMOST;
		
		public const int WS_POPUP = -2147483648;

		/// <summary>
		/// Initializes static read-only members
		/// </summary>
		static NativeMethods()
		{
			HWND_TOPMOST = new IntPtr(-1);
		}

		/// <summary>
		/// Private constructor prevents this class from being created.
		/// </summary>
		private NativeMethods()
		{
		}

		/// <summary>
		/// Win32 TOOLINFO structure.
		/// </summary>
		public struct TOOLINFO
		{
			public TOOLINFO(int flags)
			{
				this.cbSize = Marshal.SizeOf(typeof(TOOLINFO));
				this.flags = flags;
				hwnd = IntPtr.Zero;
				uId = IntPtr.Zero;
				rect = new RECT(0, 0, 0, 0);
				hinst = IntPtr.Zero;
				text = "";
				lparam = IntPtr.Zero;
			}

			public int cbSize;
			public int flags;
			public IntPtr hwnd;
			public IntPtr uId;
			public NativeMethods.RECT rect;
			public IntPtr hinst;

			[MarshalAs(UnmanagedType.LPTStr)]
			public string text;

			public IntPtr lparam;
		}

		/// <summary>
		/// Win32 RECT structure for use with the TOOLINFO struct above.
		/// </summary>
		public struct RECT
		{
			public RECT(int left, int top, int right, int bottom)
			{
				this.left = left;
				this.top = top;
				this.right = right;
				this.bottom = bottom;
			}

			public RECT(System.Drawing.Point topLeft, System.Drawing.Size size)
			{
				this.left = topLeft.X;
				this.top = topLeft.Y;
				this.right = topLeft.X + size.Width;
				this.bottom = topLeft.Y + size.Height;
			}

			public int left;
			public int top; 
			public int right;
			public int bottom;
		}

		[DllImport("user32")]
		public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, 
			int x, int y, int cx, int cy, int flags);

		[DllImport("user32")]
		public static extern IntPtr SendMessage(
			IntPtr hWnd,
			int Msg,
			int wParam,
			ref TOOLINFO lParam
			);

		[DllImport("user32")]
		public static extern IntPtr SendMessage(
			IntPtr hWnd,
			int Msg,
			int wParam,
			int lParam);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -