Skip to content
TheChatArchiveThe Chat Archive
Qwenqwq-32b· Alibaba (Qwen)Hugging Face LMArena Human Preference 140K

ahk v2 make window borderless

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-mini-2025-04-14’s answer.
  1. User

    ahk v2 make window borderless

  2. Qwen Assistant

    To make a window borderless in AutoHotkey v2, you can modify its window style to remove the title bar and borders. Here's how to do it:

    Step-by-Step Code Explanation:

    #Requires AutoHotkey v2.0
    
    ; Get the handle of the target window (replace "YourWindowTitle" with the actual window title)
    hwnd := WinExist("YourWindowTitle")
    
    if (hwnd) {
        ; Get the current window style
        style := WinGetStyle(hwnd)
        
        ; Remove the WS_CAPTION style (includes title bar and border)
        newStyle := style & ~0xC00000
        
        ; Apply the new style
        WinSetStyle(hwnd, newStyle)
        
        ; Redraw the window to apply changes (optional but recommended)
        WinRedraw(hwnd)
    }
    

    Key Details:

    1. Target Window:

      • Replace "YourWindowTitle" with the actual title of the window you want to modify.
      • To target the active window, use hwnd := WinActive("A").
    2. Window Style:

      • WS_CAPTION (0xC00000 in hex) includes both the title bar and border. Removing this style makes the window borderless.
      • style & ~0xC00000 uses bitwise operations to clear the WS_CAPTION bits from the current style.
    3. Redraw:

      • WinRedraw(hwnd) ensures the window updates its appearance after the style change.

    Example Usage:

    To make the active window borderless, use:

    #Requires AutoHotkey v2.0
    
    hwnd := WinActive("A")
    if (hwnd) {
        style := WinGetStyle(hwnd)
        newStyle := style & ~0xC00000
        WinSetStyle(hwnd, newStyle)
        WinRedraw(hwnd)
    }
    

    Notes:

    • Window Manipulation Limitations: Some applications may not respond to style changes due to custom window handling.
    • Resizing/Moving: Borderless windows may lose standard resizing/moving functionality. Add custom hotkeys/scripts if needed.
    • Revert Changes: To restore the window, re-add the WS_CAPTION style using newStyle := style | 0xC00000.

    Let me know if you need further adjustments!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.