Created Window Spy/Info feature

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7019 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2018-10-16 16:55:37 +00:00
parent 51d7471805
commit 87139b31a3
7 changed files with 341 additions and 6 deletions

View file

@ -180,6 +180,19 @@ void ErrorMessage(HWND hwnd,const TCHAR *str) {
LogMessage(hwnd,buf);
}
static void CenterOnParent(HWND hwnd, HWND hParent)
{
RECT r;
GetWindowRect(hwnd, &r);
UINT w = (r.right - r.left), h = (r.bottom - r.top), swp = SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE;
if (GetWindowRect(hParent, &r))
SetWindowPos(hwnd, 0, r.left + ((r.right - r.left)/2) - (w/2), r.top + ((r.bottom - r.top)/2) - (h/2), 0, 0, swp);
}
void CenterOnParent(HWND hwnd)
{
CenterOnParent(hwnd, GetWindow(hwnd, GW_OWNER));
}
void SetDialogFocus(HWND hDlg, HWND hCtl)
{
//blogs.msdn.com/b/oldnewthing/archive/2004/08/02/205624.aspx
@ -956,7 +969,7 @@ bool FileExists(const TCHAR *fname)
bool OpenUrlInDefaultBrowser(HWND hwnd, LPCSTR Url)
{
return (int)(INT_PTR) ShellExecuteA(hwnd, NULL , Url, NULL, NULL, SW_SHOWNORMAL) > 32;
return (int)(INT_PTR) ShellExecuteA(hwnd, NULL, Url, NULL, NULL, SW_SHOWNORMAL) > 32;
}
HMENU FindSubMenu(HMENU hMenu, UINT uId)