Jump to content

How To Hide Window Title Bar?


Recommended Posts

Excuse me if the question already been asked. I got tied using search for hours.

1. I need run some program with AutoIt without its title bar. It's necessary to increase client size of the window.

2. Is it possible to hide also widow border?

3. Is there any way to trick a "window size <= @DesktopWidth/Height + 12" rule? (WinMove function)

4. Search engine does fool me! 30 pages with almost the same themes by different keywords or just 0 found with too much keywords. Someone please give me a link how to use search on this site...

I have been walking shadow ways to land where Terror rules...

Link to comment
Share on other sites

4. Search engine does fool me! 30 pages with almost the same themes by different keywords or just 0 found with too much keywords. Someone please give me a link how to use search on this site...

I think my sig has a link to a google search engine that searches this site... (it's called "Advanced" Forum Search Engine)

GUI Control Styles

This page contains a list of the common and extended styles that can be used with windows, and also specific styles that can be used with controls. These styles are used in the "style" and/or "exStyle" parameters of many of the GUI functions. To use these values you must #include <GUIConstants.au3> into your script.

Note: The "Value" is given just for reference, you should always use the "name" of the style in order to keep your scripts readable.

Common Styles Value Description

Default/forced for GUI creation see GUICreate function.

$WS_BORDER 0x00800000 Creates a window that has a thin-line border.

$WS_POPUP 0x80000000 Creates a pop-up window. This style cannot be used with the WS_CHILD style.

$WS_CAPTION 0x00C00000 Creates a window that has a title bar (includes the WS_BORDER style)

$WS_CLIPCHILDREN 0x02000000 Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.

$WS_CLIPSIBLINGS 0x04000000 Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.

$WS_DISABLED 0x08000000 Creates a window that is initially disabled.

$WS_DLGFRAME 0x00400000 Creates a window that has a border of a style typically used with dialog boxes.

$WS_HSCROLL 0x00100000 Creates a window that has a horizontal scroll bar.

$WS_MAXIMIZE 0x01000000 Creates a window that is initially maximized.

$WS_MAXIMIZEBOX 0x00010000 Creates a window that has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

$WS_MINIMIZE 0x20000000 Creates a window that is initially minimized.

$WS_MINIMIZEBOX 0x00020000 Creates a window that has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

$WS_OVERLAPPED 0x00000000 Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style

$WS_OVERLAPPEDWINDOW 0x00CF0000 Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.

$WS_POPUPWINDOW 0x80880000 Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.

$WS_SIZEBOX 0x00040000 Creates a window that has a sizing border. Same as the WS_THICKFRAME style.

$WS_SYSMENU 0x00080000 Creates a window that has a window menu on its title bar. The WS_CAPTION style must also be specified.

$WS_THICKFRAME 0x00040000 Creates a window that has a sizing border. Same as the WS_SIZEBOX style

$WS_VSCROLL 0x00200000 Creates a window that has a vertical scroll bar.

$WS_VISIBLE 0x10000000 Creates a window that is initially visible.

$WS_CHILD 0x40000000 Creates a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.

$WS_GROUP 0x00020000 Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.

$WS_TABSTOP 0x00010000 Turns the control into a tab stop, which enables the user to select the control by tabbing through the controls in a dialog box.

$DS_MODALFRAME 0x00000080 Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and window menu by specifying the WS_CAPTION and WS_SYSMENU styles.

$DS_SETFOREGROUND 0x00000200 This style is useful for modal dialog boxes that require immediate attention from the user regardless of whether the owner window is the foreground window.

$DS_CONTEXTHELP 0x00002000 Includes a question mark in the title bar of the dialog box. Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. Same as WS_EX_CONTEXTHELP extended style.

Looking for help: (do in order)

1) Think of a way yourself

2) Search the HelpFile

3) Search the forum

4) Ask a question on the forum

#)

Edited by nfwu
Link to comment
Share on other sites

If you don't want the title bar, you can use any of these two styles in GUICreate()

> $WS_POPUP - Creates a window without a title bar, and without border.

> $WS_POPUPWINDOW - Creates a windows without a title bar but with a border.

You need

#include<GUIConstants.au3>

to use those!

#)

Link to comment
Share on other sites

It seems like i've almost found the decision. It's use of ANYGUI.au3: http://www.autoitscript.com/forum/index.ph...topic=9517&st=0

This module is a nice work. BUT. Anyway i cannot hide the title of ALREADY EXISTING window. (repeat, I need to hide title bar of already existing window, not AutoIt-created GUI)

Just try out this code:

#include <Array.au3>
#include <AnyGui.au3>
#include <guiconstants.au3>
Opt ("WinTitleMatchMode", 4)
Opt ("WinWaitDelay", 0)
Opt ("GUIOnEventMode", 1)

$pid = Run("notepad")
sleep(500)
$handle = WinGetHandle("Untitled - Notepad")
$hWnd = _GuiTarget ($handle, 1)

$Style = $WS_Popup
$ExStyle = 0

$result = _TargetStyle("set",1,$Style,$ExStyle,$hWnd)

It doesn't remove the title (header). I still need your help.

Any thoughts?

I have been walking shadow ways to land where Terror rules...

Link to comment
Share on other sites

  • Moderators

It seems like i've almost found the decision. It's use of ANYGUI.au3: http://www.autoitscript.com/forum/index.ph...topic=9517&st=0

This module is a nice work. BUT. Anyway i cannot hide the title of ALREADY EXISTING window. (repeat, I need to hide title bar of already existing window, not AutoIt-created GUI)

Just try out this code:

#include <Array.au3>
#include <AnyGui.au3>
#include <guiconstants.au3>
Opt ("WinTitleMatchMode", 4)
Opt ("WinWaitDelay", 0)
Opt ("GUIOnEventMode", 1)

$pid = Run("notepad")
sleep(500)
$handle = WinGetHandle("Untitled - Notepad")
$hWnd = _GuiTarget ($handle, 1)

$Style = $WS_Popup
$ExStyle = 0

$result = _TargetStyle("set",1,$Style,$ExStyle,$hWnd)

It doesn't remove the title (header). I still need your help.

Any thoughts?

I'm not sure you can remove another applications Title Bar.... but you could use WinMove() to move it outside the desktop area so it can't be seen I'm sure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Finally I have done that. Here is an example of such an operation (i've tested it with AutoIt-created windows and with some sole programs - it works). May be would useful for someone...

#include <Array.au3>
#include <AnyGui.au3>
#include <guiconstants.au3>
Opt ("WinTitleMatchMode", 4)
Opt ("WinWaitDelay", 0)
Opt ("GUIOnEventMode", 1)

; - 1. creating a window
$Form1 = GUICreate("AForm1", 400, 300, 200, 100, $WS_Caption, -1)
GUISetState(@SW_SHOW)
$xhandle = WinGetHandle("AForm1")
WinSetTitle($xhandle,"","AForm1 - press <Esc> to exit")
; - 2. handling a window
$xh = _GuiTarget($xhandle,1)
$Style = $WS_Caption
$ExStyle = -1
; - 3. changing a window
MsgBox(0,"Attention!","Now window title should disappear...")
$result = _TargetStyle("unset",1,$Style,$ExStyle,$xh)

HotKeySet("{ESC}","Leave")
while 1
wend

Func Leave()
  exit
EndFunc

This script does create an empty window with title bar, then it removes title bar leaving only plain form surface.

Quaizywabbit respect! AnyGUI unit is great.

Edited by Diarazad

I have been walking shadow ways to land where Terror rules...

Link to comment
Share on other sites

  • Moderators

Thanks for sharing, confirmed it does work on other windows

#include 'ANYGUIv2.6.au3'
Opt ("WinTitleMatchMode", 4)
$xh = WinGetHandle("Untitled - Notepad")
$Style = 0x00C00000
$ExStyle = -1
$result = _TargetStyle("unset", 1, $Style, $ExStyle, $xh)

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

where do i get anygui.au3 ??

If you do a search|more options|anygui.au3|titles only you get 3 choices for it. One of those is the actual thread for the link. Or look up quaizywabbit as a user, and look in his signatre.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

I have been able to use ANYGUIv2.8 & AutoIt v3.3.6.1 by modifying the ANYGUIv2.8.au3 file as follows;

CHANGE:

#include-once
#include <guiconstants.au3>
#include "guilist.au3"

TO:

#include-once
#include <GUIconstants.au3>
#include <WindowsConstants.au3>
#include "GUIListBox.au3"

then the code above will work again :)

Edited by sfranzyshen
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...