static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: window.SetTimer(ID_TIMER, 1000); return(0); case WindowMessage.Timer: Windows.MessageBeep(); fFlipFlop = !fFlipFlop; window.Invalidate(); return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { RECT rect = window.GetClientRectangle(); using (BrushHandle brush = fFlipFlop ? Windows.CreateSolidBrush(255, 0, 0) : Windows.CreateSolidBrush(0, 0, 255)) { dc.FillRectangle(rect, brush); } } return(0); case WindowMessage.Destroy: window.KillTimer(ID_TIMER); Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
/// <summary> /// Callback function used with the SetWindowsHookEx function. /// The system calls this function every time a new mouse input event is about to be posted into a thread input queue. /// </summary> /// <param name="nCode">A code the hook procedure uses to determine how to process the message.</param> /// <param name="wParam">The identifier of the mouse message.</param> /// <param name="lParam">A pointer to an MSLLHOOKSTRUCT structure.</param> /// <returns></returns> private LRESULT lowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam) { int recode = findReCode(wParam); int idx = 0; foreach (IMouseListener listener in Loader.ActivatedFilters) { if (recode != -1 && idx++ <= recode) { continue; } FilterResult act = listener.msg(nCode, wParam, lParam); if (act == FilterResult.IgnoreFilters) { break; } else if (act == FilterResult.Continue) { continue; } #if DEBUG LSender.Send(this, $"prevent msg({nCode}, {wParam}, {lParam}) by filter {listener.Id}:'{listener.Name}'", Message.Level.Trace); #endif return(stopChainCode); } return(NativeMethods.CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam)); }
public static extern bool SendMessageCallbackW( WindowHandle hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam, SendAsyncProcedure lpCallBack, UIntPtr dwData);
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { dc.Rectangle(cxClient / 8, cyClient / 8, 7 * cxClient / 8, 7 * cyClient / 8); dc.MoveTo(0, 0); dc.LineTo(cxClient, cyClient); dc.MoveTo(0, cyClient); dc.LineTo(cxClient, 0); dc.Ellipse(cxClient / 8, cyClient / 8, 7 * cxClient / 8, 7 * cyClient / 8); dc.RoundRectangle(cxClient / 4, cyClient / 4, 3 * cxClient / 4, 3 * cyClient / 4, cxClient / 4, cyClient / 4); } return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { dc.MoveTo(0, cyClient / 2); dc.LineTo(cxClient, cyClient / 2); POINT[] apt = new POINT[1000]; for (int i = 0; i < apt.Length; i++) { apt[i].x = i * cxClient / apt.Length; apt[i].y = (int)(cyClient / 2 * (1 - Math.Sin(Math.PI * 2 * i / apt.Length))); } dc.Polyline(apt); } return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Size: cxBlock = lParam.LowWord / DIVISIONS; cyBlock = lParam.HighWord / DIVISIONS; return(0); case WindowMessage.LeftButtonDown: int x = lParam.LowWord / cxBlock; int y = lParam.HighWord / cyBlock; if (x < DIVISIONS && y < DIVISIONS) { fState[x, y] ^= true; RECT rect = new RECT { left = x * cxBlock, top = y * cyBlock, right = (x + 1) * cxBlock, bottom = (y + 1) * cyBlock }; window.InvalidateRectangle(rect, false); } else { ErrorMethods.MessageBeep(0); } return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { for (x = 0; x < DIVISIONS; x++) { for (y = 0; y < DIVISIONS; y++) { dc.Rectangle(x * cxBlock, y * cyBlock, (x + 1) * cxBlock, (y + 1) * cyBlock); if (fState[x, y]) { dc.MoveTo(x * cxBlock, y * cyBlock); dc.LineTo((x + 1) * cxBlock, (y + 1) * cyBlock); dc.MoveTo(x * cxBlock, (y + 1) * cyBlock); dc.LineTo((x + 1) * cxBlock, y * cyBlock); } } } } return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
protected override LRESULT HookProc(int code, WPARAM wParam, LPARAM lParam) { if (code == PInvoke.HC_ACTION && wParam == (nuint)PInvoke.WM_LBUTTONDOWN) { } return(base.HookProc(code, wParam, lParam)); }
/// <param name="nCode">A code that uses to determine how to process the message.</param> /// <param name="wParam">The identifier of the mouse message.</param> /// <param name="lParam">A pointer to an MSLLHOOKSTRUCT structure.</param> /// <returns></returns> public override FilterResult msg(int nCode, WPARAM wParam, LPARAM lParam) { if (SysMessages.Eq(wParam, SysMessages.WM_MOUSEMOVE)) { return(FilterResult.IgnoreFilters); } return(FilterResult.Continue); }
public static extern LRESULT SendMessageTimeoutW( WindowHandle hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam, SendMessageTimeoutOptions fuFlags, uint uTimeout, out UIntPtr lpdwResult);
private static LRESULT WindowProc(HWND hWnd, WM Msg, WPARAM wParam, LPARAM lParam) { if (CreatedWindows.TryGetValue(hWnd, out var window)) { return(window.WindowProc(Msg, wParam, lParam)); } return(DefWindowProc(hWnd, Msg, wParam, lParam)); }
/// <param name="nCode">A code that uses to determine how to process the message.</param> /// <param name="wParam">The identifier of the mouse message.</param> /// <param name="lParam">A pointer to an MSLLHOOKSTRUCT structure.</param> /// <returns></returns> public override FilterResult msg(int nCode, WPARAM wParam, LPARAM lParam) { if (!isLMR(wParam)) { return(FilterResult.Continue); } return(lmr.process(nCode, wParam, lParam)); }
public bool isFlag(MouseState.Flags flags, WPARAM wParam, uint code1, uint code2) { if ((listener.Handler & flags) != 0 && (SysMessages.EqOr(wParam, code1, code2))) { return(true); } return(false); }
protected override LRESULT HookProc(int code, WPARAM wParam, LPARAM lParam) { if (code == PInvoke.HC_ACTION && wParam == (nuint)PInvoke.WM_KEYDOWN) { var kbdllhook = Marshal.PtrToStructure <KBDLLHOOKSTRUCT>(lParam); PerformKeyDown?.Invoke((VIRTUAL_KEY)kbdllhook.vkCode); } return(base.HookProc(code, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.LeftButtonDown: iCount = 0; window.Invalidate(true); return(0); case WindowMessage.MouseMove: // Machines are way to fast to make this look interesting now, adding TakeEvery if ((MouseKey)wParam == MouseKey.LeftButton && iCount < MAXPOINTS && (sampleCount++ % TakeEvery == 0)) { pt[iCount].x = lParam.LowWord; pt[iCount++].y = lParam.HighWord; using (DeviceContext dc = window.GetDeviceContext()) { dc.SetPixel(lParam.LowWord, lParam.HighWord, 0); } } return(0); case WindowMessage.LeftButtonUp: window.Invalidate(false); return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { Windows.SetCursor(CursorId.Wait); Windows.ShowCursor(true); for (int i = 0; i < iCount - 1; i++) { for (int j = i + 1; j < iCount; j++) { dc.MoveTo(pt[i].x, pt[i].y); dc.LineTo(pt[j].x, pt[j].y); } } Windows.ShowCursor(false); Windows.SetCursor(CursorId.Arrow); } return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: for (int x = 0; x < DIVISIONS; x++) { for (int y = 0; y < DIVISIONS; y++) { hwndChild[x, y] = Windows.CreateWindow( szChildClass, null, WindowStyles.ChildWindow | WindowStyles.Visible, ExtendedWindowStyles.None, 0, 0, 0, 0, window, (IntPtr)(y << 8 | x), window.GetWindowLong(WindowLong.InstanceHandle), IntPtr.Zero); } } return(0); case WindowMessage.Size: cxBlock = lParam.LowWord / DIVISIONS; cyBlock = lParam.HighWord / DIVISIONS; for (int x = 0; x < DIVISIONS; x++) { for (int y = 0; y < DIVISIONS; y++) { hwndChild[x, y].MoveWindow( x * cxBlock, y * cyBlock, cxBlock, cyBlock, true); } } return(0); case WindowMessage.LeftButtonDown: ErrorMethods.MessageBeep(BeepType.Ok); return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
protected bool isLMR(WPARAM wParam) { if (SysMessages.EqOr(wParam, SysMessages.WM_LBUTTONDOWN, SysMessages.WM_LBUTTONUP, SysMessages.WM_MBUTTONDOWN, SysMessages.WM_MBUTTONUP, SysMessages.WM_RBUTTONDOWN, SysMessages.WM_RBUTTONUP)) { return(true); } return(false); }
public override FilterResult process(int nCode, WPARAM wParam, LPARAM lParam) { if (parent.Data == null) { parent.Data = new TData(); } var v = (TData)parent.Data; lock (sync) { if (toAbortNext && SysMessages.Eq(wParam, CodeUp)) { toAbortNext = false; LSender.Send(this, $"Prevent '{wParam}' because of previous mixed code.", Message.Level.Info); return(FilterResult.Abort); } if (isBtnDown && SysMessages.Eq(wParam, CodeDown)) { toAbortNext = true; LSender.Send(this, $"Found mixed {wParam}", Message.Level.Info); parent.trigger(); return(FilterResult.Abort); } if (!v.onlyDownCodes && (isBtnUp && SysMessages.Eq(wParam, CodeUp))) { LSender.Send(this, $"Found mixed {wParam}", Message.Level.Info); parent.trigger(); return(FilterResult.Abort); } if (SysMessages.Eq(wParam, CodeDown)) { isBtnDown = true; isBtnUp = false; } else if (SysMessages.Eq(wParam, CodeUp)) { isBtnDown = false; isBtnUp = true; } #if DEBUG LSender.Send(this, $"Continue {wParam}", Message.Level.Trace); #endif return(FilterResult.Continue); } }
protected static Int32 __WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { DuiHostFormBase hostForm = null; if (msg == WindowMessages.WM_NCCREATE) { var lpcs = (LPCREATESTRUCT)Marshal.PtrToStructure((IntPtr)lParam, typeof(LPCREATESTRUCT)); IntPtr pHostForm = new IntPtr(lpcs.lpCreateParams); var gch = GCHandle.FromIntPtr(pHostForm); hostForm = gch.Target as DuiHostFormBase; if (hostForm != null) { hostForm.m_hWnd = hWnd; NativeMethods.SetWindowLong(hWnd, (int)SetWindowLongOffsets.GWL_USERDATA, pHostForm); } } else { IntPtr pHostForm = NativeMethods.GetWindowLong(hWnd, SetWindowLongOffsets.GWL_USERDATA); try { var gch = GCHandle.FromIntPtr(pHostForm); hostForm = gch.Target as DuiHostFormBase; } catch { } if (msg == WindowMessages.WM_NCDESTROY && hostForm != null) { LRESULT lRes = NativeMethods.CallWindowProc(hostForm.m_defWindowProc, hWnd, (int)msg, (IntPtr)wParam, (IntPtr)lParam).ToInt32(); NativeMethods.SetWindowLong(hWnd, (int)SetWindowLongOffsets.GWL_USERDATA, IntPtr.Zero); if (hostForm.m_bSubclassed) { hostForm.Unsubclass(); } hostForm.m_hWnd = IntPtr.Zero; hostForm.OnFinalMessage(hWnd); return(lRes); } } if (hostForm != null) { return(hostForm.HandleMessage(msg, wParam, lParam)); } else { return(NativeMethods.DefWindowProc(hWnd, (int)msg, new IntPtr(wParam), new IntPtr(lParam)).ToInt32()); } }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: window.SetTimer(ID_TIMER, 1000, TimerProcedure); return(0); case WindowMessage.Destroy: window.KillTimer(ID_TIMER); Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
/// <summary> /// Checks equality by OR logic. /// </summary> /// <returns>true if at least one from barr is equal to a.</returns> public static bool EqOr(WPARAM a, params uint[] barr) { if (barr == null) { return(false); } foreach (uint b in barr) { if (Eq(a, b)) { return(true); } } return(false); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: hBrushRed = Windows.CreateSolidBrush(255, 0, 0); window.SetTimer(ID_TIMER, 1000); return(0); case WindowMessage.SettingChange: f24Hour = Windows.LocaleInfo.GetIs24HourClock(); fSuppress = Windows.LocaleInfo.GetHoursHaveLeadingZeros(); window.Invalidate(true); return(0); case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return(0); case WindowMessage.Timer: window.Invalidate(true); return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { dc.SetMapMode(MapMode.Isotropic); dc.SetWindowExtents(276, 72); dc.SetViewportExtents(cxClient, cyClient); dc.SetWindowOrigin(138, 36); dc.SetViewportOrigin(cxClient / 2, cyClient / 2); dc.SelectObject(StockPen.Null); dc.SelectObject(hBrushRed); DisplayTime(dc, f24Hour, fSuppress); } return(0); case WindowMessage.Destroy: window.KillTimer(ID_TIMER); hBrushRed.Dispose(); Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
/// <summary>Processes messages sent to the instance.</summary> /// <param name="Msg">The message.</param> /// <param name="wParam">Additional message information.</param> /// <param name="lParam">Additional message information.</param> /// <returns>The result of processing <paramref name="Msg" />.</returns> public LRESULT WindowProc(WM Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM.MOVE: { var x = lParam.LOWORD(); var y = lParam.HIWORD(); _bounds.Location = new Point2D(x, y); return(0); } case WM.SIZE: { var width = lParam.LOWORD(); var height = lParam.HIWORD(); _bounds.Size = new Size2D(width, height); return(0); } case WM.ACTIVATE: { var activateCmd = (WA)(wParam.LOWORD()); Debug.Assert(Enum.IsDefined(typeof(WA), activateCmd)); _isActive = (activateCmd != WA.INACTIVE); return(0); } case WM.SHOWWINDOW: { var shown = (BOOL)(unchecked ((int)((uint)(wParam)))); _isVisible = shown; return(0); } default: { return(DefWindowProc(_hWnd, Msg, wParam, lParam)); } } }
public FilterResult process(int nCode, WPARAM wParam, LPARAM lParam) { if (isFlag(MouseState.Flags.Left, wParam, SysMessages.WM_LBUTTONDOWN, SysMessages.WM_LBUTTONUP)) { return(data[MouseState.Flags.Left].process(nCode, wParam, lParam)); } if (isFlag(MouseState.Flags.Middle, wParam, SysMessages.WM_MBUTTONDOWN, SysMessages.WM_MBUTTONUP)) { return(data[MouseState.Flags.Middle].process(nCode, wParam, lParam)); } if (isFlag(MouseState.Flags.Right, wParam, SysMessages.WM_RBUTTONDOWN, SysMessages.WM_RBUTTONUP)) { return(data[MouseState.Flags.Right].process(nCode, wParam, lParam)); } return(FilterResult.Continue); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: window.SetTimer(ID_TIMER, 1000); stPrevious = Windows.GetLocalTime(); return 0; case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return 0; case WindowMessage.Timer: SYSTEMTIME st = Windows.GetLocalTime(); bool fChange = st.wHour != stPrevious.wHour || st.wMinute != stPrevious.wMinute; using (DeviceContext dc = window.GetDeviceContext()) { SetIsotropic(dc, cxClient, cyClient); dc.SelectObject(StockPen.White); DrawHands(dc, stPrevious, fChange); dc.SelectObject(StockPen.Black); DrawHands(dc, st, true); } stPrevious = st; return 0; case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { SetIsotropic(dc, cxClient, cyClient); DrawClock(dc); DrawHands(dc, stPrevious, true); } return 0; case WindowMessage.Destroy: window.KillTimer(ID_TIMER); Windows.PostQuitMessage(0); return 0; } return Windows.DefaultWindowProcedure(window, message, wParam, lParam); }
private LRESULT Callback(int nCode, WPARAM wParam, LPARAM lParam) { try { if (nCode >= 0 && InternalCallback(nCode, wParam, lParam)) { return(new LRESULT(-1)); } } catch (Exception exception) { OnExceptionOccurred(exception); } return(PInvoke.CallNextHookEx( hhk: null, nCode: nCode, wParam: wParam, lParam: lParam)); }
/// <param name="nCode">A code that uses to determine how to process the message.</param> /// <param name="wParam">The identifier of the mouse message.</param> /// <param name="lParam">A pointer to an MSLLHOOKSTRUCT structure.</param> /// <returns></returns> public override FilterResult msg(int nCode, WPARAM wParam, LPARAM lParam) { if (SysMessages.Eq(wParam, SysMessages.WM_LBUTTONDOWN)) { LSender.Send(this, $"WM_LBUTTONDOWN", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_LBUTTONUP)) { LSender.Send(this, $"WM_LBUTTONUP", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_RBUTTONDOWN)) { LSender.Send(this, $"WM_RBUTTONDOWN", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_RBUTTONUP)) { LSender.Send(this, $"WM_RBUTTONUP", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_MBUTTONDOWN)) { LSender.Send(this, $"WM_MBUTTONDOWN", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_MBUTTONUP)) { LSender.Send(this, $"WM_MBUTTONUP", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_MOUSEWHEEL)) { LSender.Send(this, $"WM_MOUSEWHEEL", Message.Level.Info); } else if (SysMessages.Eq(wParam, SysMessages.WM_MOUSEHWHEEL)) { LSender.Send(this, $"[WM_MOUSEHWHEEL]", Message.Level.Info); } //unchecked { // ++TriggerCount; //} return(FilterResult.Continue); }
static int WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: { if (wParam == BN_CLICKED && lParam == (rtl.LPARAM)button) { MessageBox(hWnd, "You clicked, hello there!", szTitle, 0); } break; } case WM_CLOSE: { PostQuitMessage(0); break; } } return(DefWindowProc(hWnd, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Size: cxClient = lParam.LowWord; cyClient = lParam.HighWord; return(0); case WindowMessage.Paint: POINT[] apt = new POINT[10]; using (DeviceContext dc = window.BeginPaint()) { dc.SelectObject(StockBrush.Gray); for (int i = 0; i < 10; i++) { apt[i].x = cxClient * aptFigure[i].x / 200; apt[i].y = cyClient * aptFigure[i].y / 100; } dc.SetPolyFillMode(PolyFillMode.Alternate); dc.Polygon(apt); for (int i = 0; i < 10; i++) { apt[i].x += cxClient / 2; } dc.SetPolyFillMode(PolyFillMode.Winding); dc.Polygon(apt); } return(0); case WindowMessage.Destroy: Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
static LRESULT WindowProcedure(WindowHandle window, WindowMessage message, WPARAM wParam, LPARAM lParam) { switch (message) { case WindowMessage.Create: dcScreen = Windows.CreateDeviceContext("DISPLAY", null); window.SetTimer(ID_TIMER, 100); return(0); case WindowMessage.Timer: POINT pt = Windows.GetCursorPosition(); cr = dcScreen.GetPixel(pt); // Not sure why the sample did this // dcScreen.SetPixel(pt, 0); if (cr != crLast) { crLast = cr; window.Invalidate(false); } return(0); case WindowMessage.Paint: using (DeviceContext dc = window.BeginPaint()) { dc.SelectObject(StockFont.SystemFixed); RECT rc = window.GetClientRectangle(); dc.DrawText($"0x{cr.R:X2} 0x{cr.G:X2} 0x{cr.B:X2}", rc, TextFormat.SingleLine | TextFormat.Center | TextFormat.VerticallyCenter); } return(0); case WindowMessage.Destroy: dcScreen.Dispose(); window.KillTimer(ID_TIMER); Windows.PostQuitMessage(0); return(0); } return(Windows.DefaultWindowProcedure(window, message, wParam, lParam)); }
internal static extern LRESULT CallWindowProc(WNDPROC lpPrevWndFunc, HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam);
internal static extern LRESULT SendMessage(HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam);
internal static extern BOOL PostMessage( HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam );