digitalmars.D.learn - Any WinAPI experts here?
- Andrej Mitrovic (15/15) Sep 05 2011 This is breaking my neck right now. I have two separate windows,
- Vladimir Panteleev (31/35) Sep 05 2011 diff --git a/raw.d b/raw.d
- Andrej Mitrovic (6/6) Sep 05 2011 Thanks, Vladimir. :)
This is breaking my neck right now. I have two separate windows, doing that. But instead what I get is an infinite loop. Somehow, the hiding and http://codepad.org/U956e2u6 The idea of using mosemove to hide/show a window is from an attempt to simulate menus in some other code, but anyway I can't figure out why is stationary. If you comment out either of the ShowWindow() calls, there will be no infinite loop. I'm hoping someone here has better knowledge than me about WinAPI before I reach for MSDN forums.
Sep 05 2011
On Mon, 05 Sep 2011 23:10:05 +0300, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:This is breaking my neck right now. I have two separate windows, doing that.diff --git a/raw.d b/raw.d index 6ce0256..8ea7c7c 100644 --- a/raw.d +++ b/raw.d -114,10 +114,15 LRESULT WndProc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_MOUSEMOVE: - static ulong count; - writeln(count++); - ShowWindow(hWindow1, SW_HIDE); - ShowWindow(hWindow1, SW_SHOW); + static LPARAM oldPosition; + if (lParam != oldPosition) + { + static ulong count; + writeln(count++); + ShowWindow(hWindow1, SW_HIDE); + ShowWindow(hWindow1, SW_SHOW); + oldPosition = lParam; + } return 0; case WM_DESTROY: I wouldn't think too much about it, the Windows GUI does a lot of weird things for the sake of compatibility etc. -- Best regards, Vladimir mailto:vladimir thecybershadow.net
Sep 05 2011
Thanks, Vladimir. :) I'm trying to use a minimal subset of the API (ironically, to avoid winapi bugs) for experimenting with Cairo. It's nice having the boilerplate of features already implemented such as clipped drawing and moving windows relative to their parent instead of relative to the screen.
Sep 05 2011