Jump to content

Help my Script..


eri
 Share

Recommended Posts

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

$hP = GUICreate("About", 300, 325)
GUISetBkColor(0xA0A0A0)
$image = GUICtrlCreatePic("Image.jpg", 5, 5, 290, 190, $WS_BORDER, $WS_EX_CLIENTEDGE)
$Ok = GUICtrlCreateButton("Button", 213, 290, 80, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Gloucester MT Extra Condensed")
$Label = GUICtrlCreateLabel("HomePage :", 10, 285, 65, 15)
$Label1 = GUICtrlCreateLabel("www.AutoItScript.com", 10, 300, 130, 15)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)

    $hGUI =GUICreate("Animation Text", 286, 75, 6, 203, BitOR($WS_MINIMIZEBOX, $WS_CHILD,$WS_BORDER),-1,$hP)
    $label2 = GUICtrlCreateLabel("AutoIt"& @CRLF _
    &"Sample AutoIt Scirpt"& @CRLF _
    &"I Want Stop This Animation When Cursor Stuck This Text" & @CRLF _
    &"..0O Help Me O0..", 10, 10, 240, 100,$SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS")
    GUISetState()

_MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, "SCROLLDOWN", "", "", $hGUI, -1)
_MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, "SCROLLUP", "", "", $hGUI, -1)
_MouseSetOnEvent($MOUSE_MOVE_EVENT, "MOVE", "", "", $hGUI, -1)

$fFlag = True
While 1
    For $x = 1 To 160
     If $fFlag = True Then GUICtrlSetPos($label2, 20, 75 - $x)
    Sleep(40)
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE, $Ok
    Exit
    Case $Label1
    ShellExecute("www.AutoItScript.com")
    EndSwitch
    Next
WEnd


Func SCROLLDOWN()
    GUICtrlCreateLabel("..0O Help Me O0.. "&@CRLF _
    &"ScrollDown label2 If Mouse Is Scroll Down ", 10, 10, 240, 100,$SS_CENTER)
EndFunc

Func MOVE()
    $fFlag = False
EndFunc

Func SCROLLUP()
    GUICtrlCreateLabel("..0O Help Me O0.."&@CRLF _
    &"ScrollUp label2 If Mouse Is Scroll Up ", 10, 10, 240, 100,$SS_CENTER)
EndFunc

I`m Sorry Melba I can`t Solve my own problem. :mellow::(

Maybe it`s Simple but really.. I don`t know what common to use to make script as i wish..

Please All master.. Help Me or give me a sample to make GUICtrlCreateLabel move able like about in Koda..

Edited by eri
Link to comment
Share on other sites

Funny you should mention M23 as I seen in one of his example scrips the other day had a movable label.

here is a simple reconstruct to give you an idea of how to employ it in your script.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <SendMessage.au3>
HotKeySet("!^l","_LockLabel")
Opt("MustDeclareVars", 1) ;1=Enabled
Global $label, $msg
Global $bLock = True
GUICreate("", 300, 300)
$label = GUICtrlCreateLabel("Moveable", 100, 145, 100, 12)
GUICtrlCreateLabel("Ctrl Alt + L Toggles Lock Label", 80, 270, 150, 15)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $GUI_EVENT_PRIMARYDOWN
            _ControlMove($label)
    EndSelect
WEnd

Func _ControlMove($hControl)
    If $bLock Then
        Local $aCurPos = GUIGetCursorInfo()
        If @error Then Return False
        If $aCurPos[4] = $hControl Then _SendMessage(GUICtrlGetHandle($hControl), $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)
        Return True
    EndIf
    Return False
EndFunc   ;==>_ControlMove

Func _LockLabel()
    $bLock = Not $bLock
EndFunc
Edited by JohnOne

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

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Thank`s JohnOne

If $aCurPos[4] = $hControl Then _SendMessage(GUICtrlGetHandle($hControl), $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)

whether the value [4] at $aCurPos Is $array[4] = ID of the control that the mouse cursor is hovering over (or 0 if none)

or $array[4] = The current Y position of the mouse cursor (relative to the GUI window)???

Why GUICtrlCreateLabel cant`t fly when create in Child Gui??

BitOR($WS_MINIMIZEBOX, $WS_CHILD,$WS_BORDER),-1,$hP)

Work If BitOR($WS_MINIMIZEBOX, $WS_CHILD, $WS_BORDER, $WS_POPUP),-1,$hP) But $hGUI Not In $hP

Please Fot All Master..

M23 I was not able and No have idea anymore.. Please Help me again.. :mellow:

Edited by eri
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...