mirror of
https://github.com/reactos/reactos.git
synced 2024-07-14 00:25:05 +00:00
Implement CenterWindowRelativeToParent.
svn path=/trunk/; revision=16379
This commit is contained in:
parent
50c2bb7322
commit
6c58ea3cd7
|
@ -675,6 +675,7 @@ LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD);
|
||||||
VOID WINAPI AssertFail(LPSTR, UINT, LPSTR);
|
VOID WINAPI AssertFail(LPSTR, UINT, LPSTR);
|
||||||
DWORD WINAPI CaptureAndConvertAnsiArg(PCSTR lpSrc, PWSTR *lpDst);
|
DWORD WINAPI CaptureAndConvertAnsiArg(PCSTR lpSrc, PWSTR *lpDst);
|
||||||
DWORD WINAPI CaptureStringArg(PCWSTR lpSrc, PWSTR *lpDst);
|
DWORD WINAPI CaptureStringArg(PCWSTR lpSrc, PWSTR *lpDst);
|
||||||
|
VOID WINAPI CenterWindowRelativeToParent(HWND);
|
||||||
BOOL WINAPI ConcatenatePaths(LPWSTR, LPCWSTR, DWORD, LPDWORD);
|
BOOL WINAPI ConcatenatePaths(LPWSTR, LPCWSTR, DWORD, LPDWORD);
|
||||||
BOOL WINAPI DelayedMove(PCWSTR lpExistingFileName, PCWSTR lpNewFileName);
|
BOOL WINAPI DelayedMove(PCWSTR lpExistingFileName, PCWSTR lpNewFileName);
|
||||||
BOOL WINAPI DoesUserHavePrivilege(PCWSTR lpPrivilegeName);
|
BOOL WINAPI DoesUserHavePrivilege(PCWSTR lpPrivilegeName);
|
||||||
|
|
|
@ -860,7 +860,7 @@ VOID WINAPI AssertFail(LPSTR lpFile, UINT uLine, LPSTR lpMessage)
|
||||||
CHAR szModule[MAX_PATH];
|
CHAR szModule[MAX_PATH];
|
||||||
CHAR szBuffer[2048];
|
CHAR szBuffer[2048];
|
||||||
LPSTR lpName;
|
LPSTR lpName;
|
||||||
LPSTR lpBuffer;
|
// LPSTR lpBuffer;
|
||||||
|
|
||||||
TRACE("%s %u %s\n", lpFile, uLine, lpMessage);
|
TRACE("%s %u %s\n", lpFile, uLine, lpMessage);
|
||||||
|
|
||||||
|
@ -1044,3 +1044,49 @@ ConcatenatePaths(LPWSTR lpPath,
|
||||||
|
|
||||||
return (dwBufferSize >= dwTotalSize);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@
|
||||||
@ stub CM_Unregister_Device_Interface_ExW
|
@ stub CM_Unregister_Device_Interface_ExW
|
||||||
@ stdcall CaptureAndConvertAnsiArg(str ptr)
|
@ stdcall CaptureAndConvertAnsiArg(str ptr)
|
||||||
@ stdcall CaptureStringArg(wstr ptr)
|
@ stdcall CaptureStringArg(wstr ptr)
|
||||||
@ stub CenterWindowRelativeToParent
|
@ stdcall CenterWindowRelativeToParent(long)
|
||||||
@ stdcall ConcatenatePaths(wstr wstr long ptr)
|
@ stdcall ConcatenatePaths(wstr wstr long ptr)
|
||||||
@ stdcall DelayedMove(wstr wstr)
|
@ stdcall DelayedMove(wstr wstr)
|
||||||
@ stub DelimStringToMultiSz
|
@ stub DelimStringToMultiSz
|
||||||
|
|
|
@ -1038,6 +1038,7 @@ typedef SP_BACKUP_QUEUE_PARAMS_A SP_BACKUP_QUEUE_PARAMS,
|
||||||
|
|
||||||
|
|
||||||
WINSETUPAPI LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD);
|
WINSETUPAPI LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD);
|
||||||
|
WINSETUPAPI VOID WINAPI CenterWindowRelativeToParent(HWND);
|
||||||
WINSETUPAPI PWSTR WINAPI DuplicateString(PCWSTR);
|
WINSETUPAPI PWSTR WINAPI DuplicateString(PCWSTR);
|
||||||
WINSETUPAPI BOOL WINAPI IsUserAdmin(VOID);
|
WINSETUPAPI BOOL WINAPI IsUserAdmin(VOID);
|
||||||
WINSETUPAPI VOID WINAPI MyFree(PVOID);
|
WINSETUPAPI VOID WINAPI MyFree(PVOID);
|
||||||
|
|
Loading…
Reference in a new issue