Alexandre Julliard : cryptui: Fix incorrect use of the ScreenToClient function.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 12:03:09 CDT 2010


Module: wine
Branch: master
Commit: 1019c2fe5d3620996de274989a7a525f5ef0e782
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1019c2fe5d3620996de274989a7a525f5ef0e782

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct  5 14:02:29 2010 +0200

cryptui: Fix incorrect use of the ScreenToClient function.

---

 dlls/cryptui/main.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index abda52a..339ad61 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -4284,7 +4284,6 @@ static BOOL init_hierarchy_page(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
 static int CALLBACK cert_prop_sheet_proc(HWND hwnd, UINT msg, LPARAM lp)
 {
     RECT rc;
-    POINT topLeft;
 
     TRACE("(%p, %08x, %08lx)\n", hwnd, msg, lp);
 
@@ -4293,17 +4292,12 @@ static int CALLBACK cert_prop_sheet_proc(HWND hwnd, UINT msg, LPARAM lp)
     case PSCB_INITIALIZED:
         /* Get cancel button's position.. */
         GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rc);
-        topLeft.x = rc.left;
-        topLeft.y = rc.top;
-        ScreenToClient(hwnd, &topLeft);
+        MapWindowPoints( 0, hwnd, (POINT *)&rc, 2 );
         /* hide the cancel button.. */
         ShowWindow(GetDlgItem(hwnd, IDCANCEL), FALSE);
-        /* get the OK button's size.. */
-        GetWindowRect(GetDlgItem(hwnd, IDOK), &rc);
         /* and move the OK button to the cancel button's original position. */
-        MoveWindow(GetDlgItem(hwnd, IDOK), topLeft.x, topLeft.y,
-         rc.right - rc.left, rc.bottom - rc.top, FALSE);
-        GetWindowRect(GetDlgItem(hwnd, IDOK), &rc);
+        SetWindowPos(GetDlgItem(hwnd, IDOK), 0, rc.left, rc.top, 0, 0,
+                     SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
         break;
     }
     return 0;




More information about the wine-cvs mailing list