Jump to content

Window with no title bar ande no border


ame1011
 Share

Recommended Posts

Hi I'd like to remove the border and the title bar from my window. I wasn't really able to find anything of much use to me in the help file and i was wondering if someone could point me in the right direction.

Additionally, I had a "drag window by clicking on any part of the GUI" function that worked perfectly until I placed an image on top of the GUI. I was wondering how i can recover the functionality that I had before I added the image. I tried removing focus on the image but that didn't work.

Thanks in advance.

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Hi I'd like to remove the border and the title bar from my window. I wasn't really able to find anything of much use to me in the help file and i was wondering if someone could point me in the right direction.

Look at GUI Control Styles Appendix in the helpfile.

Additionally, I had a "drag window by clicking on any part of the GUI" function that worked perfectly until I placed an image on top of the GUI. I was wondering how i can recover the functionality that I had before I added the image. I tried removing focus on the image but that didn't work.

Please post some code.
Link to comment
Share on other sites

Hi I'd like to remove the border and the title bar from my window. I wasn't really able to find anything of much use to me in the help file and i was wondering if someone could point me in the right direction.

Additionally, I had a "drag window by clicking on any part of the GUI" function that worked perfectly until I placed an image on top of the GUI. I was wondering how i can recover the functionality that I had before I added the image. I tried removing focus on the image but that didn't work.

Thanks in advance.

You should have found what you want in the help, under styles. You need $WS_POPUP.

Can you show the code for the dragging window? Have you tried disabling the image?

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.
Link to comment
Share on other sites

#include <GUIConstants.au3>

Global Const $WM_LBUTTONDOWN = 0x0201
Global Const $INI = "sl_config.ini"

Opt("GUIOnEventMode", 1)
AutoItSetOption ( "MouseCoordMode", 0)

$gui = GUICreate("Speed Launch 1.0", 300, 60, Default, Default, Default, $WS_EX_ACCEPTFILES)
GUISetState()

$Pic_1 = GuiCtrlCreatePic("bg.jpg", 0, 0, 300, 60)
GUICtrlSetState ( $Pic_1, $GUI_NOFOCUS )

;~ Const $WM_DROPFILES = 0x233
GUIRegisterMsg(0x233, "On_WM_DROPFILES")
;~ Close Method
GUISetOnEvent($GUI_EVENT_CLOSE, "QUIT")
;- Windows move
GuiRegisterMsg($WM_LBUTTONDOWN, "_WinMove")

;Load Settings from ini
;----------------------
While 1
    sleep (100)
WEnd 


Func On_WM_DROPFILES($hWnd, $Msg, $wParam, $lParam)
    Local $tDrop, $aRet, $iCount
    ;string buffer for file path
    $tDrop = DllStructCreate("char[260]")
    ;get file count
    $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "uint", -1, "ptr", DllStructGetPtr($tDrop), "int", DllStructGetSize($tDrop))
    $iCount = $aRet[0]
    ;get file paths
    For $i = 0 To $iCount-1
        $aRet = DllCall("shell32.dll", "int", "DragQueryFile","hwnd", $wParam,"uint", $i,"ptr", DllStructGetPtr($tDrop),"int", DllStructGetSize($tDrop))
        $loc = DllStructGetData($tDrop, 1)
        
        If (StringRight($loc, 4) = '.lnk') Then
            $aLoc = FileGetShortcut ( $loc )
            $loc = $aLoc[0]
            $loc_icon = $aLoc[4]
            ConsoleWrite("Loc: " & $loc & @CRLF & "ICON: " & $loc_icon & @CRLF)
        Else
            ConsoleWrite($loc & @CRLF)
        EndIf
            
        
    Next
    ;finalize
    DllCall("shell32.dll", "int", "DragFinish", "hwnd", $wParam)
    Return
EndFunc

Func QUIT()
    exit
EndFunc

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    
    ;-Get Mouse POS, check if one of the buttons have been clicked
    $pos = MouseGetPos()
    
    ;if - clicked
    ;if ? clicked
    ;if x clicked
    
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc

BG Image attached : post-6174-1193767039_thumb.jpg

I've tried disabling it, to no avail. Also, do I apply the style WS_POPUP using the BitOr operator? I saw it in the helpfile the first time I looked but I didn't think it was what I was looking for for some reason.

Edited by ame1011
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

#include <GUIConstants.au3>

Global Const $WM_LBUTTONDOWN = 0x0201
Global Const $INI = "sl_config.ini"

Opt("GUIOnEventMode", 1)
AutoItSetOption ( "MouseCoordMode", 0)

$gui = GUICreate("Speed Launch 1.0", 300, 60, Default, Default,$WS_POPUP, $WS_EX_ACCEPTFILES)
GUISetState()

$Pic_1 = GuiCtrlCreatePic("bg.jpg", 0, 0, 300, 60)
GUICtrlSetState ( $Pic_1, $GUI_DISABLE )


;- Windows move
GuiRegisterMsg($WM_LBUTTONDOWN, "_WinMove")

;Load Settings from ini
;----------------------
While 1
    sleep (100)
WEnd


Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc

************ EDIT: TESTED

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Thanks Valuater, the visual style is exactly what I was going for. However, I also tried using the $NO_FOCUS and that didn't work for me. Your example also doesn't allow me to drag.

EDIT: And that's why they pay you the big bucks, lol.

Thanks again.

Edited by ame1011
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG

DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)

Can you tell me what window state 32 is, and what parameter 0xF009 is please?

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.
Link to comment
Share on other sites

Can you tell me what window state 32 is, and what parameter 0xF009 is please?

I'm not sure, that was created by MsCreator here... after researching other posts with similar "drag" functions

http://www.autoitscript.com/forum/index.ph...st&p=420059

You were a part of this one

http://www.autoitscript.com/forum/index.ph...st&p=416931

GaryFrost uses this

Func _Drag($h_gui)
    DllCall("user32.dll", "int", "ReleaseCapture")
    DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0)
EndFunc   ;==>_Drag

I just use what works... <_<

8)

WinGetState()

32 = Window is maximized

Edited by Valuater

NEWHeader1.png

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...