Sign in to follow this  
Followers 0
komalo

Remove a Window Border Without Using WS_POPUP ?

15 posts in this topic

hi

i am trying to remove a Window Border Without Using WS_POPUP , i don't want

to affect any of the Style or the ExStyle of the window , i know it can be done .

TrueTransparency and FastAero remove the borders without affecting the style

i think it is related some how to uxtheme.dll

So AnyOne?


[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

Share this post


Link to post
Share on other sites



I don't know if this is what you are looking for

$flg = BitOR($GUI_SS_DEFAULT_GUI, $WS_DLGFRAME, $DS_MODALFRAME, $DS_SETFOREGROUND, $WS_CAPTION, $WS_SYSMENU)

$flg = BitAND($flg, Not $WS_MAXIMIZEBOX, Not $WS_MINIMIZEBOX)

GUICreate("Title", 520, 280, -1, -1, $flg)


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

i am trying to remove a Window Border Without Using WS_POPUP

What you mean by «Window Border»? the whole area around the window, or only the side borders, and the TitleBar you need to remain?

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

@Emiel Wieldraaijer : i meant without using styles

@MrCreatoR : i mean the whole area around the windows , like a POPUP Window


[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

Share this post


Link to post
Share on other sites

@Emiel Wieldraaijer : i meant without using styles

@MrCreatoR : i mean the whole area around the windows , like a POPUP Window

Maybe like this

#include <GuiConstants.au3>
#include <windowsconstants.au3>
Const $SM_CXFIXEDFRAME = 7;, $SM_CXVSCROLL = 2,Const $SM_CYCAPTION = 4

HotKeySet("{ESC}", "QuitApp")

$main_Gui = GUICreate("", 400, 400, 20, 20)
$but1 = GUICtrlCreateButton(" Exit ", 100, 100, 80, 21)
$Info_Edit = GUICtrlCreateEdit("A few words ", 80, 150, 300, 220)


GUISetState()


$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)

$TitleHt = $wtitle[0] + $wside[0]
$pp = WinGetClientSize($main_Gui)
$Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $wside[0], "long", $TitleHt, "long", $wside[0] + $pp[0], "long", $TitleHt + $pp[1])
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $main_Gui, "long", $Mask[0], "int", 1)

While 1
    
    If GUIGetMsg() = $but1 Then Exit
WEnd

Func QuitApp()
    Exit
EndFunc  ;==>QuitApp

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

i don't want

to affect any of the Style or the ExStyle of the window , i know it can be done

You can do it only if you cut-off the edges Posted Image

Something like this:

#include <GuiConstants.au3>

$hGUI = GUICreate("Test Script", 300, 200)
_GUICutBorder($hGUI, 22, 30, 5, 5)

$Exit_Button = GUICtrlCreateButton("Exit", 40, 170, 60, 20)

GUISetState(@SW_SHOW, $hGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Exit_Button
            Exit
    EndSwitch
WEnd

Func _GUICutBorder($hWnd, $iX1, $iY1, $iX2, $iY2)
    Local $aWPos = WinGetPos($hWnd)
    
    Local $iRet = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", _
            "long", $iX1, _
            "long", $iX1, _
            "long", $aWPos[2], _
            "long", $aWPos[3], _
            "long", $iX2, _
            "long", $iY2)
    
    If IsArray($iRet) And $iRet[0] Then
        Return DllCall("user32.dll", "long", "SetWindowRgn", _
                "hwnd", $hWnd, _
                "long", $iRet[0], _
                "int", 1)
    EndIf
EndFunc

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Very good martin! i didn't thought right a way about using system metrics.

Here is modified version of your example (as always, i like to use those kind of stuff as UDFs :mellow:):

#include <GuiConstantsEx.au3>

$hGUI = GUICreate("_GUICutBorder Example", 300, 200)

_GUICutBorders($hGUI)

GUICtrlCreateEdit("_GUICutBorder Example", 20, 20, 260, 140)

$Exit_Button = GUICtrlCreateButton("Exit", 20, 170, 60, 20)

GUISetState(@SW_SHOW, $hGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Exit_Button
            Exit
    EndSwitch
WEnd

Func _GUICutBorders($hWnd)
    Local Const $i_SM_CXFIXEDFRAME = 7, $i_SM_CXVSCROLL = 2, $i_SM_CYCAPTION = 4
    Local $aCaption_Metrics, $aFrame_Metrics, $iCaption_Height, $aClient_Size, $aRectRgn
    
    $aCaption_Metrics = DllCall("User32.dll", "int", "GetSystemMetrics", "int", $i_SM_CYCAPTION)
    $aFrame_Metrics = DllCall("User32.dll", "int", "GetSystemMetrics", "int", $i_SM_CXFIXEDFRAME)
    
    $iCaption_Height = $aCaption_Metrics[0] + $aFrame_Metrics[0]
    $aClient_Size = WinGetClientSize($hWnd)
    
    $aRectRgn = DllCall("Gdi32.dll", "long", "CreateRectRgn", _
        "long", $aFrame_Metrics[0], "long", $iCaption_Height, _
        "long", $aFrame_Metrics[0] + $aClient_Size[0], "long", $iCaption_Height + $aClient_Size[1])
    
    DllCall("User32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aRectRgn[0], "int", 1)
EndFunc

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@MrCreatoR & @martin

i tried your scripts , they r great but there's a problem that when

using it on a window , the border reappear again when the window restored or resized

like this and also with your code MrCreatoR

[#include <GuiConstants.au3>
#include <windowsconstants.au3>
Const $SM_CXFIXEDFRAME = 7

$main_Gui = WinGetHandle("Untitled - Notepad")


$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)

$TitleHt = $wtitle[0] + $wside[0]
$pp = WinGetClientSize($main_Gui)
$Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $wside[0], "long", $TitleHt, "long", $wside[0] + $pp[0], "long", $TitleHt + $pp[1])
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $main_Gui, "long", $Mask[0], "int", 1)
Edited by komalo

[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

Share this post


Link to post
Share on other sites

Yes, strange...

But why you don't want to remove styles? it is the correct way of removing the title bar + edges.


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

@MrCreator we both had the same idea but the GetSystemMetrics is better isn't it because on my laptop, your script left part of the windows caption showing.

@komalo I don't see the problem, but maybe if you add this line to MrCreator's last script before the while

GUIRegisterMsg($WM_PAINT,"_GUICutBorders")

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

@MrCreator we both had the same idea but the GetSystemMetrics is better isn't it because on my laptop, your script left part of the windows caption showing.

@komalo I don't see the problem, but maybe if you add this line to MrCreator's last script before the while

GUIRegisterMsg($WM_PAINT,"_GUICutBorders")
I think he needs it on external window, not AutoIt GUI. Because with GUI it's working well, the caption is not reappearing when minimizing/restoring.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

@MrCreator : well because i am removing the title bar

of another window and removing the style may cause

some problem in it and as i said before that TrueTransparency

and FastAero remove the borders without affecting the style

@martin : i can't Put GUIRegisterMsg because it is not

my gui , it is another window like MrCreator said

I think he needs it on external window, not AutoIt GUI. Because with GUI it's working well, the caption is not reappearing when minimizing/restoring.

Edited by komalo

[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

as i said before that TrueTransparency

and FastAero remove the borders without affecting the style

How do you know that? i mean how do you check that it's not changing the styles?

I would use this:

#include <WindowsConstants.au3>

Run("Notepad.exe")
WinWait("[CLASS:Notepad]")

$hWnd = WinGetHandle("[CLASS:Notepad]")

$iOld_Styles = _WinGetStyle($hWnd, 0)
$iOld_ExStyles = _WinGetStyle($hWnd, 1)

$iNew_Styles = BitAND($iOld_Styles, BitNOT($WS_SYSMENU), BitNOT($WS_CAPTION)) ;, BitNOT($WS_SIZEBOX))

_WinSetStyle($hWnd, $iNew_Styles, $iOld_ExStyles)

Func _WinSetStyle($hWnd, $Style = -1, $ExStyle = 0)
    Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
    Local Const $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1, $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4
    Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER)
    
    If $Style = -1 Then $Style = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
    
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $Style)
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $ExStyle)
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", $iFlags)
EndFunc

Func _WinGetStyle($hWnd, $iIndex=0)
    Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
    
    Local $iGWL_Index = $GWL_STYLE
    If $iIndex > 0 Then $iGWL_Index = $GWL_EXSTYLE
    
    Local $aStyles = DllCall('User32.dll', 'long', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iGWL_Index)
    Return $aStyles[0]
EndFunc
Edited by MrCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Maybe like this

#include <GuiConstants.au3>
#include <windowsconstants.au3>
Const $SM_CXFIXEDFRAME = 7;, $SM_CXVSCROLL = 2,Const $SM_CYCAPTION = 4

HotKeySet("{ESC}", "QuitApp")

$main_Gui = GUICreate("", 400, 400, 20, 20)
$but1 = GUICtrlCreateButton(" Exit ", 100, 100, 80, 21)
$Info_Edit = GUICtrlCreateEdit("A few words ", 80, 150, 300, 220)


GUISetState()


$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)

$TitleHt = $wtitle[0] + $wside[0]
$pp = WinGetClientSize($main_Gui)
$Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $wside[0], "long", $TitleHt, "long", $wside[0] + $pp[0], "long", $TitleHt + $pp[1])
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $main_Gui, "long", $Mask[0], "int", 1)

While 1
    
    If GUIGetMsg() = $but1 Then Exit
WEnd

Func QuitApp()
    Exit
EndFunc ;==>QuitApp

Very nice effect,

is possible to do same thing with a GUI, but capable to be moved by user ?

m.

Share this post


Link to post
Share on other sites

Very nice effect,

is possible to do same thing with a GUI, but capable to be moved by user ?

m.

Yes, try this:

#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <SendMessage.au3>

Const $SM_CXFIXEDFRAME = 7;, $SM_CXVSCROLL = 2,Const $SM_CYCAPTION = 4

$main_Gui = GUICreate("", 400, 400, 20, 20)
$but1 = GUICtrlCreateButton(" Exit ", 100, 100, 80, 21)
$Info_Edit = GUICtrlCreateEdit("A few words ", 80, 150, 300, 220)

$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)

$TitleHt = $wtitle[0] + $wside[0]
$pp = WinGetClientSize($main_Gui)

$Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $wside[0], "long", $TitleHt, "long", $wside[0] + $pp[0], "long", $TitleHt + $pp[1])
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $main_Gui, "long", $Mask[0], "int", 1)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE, $but1
            Exit
        Case $msg = $GUI_EVENT_PRIMARYDOWN
            _SendMessage($main_Gui, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)
    EndSwitch
WEnd

Share this post


Link to post
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
Sign in to follow this  
Followers 0