Listening to another window resize events in C#

后端 未结 4 684
Happy的楠姐
Happy的楠姐 2020-12-04 20:01

I am implementing a small application (observer) that needs to \"attach\" itself to the bottom of another window (observed). The latter is not a window inside the applicatio

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 20:36

    I suggest you use WinEvents:

    public delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime);
    
        [DllImport("user32.dll")]
        public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
    

    See also:event hooks

提交回复
热议问题