After few minutes of successfull running I get this error in my application. Asistente para la depuración administrada ‘CallbackOnCollectedDelegate’ Se realizó una devolución de llamada al delegado recolectado de tipo ‘Threads!Threads.Hud+NativeMethods+WinEventDelegate::Invoke’. Since I cant figure out which part of the code is in responsible for this issue, I’m posting the complete class here. (I guess […]
Categories
CallbackOnCollectedDelegate detected
- Post author By Full Stack
- Post date September 25, 2019
- No Comments on CallbackOnCollectedDelegate detected
- Tags -8 /*GWL_HWNDPARENT*/, (int)Hud.MousePosition.X - move.Left, (int)Hud.MousePosition.Y - move.Top, (uint)0, (uint)processID, 0); Formularios F = new Formularios(); Rect move = new Rect(); //hwnd = NativeMethods.FindWindow(null, After few minutes of successfull running I get this error in my application. Asistente para la depuración administrada 'CallbackOnCollectedD, CharSet = CharSet.Auto)] public static extern IntPtr SetWindowLong(IntPtr hWnd, EntryPoint = "FindWindowA")] public static extern IntPtr FindWindow(string sClass, EntryPoint = "SetWindowLong", EVENT_OBJECT_DESTROY, EVENT_OBJECT_LOCATIONCHANGE, EVENT_SYSTEM_MOVESIZEEND, EventArgs e) { car(); } public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; [DllImpor, HT_CAPTION, hwnd); Debug.WriteLine("EVENT_SYSTEM_MOVESIZEEND"); } else if (eventType == EVENT_OBJECT_DESTROY) {, hwnd); Debug.WriteLine("EVENT_SYSTEM_MOVESIZESTART"); } else if (eventType == EVENT_SYSTEM_MOVESIZEEND), I'm posting the complete class here. (I guess it has no issue with my other classes) private void WinEventProc(IntPtr hWinEventHook, int idChild, int idObject, int lParam); [DllImportAttribute("user32.dll")] public static extern bool ReleaseCapture(); private void Hud_MouseDown(object se, int Msg, int nIndex, int wParam, IntPtr dwNewLong); [DllImport("user32.dll", IntPtr hmodWinEventProc, IntPtr hWnd, IntPtr.Zero, JugadoresMesa); //label2.Text = "x:" + Hud.MousePosition.X.ToString() + "y:" + Hud.MousePosition.Y.ToString(); } }, JugadoresMesa); this.Left = move.Left + Convert.ToInt32(f.DataTable.Rows[0][0]); this.Top = move.Top + Convert.ToInt3, out processID); //NativeMethods.SetWinEventHook(EVENT_SYSTEM_MOVESIZESTART, out uint lpdwProcessId); IntPtr hwnd; uint processID = 0; public void car() { Rect move = new Rect(); //t, ref move); F.updateFormulario(NumJugador, ref move); Formularios f = new Formularios(); f.posicionformbynumjugador(NumJugador, ref move); mover(move); } public delegate void posicion(); public void mover(Rect move) { Formularios f = n, ref Rect rectangle); [DllImport("user32.dll", SetLastError = true)] static extern uint GetWindowThreadProcessId(IntPtr hWnd, string sWindow); } [DllImport("user32.dll", System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { ReleaseCapture(); S, Tituloventana); GetWindowThreadProcessId(hwnd, Tituloventana); NativeMethods.GetWindowRect(hwnd, Tituloventana)) { this.Close(); Debug.WriteLine("EVENT_SYSTEM_MOVESIZEEND"); }, uint dwEventThread, uint dwFlags); public delegate void WinEventDelegate(IntPtr hWinEventHook, uint dwmsEventTime) { Rect move = new Rect(); if (eventType == EVENT_SYSTEM_MOVESIZESTART) { NativeM, uint dwmsEventTime); [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hwnd, uint eventMax, uint eventType, uint idProcess, uint idThread, WINEVENT_OUTOFCONTEXT); //NativeMethods.SetWinEventHook(EVENT_OBJECT_DESTROY, WINEVENT_OUTOFCONTEXT); NativeMethods.GetWindowRect(hwnd, WINEVENT_OUTOFCONTEXT); NativeMethods.SetWinEventHook(EVENT_SYSTEM_MOVESIZESTART, WinEventDelegate lpfnWinEventProc, WinEventProc, WM_NCLBUTTONDOWN