Jump to content

Recommended Posts

Posted

hi how do u make a Gui hide out the screen and when u move the mouce to the right the gui slides out?

Look up MouseGetPos and WinMove.

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

Heres a crude little example to get you going.

There will be more fancy ways, after you look into it.

#include <GuiconstantsEx.au3>
HotKeySet("{ESC}", "_Exit")
$hGUI = GUICreate("Window", 200, 200, @DesktopWidth, -1)
GUISetBkColor(0xF0F0F0, $hGUI)
GUISetState()

While 1
    Sleep(20)
    $x = MouseGetPos()
    If $x[0] >= @DesktopWidth -1 Then
        Winmove($hGUI,"",@DesktopWidth - 200, (@DesktopHeight / 2) - 100)
    Endif
WEnd

Func _Exit()
    Exit
EndFunc

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

sweet thats what i kinda worked out just abit better then i had. but how do i make it move bak when i move the mouse of the gui

Edited by hot202
Posted
Posted

i been playing around and i have this script. The only problem is that when u move your mouse away from the right abit the gui slides away even if your mouse is still on the gui.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$GUI = GUICreate("Window Slide In", 300, 300, @DesktopWidth - 1, @DesktopHeight - 320, $WS_POPUP)
GUICtrlCreateButton("Button Test", 0, -1)
GUISetState()
$WPos = WinGetPos($GUI)

While 1
    Sleep(100)
    $MPos = MouseGetPos()
    If ($MPos[0] >= $WPos[0]) And ($MPos[0] <= ($WPos[0] + $WPos[2])) And _
            ($MPos[1] >= $WPos[1]) And ($MPos[1] <= ($WPos[1] + $WPos[3])) Then
        WinMove($GUI, "", @DesktopWidth - 300, @DesktopHeight - 320, 300, 300, 3)
    ElseIf ($MPos[0] < $WPos[0]) Or ($MPos[0] > ($WPos[0] + $WPos[2])) Or _
        ($MPos[1] < $WPos[1]) Or ($MPos[1] > ($WPos[1] + $WPos[3])) Then
        WinMove($GUI, "", @DesktopWidth - 1, @DesktopHeight - 320, 300, 300, 3)
    EndIf
    If GUIGetMsg() = -3 Then Exit
WEnd
Posted

ok thanks. I now have a new problem i have made it slide out but when i put picture ans a input on the gui when it slides out the pic and input flash blank for a sec then they come bak is there anyway to fix that? Or is there abetter way to do it? Thanks guys.

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

$GUI = GUICreate("Window Slide In", 338, 258, @DesktopWidth - 1, @DesktopHeight - 320, $WS_POPUP)
WinSetOnTop($GUI,"",1)
$Input1 = GUICtrlCreateInput("Test", 72, 125, 185, 21)

$n = GUICtrlCreatePic(@ScriptDir & "\Background.bmp", 0, 0, 338, 258, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState()
$WPos = WinGetPos($GUI)

While 1
    Sleep(100)
    $MPos = MouseGetPos()
    If ($MPos[0] >= $WPos[0]) And ($MPos[0] <= ($WPos[0] + $WPos[2])) And _
            ($MPos[1] >= $WPos[1]) And ($MPos[1] <= ($WPos[1] + $WPos[3])) Then
        WinMove($GUI, "", @DesktopWidth - 338, @DesktopHeight - 320, 338, 258, 3)
    ElseIf ($MPos[0] < $WPos[0] - 300) Or ($MPos[0] > ($WPos[0] + $WPos[2])) Or _
        ($MPos[1] < $WPos[1]) Or ($MPos[1] > ($WPos[1] + $WPos[3])) Then
        WinMove($GUI, "", @DesktopWidth - 1, @DesktopHeight - 320, 338, 258, 3)
    EndIf
    If GUIGetMsg() = -3 Then Exit
WEnd

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
  • Recently Browsing   0 members

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