how can i make a gui only movable/drag with mouse at y axis? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
John1
Posts: 236
Joined: 11 May 2020, 11:54

how can i make a gui only movable/drag with mouse at y axis?

Post by John1 » 21 Jul 2022, 12:51

Hello,

how can i make a gui only movable/drag with mouse at y axis/ block only moving/dragging with mouse at x axis?


Thank you!

User avatar
neovis
Posts: 34
Joined: 12 Jun 2022, 03:56
Location: Republic of Korea
Contact:

Re: how can i make a gui only movable/drag with mouse at y axis?  Topic is solved

Post by neovis » 21 Jul 2022, 14:20

Try:

Code: Select all

OnMessage(0x216, "WM_SIZING")

WM_SIZING(wparam, lparam, msg, hwnd) {
    global
    if (hwnd == hgui) {
        NumPut(left, lparam+0, "int")
        NumPut(right, lparam+8, "int")
        return true
    }
}

Gui +Hwndhgui
Gui Show, w400 h200

WinGetPos left,, width,, % "ahk_id" hgui
right := left+width

John1
Posts: 236
Joined: 11 May 2020, 11:54

Re: how can i make a gui only movable/drag with mouse at y axis?

Post by John1 » 22 Jul 2022, 15:01

@neovis

Thanks a lot for your reply! Works great. :)

teadrinker
Posts: 4412
Joined: 29 Mar 2015, 09:41
Contact:

Re: how can i make a gui only movable/drag with mouse at y axis?

Post by teadrinker » 22 Jul 2022, 19:58

@neovis
Good idea, but WM_SIZING is not 0x216. :)

User avatar
neovis
Posts: 34
Joined: 12 Jun 2022, 03:56
Location: Republic of Korea
Contact:

Re: how can i make a gui only movable/drag with mouse at y axis?

Post by neovis » 22 Jul 2022, 20:12

teadrinker wrote:
22 Jul 2022, 19:58
@neovis
Good idea, but WM_SIZING is not 0x216. :)
Thank you for telling me. WM_SIZING is wrong. :o

It should be rename to:

Code: Select all

WM_MOVING 0x216

Post Reply

Return to “Ask for Help (v1)”