Jump to content

remove white border


santoshM
 Share

Recommended Posts

i have a problem it is showing white border around form , i want to remove that border. here is my code, i also want my form should be movable by mouse

;Main logic start;;;;;;;;;;;;;;;;;;;;;;;;;;

Global Const $MYBLUE = 0x0B0511
Dim $szDrive, $szDir, $szFName, $szExt
Global $oIE = _IECreateEmbedded()

Global $hGUI = GUICreate($applicationName, 940, 640, _
        (@DesktopWidth - 940) / 2, (@DesktopHeight - 640) / 2, $WS_POPUP + $WS_CLIPCHILDREN + $WS_CLIPSIBLINGS)
        ;$WS_POPUP)
        GUICtrlSetBkColor(-1,$MYBLUE )


GUICtrlCreateObj($oIE, 0, 0, 940, 640)
GUICtrlSetBkColor(-1,$MYBLUE )
GUICtrlSetStyle(-1, BitOR($WS_EX_TRANSPARENT,$WS_EX_LAYERED))

Link to comment
Share on other sites

This will change the background of the Gui correctly (you had GUICtrlSetBkColor) and then resize the IE Object to be smaller than the Gui

Global $hGUI = GUICreate("Application Name", 940, 640, (@DesktopWidth - 940) / 2, (@DesktopHeight - 640) / 2, BitOR($WS_POPUP, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS))
    GUISetBkColor($MYBLUE)
    GUICtrlCreateObj($oIE, 2, 2, 936, 636)
Link to comment
Share on other sites

The following will:

Change the Gui BGColor
Change the default IE Object BGColor
Enable moving the Window by using the border of the Gui

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>

Global Const $MYBLUE = 0x0B0511
Dim $szDrive, $szDir, $szFName, $szExt
Global $oIE = _IECreateEmbedded()

Global $hGUI = GUICreate("Application Name", 950, 650, (@DesktopWidth - 950) / 2, (@DesktopHeight - 650) / 2, BitOR($WS_POPUP, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS))
        GUISetBkColor($MYBLUE)

;~ Navigate to about:blank and then change bgcolor
GUICtrlCreateObj($oIE, 10, 10, 930, 630)
    $oIE.Navigate("about:blank")
    $oIE.Document.Body.BGColor = $MYBLUE
    $oIE.Document.Body.Scroll = "No"

GUISetState()

;~ Test to show changes
Sleep(3000)
$oIE.Navigate("https://www.autoitscript.com")
;~ End Test
GUIRegisterMsg($WM_NCHITTEST, "_MY_NCHITTEST")

While 1
    Local $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd

;~ http://www.autoitscript.com/wiki/Moving_and_Resizing_PopUp_GUIs
 Func _MY_NCHITTEST($hWnd, $uMsg, $wParam, $lParam)
     Switch $hWnd
         Case $hGUI
             Local $aPos = WinGetPos($hWnd) ; Check if mouse is over top 650 pixels
             If Abs(BitAND(BitShift($lParam, 16), 0xFFFF) - $aPos[1]) < 650 Then Return $HTCAPTION
     EndSwitch
     Return $GUI_RUNDEFMSG
 EndFunc   ;==>_MY_NCHITTEST

 

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