WinMove changes dialog box size

Report problems with documented functionality
leihu
Posts: 5
Joined: 19 Mar 2020, 22:08

WinMove changes dialog box size

19 Mar 2020, 22:20

I use WinMove to relocate windows, but found that it changes dialog box size by adding a lighter band around the borders. If I use my mouse to move the dialog box a bit, the lighter band disappears.

You can easily see this by opening a Folder Options dialog box, and excute the following script:

Code: Select all

^+p::WinMove, A, , 100, 100
Not sure if other people have already found that. Can this issue be fixed?
gregster
Posts: 4471
Joined: 30 Sep 2013, 06:48

Re: WinMove changes dialog box size

19 Mar 2020, 22:41

Not sure, if this is really an AHK problem or perhaps a Windows issue.

Can you post a picture? I can't spot anything on Win10 (with a dark theme)...

You can upload pictures directly via the Full Editor > Attachments > Add files (> Place inline)
leihu
Posts: 5
Joined: 19 Mar 2020, 22:08

Re: WinMove changes dialog box size

19 Mar 2020, 22:57

Thanks for your prompt reply.

The first dialog box is normal. The second is somehow enlarged.
Capture1.PNG
Capture1.PNG (27.72 KiB) Viewed 1542 times
Capture2.PNG
Capture2.PNG (29.92 KiB) Viewed 1542 times
leihu
Posts: 5
Joined: 19 Mar 2020, 22:08

Re: WinMove changes dialog box size

19 Mar 2020, 23:04

Also, if you compare the two screenshots carefully, you can see the title bar of the second one was narrowed.
gregster
Posts: 4471
Joined: 30 Sep 2013, 06:48

Re: WinMove changes dialog box size

19 Mar 2020, 23:09

Thank you!
I see it now..also here. At least on these options/properties dialog windows, I can see that additional border which goes away when the window is moved by the mouse.
Interesting, perhaps someone has an idea what is causing this or how to fix...
guest3456
Posts: 3109
Joined: 09 Oct 2013, 10:31

Re: WinMove changes dialog box size

20 Mar 2020, 01:19

confirmed for me too on win10 on that Folder Options dialog

ahk's WinMove simply wraps win32 api MoveWindow.. this 'bug' doesn't occur if you use SetWindowPos:

Code: Select all

^+p::
   hwnd := WinExist("A")
   WinGetPos,,,w, h, ahk_id %hwnd%
   ;// MoveWindow fails
   ; DllCall("MoveWindow", "Ptr", hwnd
   ;                     , "Int", 100
   ;                     , "Int", 100
   ;                     , "Int", w
   ;                     , "Int", h
   ;                     , "Int", false)     ;// true or false for repaint doesn't seem to matter
   ;// SetWindowPos works
   DllCall("SetWindowPos", "Ptr", hwnd
                         , "Ptr", 0
                         , "Int", 100
                         , "Int", 100
                         , "Int", w
                         , "Int", h
                         , "UInt", 0x4000)
return


leihu
Posts: 5
Joined: 19 Mar 2020, 22:08

Re: WinMove changes dialog box size

20 Mar 2020, 07:58

@gregster
@guest3456
Thanks both!!

I found another similar problem with WinActivate. Here's an example.

Run "Remote Desktop Connection", then minimize it. Now excute the following script:

Code: Select all

^+p::WinActivate, % "Remote Desktop Connection"
Here are two screenshots. The first one is normal, and the second is changed.
Capture1.PNG
Capture1.PNG (20.7 KiB) Viewed 1455 times
Capture2.PNG
Capture2.PNG (20.93 KiB) Viewed 1455 times
It looks like the problem happens to dialog boxes. "Remote Desktop Connection" is also a dialog box (I checked using Microsoft Spy++). The only difference is that it's got a minimize button.
joefiesta
Posts: 377
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: WinMove changes dialog box size

20 Mar 2020, 09:28

Tried the "remote desktop connection" example on Windows 7 Pro, AHK 1.1.32. The effect is not seen there.
leihu
Posts: 5
Joined: 19 Mar 2020, 22:08

Re: WinMove changes dialog box size

20 Mar 2020, 09:41

joefiesta wrote: Tried the "remote desktop connection" example on Windows 7 Pro, AHK 1.1.32. The effect is not seen there.
It should happen on Windows 10 only, because I think Windows 10 has got thicker shadow.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 12 guests