• 大小: 0.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-24
  • 语言: C#
  • 标签: 移动  

资源简介

Messgebox移动到中心

资源截图

代码片段和文件信息

using System;
using System.Runtime.InteropServices;
using System.Text;

namespace CenterForm
{
    internal sealed class CbtHook : WindowHook
    {
        public CbtHook() : base(HookType.WH_CBT)
        {
        }

        public delegate void CbtEventHandler(object sender CbtEventArgs e);

        public event CbtEventHandler WindowCreate;
        public event CbtEventHandler WindowDestroy;
        public event CbtEventHandler WindowActivate;

        protected override int CoreHookProc(int code IntPtr wParam IntPtr lParam)
        {
            switch ((CbtHookAction)code)
            {
                case CbtHookAction.HCBT_CREATEWND:
                    OnWindowCreate(wParam lParam);
                    break;
                case CbtHookAction.HCBT_DESTROYWND:
                    OnWindowDestroy(wParam lParam);
                    break;
                case CbtHookAction.HCBT_ACTIVATE:
                    OnWindowActivate(wParam lParam);
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-02-02 15:12  bin\
     目录           0  2017-02-02 15:13  bin\Debug\
     文件       14848  2017-02-02 15:21  bin\Debug\CenterForm.exe
     文件       34304  2017-02-02 15:21  bin\Debug\CenterForm.pdb
     文件       21656  2017-02-02 15:18  bin\Debug\CenterForm.vshost.exe
     目录           0  2017-02-02 15:12  bin\Release\
     文件        2903  2013-09-22 14:53  CbtHook.cs
     文件        3076  2017-02-02 15:18  CenterForm.csproj
     文件         988  2017-02-02 15:21  CenterForm.sln
     文件        5213  2013-09-22 15:12  CenterWindow.cs
     文件         920  2017-02-02 15:21  Form1.cs
     文件        3003  2017-02-02 15:21  Form1.Designer.cs
     文件        6020  2017-02-02 15:21  Form1.resx
     目录           0  2017-02-02 15:08  obj\
     目录           0  2017-02-02 15:21  obj\Debug\
     文件         729  2017-02-02 15:18  obj\Debug\CenterForm.csproj.FileListAbsolute.txt
     文件         774  2017-02-02 15:21  obj\Debug\CenterForm.csproj.GenerateResource.Cache
     文件        1759  2017-02-02 15:11  obj\Debug\CenterForm.csprojResolveAssemblyReference.cache
     文件       14848  2017-02-02 15:21  obj\Debug\CenterForm.exe
     文件         180  2017-02-02 15:21  obj\Debug\CenterForm.Form1.resources
     文件       34304  2017-02-02 15:21  obj\Debug\CenterForm.pdb
     文件         791  2017-02-02 15:20  obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6791  2017-02-02 15:18  obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2017-02-02 15:08  obj\Debug\TempPE\
     文件         491  2013-09-22 14:51  Program.cs
     目录           0  2017-02-02 15:08  Properties\
     文件        2472  2013-09-22 14:52  WindowHook.cs
     文件        2068  2013-09-22 14:52  WndProcRetHook.cs

评论

共有 条评论