Split screen -Caption windows

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Kanji
Posts: 4
Joined: 17 Feb 2020, 20:12

Split screen -Caption windows

19 Feb 2020, 06:54

Hi guys, thanks to you i figured out how to have a nice gui window without the title bar, but when i try to do a split screen this is what happen:
Spoiler
And the worst is that if you try to change proportions between the two windows it only creates a black screen:
Spoiler
Minimize, maximize and close buttons don't work, but this is not a problem cause if I wanted a no caption window, i surely don't want those buttons :D .

Here's the code:

Code: Select all

OnMessage(0x84, "WM_NCHITTEST")
OnMessage(0x83, "WM_NCCALCSIZE")
gui, color, 000000
Gui, +resize -caption MinSize400x200
Gui, Show, w300 h300
WinGet, GuiID, ID, A
return

esc::
exitapp

WM_NCCALCSIZE()
{
    if A_Gui
        return 0    ; Sizes the client area to fill the entire window.
}

; Redefine where the sizing borders are.  This is necessary since
; returning 0 for WM_NCCALCSIZE effectively gives borders zero size.


WM_NCHITTEST(wParam, lParam)
{
    static border_size = 6
    
    if !A_Gui
        return
    
    WinGetPos, gX, gY, gW, gH
    
    x := lParam<<48>>48, y := lParam<<32>>48
    
    hit_left    := x <  gX+border_size
    hit_right   := x >= gX+gW-border_size
    hit_top     := y <  gY+border_size
    hit_bottom  := y >= gY+gH-border_size
    
    if hit_top
    {
        if hit_left
            return 0xD
        else if hit_right
            return 0xE
        else
            return 0xC
    }
    else if hit_bottom
    {
        if hit_left
            return 0x10
        else if hit_right
            return 0x11
        else
            return 0xF
    }
    else if hit_left
        return 0xA
    else if hit_right
        return 0xB
    
    ; else let default hit-testing be done
}
I looked everywhere for a solution, but I've found nothing. Can you help me? :roll:

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Epialis and 44 guests