MCPcopy Create free account
hub / github.com/DrewKestell/BloogBot / FindWindowProc

Method FindWindowProc

BloogBot/ThreadSynchronizer.cs:108–120  ·  view source on GitHub ↗
(IntPtr hWnd, IntPtr lParam)

Source from the content-addressed store, hash-verified

106 }
107
108 static bool FindWindowProc(IntPtr hWnd, IntPtr lParam)
109 {
110 GetWindowThreadProcessId(hWnd, out int procId);
111 if (procId != Process.GetCurrentProcess().Id) return true;
112 if (!IsWindowVisible(hWnd)) return true;
113 var l = GetWindowTextLength(hWnd);
114 if (l == 0) return true;
115 var builder = new StringBuilder(l + 1);
116 GetWindowText(hWnd, builder, builder.Capacity);
117 if (builder.ToString() == "World of Warcraft")
118 windowHandle = (int)hWnd;
119 return true;
120 }
121
122 static void SendUserMessage() => SendMessage(windowHandle, WM_USER, 0, 0);
123 }

Callers

nothing calls this directly

Calls 1

ToStringMethod · 0.45

Tested by

no test coverage detected