Hi James !
Thanks for your quick reaction and for the patch, I will have a look later
on.
If the patch activates the system menu at the left upper corner of the
window (ie. The left part of the title bar), I think it's normal because on
Windows, when you left-click or right-click on the icon which is placed at
the left (upper corner) part of the (window)titlebar, the system menu indeed
appears.
So stop doing it and fix it. I know~ locating all of
them is a big head
ache but remember what I always type, don't build code on top
of hacks on
hacks!
For sure. But since I wanted a thing which worked yesterday before
committing it in the branch, I did the hack but I wrote a long commit
message about its existence to attract attention to other people (who work
in the win32 subsystem ;) ) that something doesn't work as expected and that
they have to look at the problem.
Hermès
-----Message d'origine-----
De : ros-dev-bounces(a)reactos.org [mailto:ros-dev-bounces@reactos.org] De la
part de James Tabor
Envoyé : lundi 1 avril 2013 09:26
À : ReactOS Development List
Objet : [ros-dev] [ros-diffs] [hbelusca] 58632: [KERNEL32-CONSRV] Implement
(Get/Set)ConsoleDisplayMode. [PSDK] Reorganize wincon.h a little bit and add
few new flags from MSDN / Wine's wincon.h (which was up-to-date compared
t...
Hi,
Here is a patch for the missing WM_NCRBUTTONUP. It's wine code. Well it
breaks the mouse pointer set position and activates the system menu at the
left upper corner. Looks like to many hack being made to bypass
unimplemented functions. So stop doing it and fix it. I know~ locating all
of them is a big head ache but remember what I always type, don't build code
on top of hacks on hacks!
James
Index: win32ss/user/user32/windows/defwnd.c
===================================================================
--- win32ss/user/user32/windows/defwnd.c (revision 58633)
+++ win32ss/user/user32/windows/defwnd.c (working copy)
@@ -22,6 +22,7 @@
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point); LRESULT
DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam); LRESULT
DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam);
+LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam
+);
void FASTCALL MenuInitSysMenuPopup(HMENU Menu, DWORD Style, DWORD ClsStyle,
LONG HitTest ); void MENU_EndMenu( HWND );
@@ -1101,14 +1102,7 @@
}
case WM_NCRBUTTONDOWN:
- {
- /* in Windows, capture is taken when right-clicking on
the caption bar */
- if (wParam == HTCAPTION)
- {
- SetCapture(hWnd);
- }
- break;
- }
+ return NC_HandleNCRButtonDown( hWnd, wParam, lParam );
case WM_RBUTTONUP:
{
Index: win32ss/user/user32/windows/nonclient.c
===================================================================
--- win32ss/user/user32/windows/nonclient.c (revision 58633)
+++ win32ss/user/user32/windows/nonclient.c (working copy)
@@ -1035,6 +1035,14 @@
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
{
+ /* Old comment:
+ * "make sure hittest fits into 0xf and doesn't overlap
with HTSYSMENU"
+ * This was previously done by setting wParam=SC_SIZE + wParam -
2
+ */
+ /* But that is not what WinNT does. Instead it sends this. This
+ * is easy to differentiate from HTSYSMENU, because HTSYSMENU
adds
+ * SC_MOUSEMENU into wParam.
+ */
SendMessageW(hWnd, WM_SYSCOMMAND, SC_SIZE + wParam - (HTLEFT -
WMSZ_LEFT), lParam);
break;
}
@@ -1073,6 +1081,41 @@
return(0);
}
+/***********************************************************************
+ * NC_HandleNCRButtonDown
+ *
+ * Handle a WM_NCRBUTTONDOWN message. Called from DefWindowProc().
+ */
+LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam
+) {
+ MSG msg;
+ INT hittest = wParam;
+
+ switch (hittest)
+ {
+ case HTCAPTION:
+ case HTSYSMENU:
+ if (!GetSystemMenu( hwnd, FALSE )) break;
+
+ SetCapture( hwnd );
+ for (;;)
+ {
+ if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
+ if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
+ if (msg.message == WM_RBUTTONUP)
+ {
+ hittest = DefWndNCHitTest( hwnd, msg.pt );
+ break;
+ }
+ }
+ ReleaseCapture();
+ if (hittest == HTCAPTION || hittest == HTSYSMENU)
+ SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU,
msg.lParam );
+ break;
+ }
+ return 0;
+}
+
VOID
DefWndTrackScrollBar(HWND hWnd, WPARAM wParam, POINT Point) {
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev