Jump to content
Sign in to follow this  
gil900

Need help deleting something in GUI

Recommended Posts

gil900

Look at that image below:

Posted Image

I want to delete only what I marked in red so that only what is marked in green will remain.

this is my code:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <IE.au3>
;
#region Basic GUI
;
Global $GUIActiveX, $oIE; probably these should be globals so you can delete them later.
$gif = FileOpenDialog("Select Animated Gif", @ScriptDir, "gif files (*.gif)", 3)
$hGui = GUICreate("MyStuff", 300, 300)
WinSetTrans($hGui, "", 160)
GUISetBkColor(0x000000)
;
;   || Label Controls  ||
GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
    $oIE = ObjCreate("Shell.Explorer")
    $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
    $oIE.navigate("about:blank")
    _IELoadWait($oIE)
    $oIE.document.parentWindow.offscreenBuffering = "true"
    $oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
    ;
    ; CSS background reference:  http://www.w3schools.com/css/css_background.asp
    $oIE.document.body.style.background = "#000000 url(" & $gif & ") repeat"
    $oIE.document.body.style.border = "0px";"4px outset"
    GUISetState()
    While 1
        Sleep(100)
    WEnd

What to do?

Thanks.

Edited by gil900

Share this post


Link to post
Share on other sites
wakillon

Try

$hGui = GUICreate("MyStuff", 300, 300, -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ) ) ; or BitOR ( $WS_POPUP, $WS_THICKFRAME )
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
gil900
gil900

Now I want to move what I marked in red in the following picture:

Posted Image

To the center ..

How is it done?

Share this post


Link to post
Share on other sites
wakillon

you want a gui with round corner ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
gil900

Share this post


Link to post
Share on other sites
wakillon

Try this for a round

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <IE.au3>

#region Basic GUI

Global $GUIActiveX, $oIE; probably these should be globals so you can delete them later.
$gif = FileOpenDialog("Select Animated Gif", @ScriptDir, "gif files (*.gif)", 3)
$hGui = GUICreate("MyStuff", 300, 300, -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ) )
$a = CreateRoundRectRgn(0,0,300,300,300,300)
SetWindowRgn($hGUI,$a)

WinSetTrans($hGui, "", 160)
GUISetBkColor(0x000000)

GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
$oIE = ObjCreate("Shell.Explorer")
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
$oIE.navigate("about:blank")
_IELoadWait($oIE)
$oIE.document.parentWindow.offscreenBuffering = "true"
$oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
$oIE.document.body.style.background = "#000000 url(" & $gif & ") repeat"
$oIE.document.body.style.border = "0px";"4px outset"
GUISetState()

While 1
    Sleep(100)
WEnd

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Func CreatePolyRgn($pt)
    Local $ALTERNATE = 1
    Local $buffer = ""
    $pt = StringSplit($pt,",")
    For $i = 1 to $pt[0]
        $buffer = $buffer & "int;"
    Next
    $buffer = StringTrimRight($buffer,1)
    $lppt = DllStructCreate($buffer)
    For $i = 1 to $pt[0]
        DllStructSetData($lppt,$i,$pt[$i])
    Next
    $ret = DllCall("gdi32.dll","long","CreatePolygonRgn","ptr",DllStructGetPtr($lppt),"int",Int($pt[0] / 2),"int",$ALTERNATE)
    Return $ret[0]
EndFunc

Func CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2)
    $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2)
    Return $ret[0]
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
wakillon

Change this part

$a = CreateRoundRectRgn ( 0, 0, 300, 200, 300, 300 )

for an oval ! Posted Image

Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
gil900

Now it looks this:

Posted Image

I want to erase what I marked in red.

How is it done?

This new code:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <IE.au3>
;
#region Basic GUI
Global $GUIActiveX, $oIE, $size
$size = WinGetClientSize("Program Manager", "")
$gif = "D:\loading.gif"
$hGui = GUICreate("MyStuff", $size[0], $size[1], -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ) ) ; or BitOR ( $WS_POPUP, $WS_THICKFRAME )
WinSetTrans($hGui, "", 160)
GUISetBkColor(0x000000)
GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
$oIE = ObjCreate("Shell.Explorer")
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
$oIE.navigate("about:blank")
_IELoadWait($oIE)
$oIE.document.parentWindow.offscreenBuffering = "true"
$oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
$oIE.document.body.style.background = "#000000 url(" & "" & ") repeat"
$oIE.document.body.style.border = "1px";"4px outset"
GUISetState()
Sleep(2500)
$hGui02 = GUICreate("MyStuff", 300, 300, -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ) )
GUISetBkColor(0x000000)
GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
WinSetTrans($hGui02, "", 115)
WinSetOnTop($hGui02, "", 1)
$oIE = ObjCreate("Shell.Explorer")
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
$oIE.navigate("about:blank")
_IELoadWait($oIE)
$oIE.document.parentWindow.offscreenBuffering = "true"
$oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
$oIE.document.body.style.background = "#000000 url(" & $gif & ") repeat"
$oIE.document.body.style.border = "1px";"4px outset"
GUISetState()
Sleep(10000)

Share this post


Link to post
Share on other sites
wakillon

Like this

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <IE.au3>
;
#region Basic GUI
Global $GUIActiveX, $oIE, $size
$size = WinGetClientSize("Program Manager", "")
$gif = "D:\loading.gif"
$hGui = GUICreate("MyStuff", $size[0], $size[1], -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ), -1 , WinGetHandle ( AutoItWinGetTitle ( ) ) )
WinSetTrans($hGui, "", 160)
GUISetBkColor(0x000000)
GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
$oIE = ObjCreate("Shell.Explorer")
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
$oIE.navigate("about:blank")
_IELoadWait($oIE)
$oIE.document.parentWindow.offscreenBuffering = "true"
$oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
$oIE.document.body.style.background = "#000000 url(" & "" & ") repeat"
$oIE.document.body.style.border = "1px";"4px outset"

GUISetState()
Sleep(2500)
$hGui02 = GUICreate("MyStuff", 300, 300, -1, -1, BitOR ( $WS_POPUP, $WS_BORDER ), -1 , WinGetHandle ( AutoItWinGetTitle ( ) ) )
GUISetBkColor(0x000000)
GUICtrlSetColor(-1, 0xFFFED8)
GUICtrlSetBkColor(-1, 0x000000)
WinSetTrans($hGui02, "", 115)
WinSetOnTop($hGui02, "", 1)
$oIE = ObjCreate("Shell.Explorer")
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 300)
$oIE.navigate("about:blank")
_IELoadWait($oIE)
$oIE.document.parentWindow.offscreenBuffering = "true"
$oIE.document.body.style.overflow = "hidden";$oIE.document.body.scroll = "no"
$oIE.document.body.style.background = "#000000 url(" & $gif & ") repeat"
$oIE.document.body.style.border = "1px";"4px outset"
GUISetState()
Sleep(10000)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
gil900

Thanks!

Now I added more code. In this code and this code:

While statement 1
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p1", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p2", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p3", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p4", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p5", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p6", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p7", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p8", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p9", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p10", "explorer.exe"))
ExitLoop
WEnd
Sleep (1500)

So now the loading screen closeing after the Process Located in the INI loaded..

But there are some problems:

This loading screen a bit heavy and takes some time to load run when windows loads. It is necessary that all this will load faster because it should load first before any other programs that load on windows (it is necessary that this will appear immediately after the wolcome screen)

How is it done?

Share this post


Link to post
Share on other sites
wakillon

Thanks!

Now I added more code. In this code and this code:

While statement 1
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p1", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p2", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p3", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p4", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p5", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p6", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p7", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p8", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p9", "explorer.exe"))
ProcessWait (IniRead (@ WorkingDir & "\ settings.ini", "proseses", "p10", "explorer.exe"))
ExitLoop
WEnd
Sleep (1500)

So now the loading screen closeing after the Process Located in the INI loaded..

But there are some problems:

This loading screen a bit heavy and takes some time to load run when windows loads. It is necessary that all this will load faster because it should load first before any other programs that load on windows (it is necessary that this will appear immediately after the wolcome screen)

How is it done?

Why use a while loop if you put an ExitLoop at the end ? Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
gil900

Share this post


Link to post
Share on other sites
wakillon

This loading screen a bit heavy and takes some time to load run when windows loads.

It's only because windows is loading that loading screen take some time.

When do you use this While/ Loop in your script ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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  

×