Implement CenterWindowRelativeToParent.
Modified: trunk/reactos/include/wine/setupapi.h
Modified: trunk/reactos/lib/setupapi/misc.c
Modified: trunk/reactos/lib/setupapi/setupapi.spec
Modified: trunk/reactos/w32api/include/setupapi.h
_____
Modified: trunk/reactos/include/wine/setupapi.h
--- trunk/reactos/include/wine/setupapi.h 2005-07-02 13:49:23 UTC
(rev 16378)
+++ trunk/reactos/include/wine/setupapi.h 2005-07-02 14:05:38 UTC
(rev 16379)
@@ -675,6 +675,7 @@
VOID WINAPI AssertFail(LPSTR, UINT, LPSTR);
DWORD WINAPI CaptureAndConvertAnsiArg(PCSTR lpSrc, PWSTR *lpDst);
DWORD WINAPI CaptureStringArg(PCWSTR lpSrc, PWSTR *lpDst);
+VOID WINAPI CenterWindowRelativeToParent(HWND);
BOOL WINAPI ConcatenatePaths(LPWSTR, LPCWSTR, DWORD, LPDWORD);
BOOL WINAPI DelayedMove(PCWSTR lpExistingFileName, PCWSTR
lpNewFileName);
BOOL WINAPI DoesUserHavePrivilege(PCWSTR lpPrivilegeName);
_____
Modified: trunk/reactos/lib/setupapi/misc.c
--- trunk/reactos/lib/setupapi/misc.c 2005-07-02 13:49:23 UTC (rev
16378)
+++ trunk/reactos/lib/setupapi/misc.c 2005-07-02 14:05:38 UTC (rev
16379)
@@ -860,7 +860,7 @@
CHAR szModule[MAX_PATH];
CHAR szBuffer[2048];
LPSTR lpName;
- LPSTR lpBuffer;
+// LPSTR lpBuffer;
TRACE("%s %u %s\n", lpFile, uLine, lpMessage);
@@ -1044,3 +1044,49 @@
return (dwBufferSize >= dwTotalSize);
}
+
+
+/**********************************************************************
****
+ * CenterWindowRelativeToParent [SETUPAPI.@]
+ *
+ * Centers a window relative to its parent.
+ *
+ * PARAMS
+ * hwnd [I] Window to center.
+ *
+ * RETURNS
+ * None
+ */
+VOID WINAPI
+CenterWindowRelativeToParent(HWND hwnd)
+{
+ HWND hwndOwner;
+ POINT ptOrigin;
+ RECT rcWindow;
+ RECT rcOwner;
+ INT nWindowWidth, nWindowHeight;
+ INT nOwnerWidth, nOwnerHeight;
+ INT posX, posY;
+
+ hwndOwner = GetWindow(hwnd, GW_OWNER);
+ if (hwndOwner == NULL)
+ return;
+
+ ptOrigin.x = 0;
+ ptOrigin.y = 0;
+ ClientToScreen(hwndOwner, &ptOrigin);
+
+ GetWindowRect(hwnd, &rcWindow);
+ GetClientRect(hwndOwner, &rcOwner);
+
+ nWindowWidth = rcWindow.right - rcWindow.left;
+ nWindowHeight = rcWindow.bottom - rcWindow.top;
+
+ nOwnerWidth = rcOwner.right - rcOwner.left;
+ nOwnerHeight = rcOwner.bottom - rcOwner.top;
+
+ posX = ((nOwnerWidth - nWindowWidth) / 2) + ptOrigin.x;
+ posY = ((nOwnerHeight - nWindowHeight) / 2) + ptOrigin.y;
+
+ MoveWindow(hwnd, posX, posY, nWindowHeight, nWindowWidth, 0);
+}
_____
Modified: trunk/reactos/lib/setupapi/setupapi.spec
--- trunk/reactos/lib/setupapi/setupapi.spec 2005-07-02 13:49:23 UTC
(rev 16378)
+++ trunk/reactos/lib/setupapi/setupapi.spec 2005-07-02 14:05:38 UTC
(rev 16379)
@@ -192,7 +192,7 @@
@ stub CM_Unregister_Device_Interface_ExW
@ stdcall CaptureAndConvertAnsiArg(str ptr)
@ stdcall CaptureStringArg(wstr ptr)
-@ stub CenterWindowRelativeToParent
+@ stdcall CenterWindowRelativeToParent(long)
@ stdcall ConcatenatePaths(wstr wstr long ptr)
@ stdcall DelayedMove(wstr wstr)
@ stub DelimStringToMultiSz
_____
Modified: trunk/reactos/w32api/include/setupapi.h
--- trunk/reactos/w32api/include/setupapi.h 2005-07-02 13:49:23 UTC
(rev 16378)
+++ trunk/reactos/w32api/include/setupapi.h 2005-07-02 14:05:38 UTC
(rev 16379)
@@ -1038,6 +1038,7 @@
WINSETUPAPI LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD);
+WINSETUPAPI VOID WINAPI CenterWindowRelativeToParent(HWND);
WINSETUPAPI PWSTR WINAPI DuplicateString(PCWSTR);
WINSETUPAPI BOOL WINAPI IsUserAdmin(VOID);
WINSETUPAPI VOID WINAPI MyFree(PVOID);
Show replies by date