Added string lookup tool

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7251 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-01-17 20:57:20 +00:00
parent 79df77fa82
commit 60ab777e21
10 changed files with 426 additions and 43 deletions

View file

@ -106,6 +106,7 @@ typedef struct _DIALOGDATA {
int DialogAwarenessContext; // Canonical DPI awareness context
_DIALOGDATA() : hWndOutline(0) {}
static struct _DIALOGDATA* Get(HWND hDlg) { return (struct _DIALOGDATA*) GetWindowLongPtr(hDlg, DWLP_USER); }
static void Set(HWND hDlg, void*pDD) { SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR) pDD); }
} DIALOGDATA;
typedef struct {
@ -281,7 +282,7 @@ static INT_PTR CALLBACK SpyDlgProc(HWND hDlg, UINT Msg, WPARAM WParam, LPARAM LP
switch(Msg)
{
case WM_INITDIALOG:
SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR) (pDD = (DIALOGDATA*) LParam));
DIALOGDATA::Set(hDlg, (pDD = (DIALOGDATA*) LParam));
CenterOnParent(hDlg);
// On >= 10FU1703 we are PMv2 and Windows scales our dialog and child controls.
// On >= 10FU1607 && < 10FU1703 we are System aware but try to upgrade this thread to
@ -336,7 +337,10 @@ static INT_PTR CALLBACK SpyDlgProc(HWND hDlg, UINT Msg, WPARAM WParam, LPARAM LP
RECT r;
GetPhysicalWindowRect(pDD->hWndTarget, r, hDlg), PhysicalToLogical(pDD->hWndOutline, r, hDlg);
if (GetAncestor(pDD->hWndTarget, GA_ROOT) != hDlg)
SetWindowPos(pDD->hWndOutline, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_SHOWWINDOW|SWP_NOCOPYBITS|SWP_NOACTIVATE|SWP_NOOWNERZORDER);
{
SetWindowPos(pDD->hWndOutline, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_HIDEWINDOW|SWP_NOCOPYBITS|SWP_NOACTIVATE|SWP_NOOWNERZORDER);
ShowWindow(pDD->hWndOutline, SW_SHOW); // To avoid a small Windows redraw bug, don't show the window until after it has the correct size
}
SetTimer(hDlg, TID_OUTLINE, 2 * 1000, NULL);
}
ReleaseCapture();