Sign in to follow this  
Followers 0
hot202

hide gui right of screen?

13 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

ok thanks im not really sure how to put this together. Is there any examples?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  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

Share this post


Link to post
Share on other sites

r there any examples of this i cant really get it working

Share this post


Link to post
Share on other sites

what do i search tho i have scarched heaps of things i dont know what its called when the window hides out the screen

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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