Jump to content

Animated pointer


Go to solution Solved by PhoenixXL,

Recommended Posts

Posted

So I'm looking for a way to animate the pointer in this script to make it smoothly move with the mouse instead of painting/deleting-repeating....

I'm thinking along the lines of creating an array to hold the value of Mouse's Y coordinates and then using it for the Y of the pointer. Where I'm stuck is, how to implement this, I'm thinking a For....Loop maybe.

Any ideas, pointers (oops :D), or advice is welcome.

#region ; Pre-GUI

#region ; Includes begin here:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <_RecFileListToArray.au3>
#include <String.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <Toast.au3>
#include <GUICtrlOnHover.au3>
#NoTrayIcon
#endregion ; Includes end here;;;;;;;;;;;;;;;;;

#region ; Options are set here:
Opt("GUIOnEventMode", 1)
Opt("GUICloseOnEsc", 1)
#endregion ; Options end here:

#region ; Special Chr and coding begins here:
Global $Qmark = Chr(34)
Global $Comma = Chr(44)
Global $InputDef = "Program Currently Loaded: "
Global $cHour = @HOUR
Global $cMin = @MIN
Global $cDay = @MDAY
Global $cMonth = @MON
Global $cYear = @YEAR
Global $Pointer
Global $InputData
Global $SelectProgramList
Global $SearchResults
Global $sPath
Global $sLabel
Global $CurrentProgram
Global $SendValue = False
Global $TBValue = False
Global $LoginValue = False
$gdi_Logo = 0
$LOGO = 0
#endregion ; Special Chr and coding begins here:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SPLASH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;$Splash = GUICreate("SPLASH", 588.5, 200, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))
;GUISetBkColor(0xFFFFFF)
;$pSplash = GUICtrlCreatePic("C:\prog_res\Lab\test_res\storm_newlogo_TEST.jpg",0,0,588.5,200)
;GUISetState(@SW_SHOW, "SPLASH")
;Sleep(2000)
;GUIDelete("SPLASH")
;Sleep(10)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#region ; Main GUI begins here:

#region ; $MainGUI
$MainGUI = GUICreate("MainGUI", 774, 580, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))
GUISetBkColor(0xFFFFFF)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainGUIMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MainGUIMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "MainGUIRestore")
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
#endregion ; $MainGUI

#region ; Invisible Blocks behind buttons:
#region ; $Block1
$Block1 = GUICtrlCreateGraphic(10, 252, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block1

#region ; $Block2
$Block2 = GUICtrlCreateGraphic(10, 306, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block2

#region ; $Block3
$Block3 = GUICtrlCreateGraphic(10, 360, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block3

#region ; $Block4
$Block4 = GUICtrlCreateGraphic(10, 414, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block4

#region ; $Block5
$Block5 = GUICtrlCreateGraphic(0, 212, 10, 400)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block5

#endregion ; Invisible Blocks end here:

#region ; $Slogan
$Slogan = GUICtrlCreateLabel($Qmark & "Every Order" & $Comma & " Every Time" & $Qmark, 525, 40, 200, 20)
GUICtrlSetFont(-1, 12, 800, 0, "Arimo")
#endregion ; $Slogan

#region ; Black frame around data:
#region ; $gHorBar1
$gHorBar1 = GUICtrlCreateGraphic(175, 125, 600, 15)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar1

#region ; $gHorBar2
$gHorBar2 = GUICtrlCreateGraphic(475, 105, 400, 20)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar2

#region ; $gVertBar1
$gVertBar1 = GUICtrlCreateGraphic(175, 125, 15, 550)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gVertBar1

#region ; $gVertBar2
$gVertBar2 = GUICtrlCreateGraphic(10, 428, 125, 200)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
#endregion ; $gVertBar2

#region ; $Input1
$Input1 = GUICtrlCreateInput("", 503, 112, 250, 20)
GUICtrlSetOnEvent(-1, "Input1ENTER")
#endregion ; $Input1
#endregion ; Black frame around data:

#region ; MainGUI Buttons:
#region ; $mButton1
$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button1_Hover", "Button1_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Send_Program")
#endregion ; $mButton1

#region ; $mButton2
$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button2_Hover", "Button2_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Tool_Box")
#endregion ; $mButton2

#region ; $mButton3
$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button3_Hover", "Button3_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Login")
#endregion ; $mButton3

#region ; $mButton4
$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button4_Hover", "Button4_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "Reset")
#endregion ; $mButton4

#region ; $mButton5
$mButton5 = GUICtrlCreateLabel(@CR & "X", 740, -10, 35, 30, $SS_CENTER)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "MainGUIClose")
#endregion ; $mButton5

#endregion ; MainGUI Buttons:

#region ; $Clock
$Clock = GUICtrlCreateLabel(@CR & $cDay & "/" & $cMonth & "/" & $cYear & " - " & $cHour - 12 & ":" & $cMin, 10, 428, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
#endregion ; $Clock

GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT

GUISetState(@SW_SHOW, "MainGUI")
#endregion ; Main GUI begins here:
#endregion

#region ; Post-GUI
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND");GUI watches for double click

AdlibRegister("ClockSetTime", 15000);Check and update clock every 15 seconds

_GDIPlus_Startup()
$gdi_Logo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test_res\storm_newlogo_title_sm.PNG")
$LOGO = _GDIPlus_GraphicsCreateFromHWND($MainGUI)
_GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)

While 1
    Sleep(100)
WEnd

#region ;Functions begin here:

#region ; GUICtrl Functions:

Func ClockSetTime()
    GUICtrlSetData($Clock, @CR & @MDAY & "/" & @MON & "/" & @YEAR & " - " & @HOUR - 12 & ":" & @MIN)
EndFunc   ;==>ClockSetTime

Func Search()
    Local $SearchPath = FileRead(@ScriptDir & "\test_res\PSS_T500_FilePath_Holder.txt")
    Local $InputData = GUICtrlRead($Input1)
    Local $SearchResults = _RecFileListToArray($SearchPath, $InputData & "*.lst*", 1, 1, 0, 2)
    If @error Then
        Local $eNote = _Toast_Show(0, "Error Code = " & @error, "Unable to locate file", 5)
        _Toast_Hide()
    Else
        Local $tResults = _ArrayToString($SearchResults)
        $sLabel = GUICtrlCreateLabel("Choose a program to begin: ", 275, 175, 200, 20)
        $SelectProgramList = GUICtrlCreateList("", 275, 200, 400, 100)
        GUICtrlSetData(-1, $tResults)

    EndIf
EndFunc   ;==>Search

Func Input1ENTER()
    GUICtrlDelete($sLabel)
    GUICtrlDelete($SelectProgramList)
    Search()
    GUICtrlSetData($Input1, "")
EndFunc   ;==>Input1ENTER

Func Display_Results()
        $SendValue = True
        $TBValue = True
        $LoginValue = True

EndFunc

Func _Send_Program()
    If $SendValue = False Then
        MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$SendValue' & @lf & @lf & 'Return:' & @lf & $SendValue) ;### Debug MSGBOX
    Else
        MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$SendValue' & @lf & @lf & 'Return:' & @lf & $SendValue) ;### Debug MSGBOX
    EndIf
EndFunc

Func _Tool_Box()
    If $TBValue = False Then
        MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$TBValue' & @lf & @lf & 'Return:' & @lf & $TBValue) ;### Debug MSGBOX
    Else
        MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$TBValue' & @lf & @lf & 'Return:' & @lf & $TBValue) ;### Debug MSGBOX
    EndIf
EndFunc

Func _Login()
    If $LoginValue = False Then
        $LoginValue = InputBox("Log In", "Enter Your Employee ID" & @CRLF, "", "*")
    Else
        MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$LoginValue' & @lf & @lf & 'Return:' & @lf & $LoginValue) ;### Debug MSGBOX
    EndIf
EndFunc

#endregion

#region ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);Dbl-clk processing

    #forceref $hWnd, $iMsg, $lParam

    $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
    $iCode = BitShift($wParam, 16) ; Hi Word

    Switch $iCode
        Case $LBN_DBLCLK
            Switch $iIDFrom
                Case $SelectProgramList
                    $CurrentProgram = GUICtrlRead($SelectProgramList) ; Use the native function
                    GUICtrlDelete($SelectProgramList)
                    GUICtrlDelete($sLabel)
                    Display_Results()
            EndSwitch
    EndSwitch

EndFunc   ;==>_WM_COMMAND

Func WM_PAINT($MainGUI, $iMsg, $wParam, $lParam);PNG drawing
    _GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)
    Return 'GUI_RUNDEFMSG'
EndFunc   ;==>WM_PAINT

Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam);Window Dragging
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST
#endregion

#region ; Window-Control Functions:

Func MainGUIClose();Shuts down and disposes of GDI elements, Deletes GUI and exits script
    _GDIPlus_GraphicsDispose($gdi_Logo)
    _GDIPlus_ImageDispose($LOGO)
    _GDIPlus_Shutdown()
    GUIDelete("MainGUI")
    Exit
EndFunc   ;==>MainGUIClose

Func Reset();Exits, then runs the script again, thus resetting it
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>Reset

Func MainGUIMaximize()

EndFunc   ;==>MainGUIMaximize

Func MainGUIMinimize()

EndFunc   ;==>MainGUIMinimize

Func MainGUIRestore()

EndFunc   ;==>MainGUIRestore
#endregion

#region ; Hover Functions:
Func Button1_Hover()
    $Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", 140, 220, 26, 25)
EndFunc   ;==>Button1_Hover

Func Button1_LeaveHover()
    GUICtrlDelete($Pointer)
EndFunc   ;==>Button1_LeaveHover

Func Button2_Hover()
    $Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", 140, 274, 26, 25)
EndFunc   ;==>Button2_Hover

Func Button2_LeaveHover()
    GUICtrlDelete($Pointer)
EndFunc   ;==>Button2_LeaveHover

Func Button3_Hover()
    $Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", 140, 328, 26, 25)
EndFunc   ;==>Button3_Hover

Func Button3_LeaveHover()
    GUICtrlDelete($Pointer)
EndFunc   ;==>Button3_LeaveHover

Func Button4_Hover()
    $Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", 140, 382, 26, 25)
EndFunc   ;==>Button4_Hover

Func Button4_LeaveHover()
    GUICtrlDelete($Pointer)
EndFunc   ;==>Button4_LeaveHover
#endregion

#endregion ;Functions begin here:

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

tumbleweed.gif

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

Have you thought of using actual animated mouse pointers?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I have, and I'm still looking at options. But I was wanting to try something like what I have in the script now but more fluid and not bilnking in and out. I'm studying the MouseCoord items in the helpfile, I just need a little guidence in implementation.

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

You'd get a better response if you'd post a runnable example script.

Currently, no  one can run it without the graphics you're using.

Plus it would be better to provide links to the non-standard includes you're using because unless someone were very motivated, they're not going to go searching for all of these includes just to test a script they can't run.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I'll throw together a zip in an hour or so. My bad :/

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

  • Moderators
Posted

Wombat,

And while you are there - my RecFileListToArray UDF #include file does not have a leading underscore. The function certainly does, but not the file itself. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Wombat,And while you are there - my RecFileListToArray UDF #include file does not have a leading underscore. The function certainly does, but not the file itself. ;)M23

actually I renamed it to that by accident in my filesystem, and never changed it. ill change it so it doesn't confuse other members

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

AutoIT being an Interpreter can't provide that speed with native GDI+ for mouse movement cursors. Hence the native GDI+ will consume much CPU. If you want to do it in Autoit then you should take into consideration some other Graphic Library.

Otherwise,

You can download animated cursors or you can create your own animated cursors (do some googling). Thereafter set the cursor for your program or control using _WinAPI_SetClassLongEx (from the WinAPIEx library)

I will provide you with an example soon.

Regards

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted (edited)

The Example has been attached

Example.7z

Want to create your own Cursor (it might take time)

http://www.gdgsoft.com/anituner/

find some more from here http://www.anicursor.com/download.html

Edit : >WinAPIEx Library

Regards :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

zip with necessary testing files, sorry for the short post the babe is crying for a bottle, I'll reply with a proper post momentarily

tempex.zip

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

I'm not getting what you're wanting to do, even with a runnable script. The pointer is supposed to change to your jpg, and then what? I see that it's not moving fluidly with the mouse pointer it just jumps from button to button as you move the mouse, is that what you're attempting to do?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted (edited)
I'm not getting what you're wanting to do, even with a runnable script. The pointer is supposed to change to your jpg, and then what? I see that it's not moving fluidly with the mouse pointer it just jumps from button to button as you move the mouse, is that what you're attempting to do?

 

Same with me, OP seems to be ambiguous for any possible help.

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

I'm not getting what you're wanting to do, even with a runnable script. The pointer is supposed to change to your jpg, and then what? I see that it's not moving fluidly with the mouse pointer it just jumps from button to button as you move the mouse, is that what you're attempting to do?

 

Ok, so when the user hovers over certain GUICtrls the mouse becomes hidden and the "pointer" is shown.

For now the pointer only jumps between buttons per which ever you're hovering over. What I'm wanting to accomplish is that instead of being deleted and repainted it appears and moves upon its Y coordinate according to the mouse's Y coordinate. So that it has a smooth effect and actually appears to be the mouse pointer.

 

Same with me, OP seems to be ambiguous for any possible help.

 

I apologize if i'm not properly communicating what I'm attempting here. What I have now is what I started with but am wondering if there would be a way to paint the "pointer" graphic and then have it move with the mouse on its Y coordinate.

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

Change the mouse pointer using a custom mouse cursor instead of trying to make a jpg move with it. It would be far easier to do that than trying to update the mouse pointer just to move a picture around. Especially if the computer is busy doing something in the background that will slow down your script.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Change the mouse pointer using a custom mouse cursor instead of trying to make a jpg move with it. It would be far easier to do that than trying to update the mouse pointer just to move a picture around. Especially if the computer is busy doing something in the background that will slow down your script.

 

I take away from this that its a relatively bad idea??? Because just changing the mouse pointer would not accomplish what I'm attempting, which is a pointer off to the right side of the buttons that remains at a set X coordinate but moves upon its Y coordinate whilst hovering over the buttons...

Not a necessary thing, just thought it would look nice, I was inspired by the dialogue selector in the Mass Effect series which moves with the pointer.

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted (edited)

So perform a move-hide-show rather than creation deletion.

The following is the code, modified by me (BigPicture.au3)

#region ; $mButton1
$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button1_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Send_Program")
#endregion ; $mButton1

#region ; $mButton2
$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button2_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Tool_Box")
#endregion ; $mButton2

#region ; $mButton3
$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button3_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Login")
#endregion ; $mButton3

#region ; $mButton4
$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button4_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "Reset")
#endregion ; $mButton4

$Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", -10, -10)
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState(@SW_SHOW, "MainGUI")


#region ; Hover Functions:
Func Button1_Hover()
    GUICtrlSetPos($Pointer, 140, 220, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button1_Hover

Func Button2_Hover()
    GUICtrlSetPos($Pointer, 140, 274, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button2_Hover

Func Button3_Hover()
    GUICtrlSetPos($Pointer, 140, 328, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button3_Hover

Func Button4_Hover()
    GUICtrlSetPos($Pointer, 140, 382, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button4_Hover

Func Button_LeaveHover()
    GUICtrlSetState($Pointer, $GUI_HIDE)
EndFunc   ;==>Button_LeaveHover
#endregion ; Hover Functions:

BigPicture.au3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Storm Production Software Suite - Trumpf500;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Author: JohnPaul Niswonger                                                                            ;;
;; Script name: SPSS_T500.au3                                                                            ;;
;; Date Started: Aug/7/2013                                                                              ;;
;; Date Published: -/-/-                                                                                 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#region ; Pre-GUI

#region ; Includes begin here:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <_RecFileListToArray.au3>
#include <String.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <Toast.au3>
#include <GUICtrlOnHover.au3>
#NoTrayIcon
#endregion ; Includes begin here:

#region ; Options are set here:
Opt("GUIOnEventMode", 1)
Opt("GUICloseOnEsc", 1)
#endregion ; Options are set here:

#region ; Special Chr and coding begins here:
Global $Qmark = Chr(34)
Global $Comma = Chr(44)
Global $InputDef = "Program Currently Loaded: "
Global $cHour = @HOUR
Global $cMin = @MIN
Global $cDay = @MDAY
Global $cMonth = @MON
Global $cYear = @YEAR
Global $Pointer
Global $InputData
Global $SelectProgramList
Global $SearchResults
Global $sPath
Global $sLabel
Global $CurrentProgram
Global $SendValue = False
Global $TBValue = False
Global $LoginValue = False
$gdi_Logo = 0
$LOGO = 0
#endregion ; Special Chr and coding begins here:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SPLASH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;$Splash = GUICreate("SPLASH", 588.5, 200, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))
;GUISetBkColor(0xFFFFFF)
;$pSplash = GUICtrlCreatePic("C:\prog_res\Lab\test_res\storm_newlogo_TEST.jpg",0,0,588.5,200)
;GUISetState(@SW_SHOW, "SPLASH")
;Sleep(2000)
;GUIDelete("SPLASH")
;Sleep(10)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#region ; Main GUI begins here:

#region ; $MainGUI
$MainGUI = GUICreate("MainGUI", 774, 580, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))
GUISetBkColor(0xFFFFFF)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainGUIMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MainGUIMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "MainGUIRestore")
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
#endregion ; $MainGUI

#region ; Invisible Blocks behind buttons:
#region ; $Block1
$Block1 = GUICtrlCreateGraphic(10, 252, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block1

#region ; $Block2
$Block2 = GUICtrlCreateGraphic(10, 306, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block2

#region ; $Block3
$Block3 = GUICtrlCreateGraphic(10, 360, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block3

#region ; $Block4
$Block4 = GUICtrlCreateGraphic(10, 414, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block4

#region ; $Block5
$Block5 = GUICtrlCreateGraphic(0, 212, 10, 400)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block5

#endregion ; Invisible Blocks behind buttons:

#region ; $Slogan
$Slogan = GUICtrlCreateLabel($Qmark & "Every Order" & $Comma & " Every Time" & $Qmark, 525, 40, 200, 20)
GUICtrlSetFont(-1, 12, 800, 0, "Arimo")
#endregion ; $Slogan

#region ; Black frame around data:
#region ; $gHorBar1
$gHorBar1 = GUICtrlCreateGraphic(175, 125, 600, 15)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar1

#region ; $gHorBar2
$gHorBar2 = GUICtrlCreateGraphic(475, 105, 400, 20)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar2

#region ; $gVertBar1
$gVertBar1 = GUICtrlCreateGraphic(175, 125, 15, 550)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gVertBar1

#region ; $gVertBar2
$gVertBar2 = GUICtrlCreateGraphic(10, 428, 125, 200)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
#endregion ; $gVertBar2

#region ; $Input1
$Input1 = GUICtrlCreateInput("", 503, 112, 250, 20)
GUICtrlSetOnEvent(-1, "Input1ENTER")
#endregion ; $Input1
#endregion ; Black frame around data:

#region ; MainGUI Buttons:
#region ; $mButton1
$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button1_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Send_Program")
#endregion ; $mButton1

#region ; $mButton2
$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button2_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Tool_Box")
#endregion ; $mButton2

#region ; $mButton3
$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button3_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Login")
#endregion ; $mButton3

#region ; $mButton4
$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)
_GUICtrl_OnHoverRegister(-1, "Button4_Hover", "Button_LeaveHover")
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "Reset")
#endregion ; $mButton4

#region ; $mButton5
$mButton5 = GUICtrlCreateLabel(@CR & "X", 740, -10, 35, 30, $SS_CENTER)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "MainGUIClose")
#endregion ; $mButton5

#endregion ; MainGUI Buttons:

#region ; $Clock
$Clock = GUICtrlCreateLabel(@CR & $cDay & "/" & $cMonth & "/" & $cYear & " - " & $cHour - 12 & ":" & $cMin, 10, 428, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
#endregion ; $Clock

GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT

$Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", -10, -10)
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState(@SW_SHOW, "MainGUI")
#endregion ; Main GUI begins here:
#endregion ; Pre-GUI

#region ; Post-GUI
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND");GUI watches for double click

AdlibRegister("ClockSetTime", 15000);Check and update clock every 15 seconds

_GDIPlus_Startup()
$gdi_Logo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test_res\storm_newlogo_title_sm.PNG")
$LOGO = _GDIPlus_GraphicsCreateFromHWND($MainGUI)
_GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)

While 1
    Sleep(100)
WEnd

#region ;Functions begin here:

#region ; GUICtrl Functions:

Func ClockSetTime()
    GUICtrlSetData($Clock, @CR & @MDAY & "/" & @MON & "/" & @YEAR & " - " & @HOUR - 12 & ":" & @MIN)
EndFunc   ;==>ClockSetTime

Func Search()
    Local $SearchPath = FileRead(@ScriptDir & "\test_res\PSS_T500_FilePath_Holder.txt")
    Local $InputData = GUICtrlRead($Input1)
    Local $SearchResults = _RecFileListToArray($SearchPath, $InputData & "*.lst*", 1, 1, 0, 2)
    If @error Then
        Local $eNote = _Toast_Show(0, "Error Code = " & @error, "Unable to locate file", 5)
        _Toast_Hide()
    Else
        Local $tResults = _ArrayToString($SearchResults)
        $sLabel = GUICtrlCreateLabel("Choose a program to begin: ", 275, 175, 200, 20)
        $SelectProgramList = GUICtrlCreateList("", 275, 200, 400, 100)
        GUICtrlSetData(-1, $tResults)

    EndIf
EndFunc   ;==>Search

Func Input1ENTER()
    GUICtrlDelete($sLabel)
    GUICtrlDelete($SelectProgramList)
    Search()
    GUICtrlSetData($Input1, "")
EndFunc   ;==>Input1ENTER

Func Display_Results()
    $SendValue = True
    $TBValue = True
    $LoginValue = True

EndFunc   ;==>Display_Results

Func _Send_Program()
    If $SendValue = False Then
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Send_Program

Func _Tool_Box()
    If $TBValue = False Then
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Tool_Box

Func _Login()
    If $LoginValue = False Then
        $LoginValue = InputBox("Log In", "Enter Your Employee ID" & @CRLF, "", "*")
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$LoginValue' & @LF & @LF & 'Return:' & @LF & $LoginValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Login

#endregion ; GUICtrl Functions:

#region ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);Dbl-clk processing

    #forceref $hWnd, $iMsg, $lParam

    $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
    $iCode = BitShift($wParam, 16) ; Hi Word

    Switch $iCode
        Case $LBN_DBLCLK
            Switch $iIDFrom
                Case $SelectProgramList
                    $CurrentProgram = GUICtrlRead($SelectProgramList) ; Use the native function
                    GUICtrlDelete($SelectProgramList)
                    GUICtrlDelete($sLabel)
                    Display_Results()
            EndSwitch
    EndSwitch

EndFunc   ;==>_WM_COMMAND

Func WM_PAINT($MainGUI, $iMsg, $wParam, $lParam);PNG drawing
    _GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)
    Return 'GUI_RUNDEFMSG'
EndFunc   ;==>WM_PAINT

Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam);Window Dragging
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST
#endregion ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:

#region ; Window-Control Functions:

Func MainGUIClose();Shuts down and disposes of GDI elements, Deletes GUI and exits script
    _GDIPlus_GraphicsDispose($gdi_Logo)
    _GDIPlus_ImageDispose($LOGO)
    _GDIPlus_Shutdown()
    GUIDelete("MainGUI")
    Exit
EndFunc   ;==>MainGUIClose

Func Reset();Exits, then runs the script again, thus resetting it
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>Reset

Func MainGUIMaximize()

EndFunc   ;==>MainGUIMaximize

Func MainGUIMinimize()

EndFunc   ;==>MainGUIMinimize

Func MainGUIRestore()

EndFunc   ;==>MainGUIRestore
#endregion ; Window-Control Functions:



#region ; Hover Functions:
Func Button1_Hover()
    GUICtrlSetPos($Pointer, 140, 220, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button1_Hover

Func Button2_Hover()
    GUICtrlSetPos($Pointer, 140, 274, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button2_Hover

Func Button3_Hover()
    GUICtrlSetPos($Pointer, 140, 328, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button3_Hover

Func Button4_Hover()
    GUICtrlSetPos($Pointer, 140, 382, 26, 25)
    GUICtrlSetState($Pointer, $GUI_SHOW)
EndFunc   ;==>Button4_Hover

Func Button_LeaveHover()
    GUICtrlSetState($Pointer, $GUI_HIDE)
EndFunc   ;==>Button_LeaveHover
#endregion ; Hover Functions:
Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

PhoenixXL's post:

So perform a move-hide-show rather than creation deletion.The following is the code, modified by me (BigPicture.au3)

#region ; $mButton1$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button1_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Send_Program")#endregion ; $mButton1#region ; $mButton2$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button2_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Tool_Box")#endregion ; $mButton2#region ; $mButton3$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button3_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Login")#endregion ; $mButton3#region ; $mButton4$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button4_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "Reset")#endregion ; $mButton4$Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", -10, -10)GUICtrlSetState(-1, $GUI_HIDE)GUISetState(@SW_SHOW, "MainGUI")#region ; Hover Functions:Func Button1_Hover()    GUICtrlSetPos($Pointer, 140, 220, 26, 25)   GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button1_HoverFunc Button2_Hover() GUICtrlSetPos($Pointer, 140, 274, 26, 25)   GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button2_HoverFunc Button3_Hover() GUICtrlSetPos($Pointer, 140, 328, 26, 25)   GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button3_HoverFunc Button4_Hover() GUICtrlSetPos($Pointer, 140, 382, 26, 25)   GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button4_HoverFunc Button_LeaveHover() GUICtrlSetState($Pointer, $GUI_HIDE)EndFunc   ;==>Button_LeaveHover#endregion ; Hover Functions:
BigPicture.au3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Storm Production Software Suite - Trumpf500;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Author: JohnPaul Niswonger                                                                            ;;;; Script name: SPSS_T500.au3                                                                            ;;;; Date Started: Aug/7/2013                                                                              ;;;; Date Published: -/-/-                                                                                 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#region ; Pre-GUI#region ; Includes begin here:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #NoTrayIcon#endregion ; Includes begin here:#region ; Options are set here:Opt("GUIOnEventMode", 1)Opt("GUICloseOnEsc", 1)#endregion ; Options are set here:#region ; Special Chr and coding begins here:Global $Qmark = Chr(34)Global $Comma = Chr(44)Global $InputDef = "Program Currently Loaded: "Global $cHour = @HOURGlobal $cMin = @MINGlobal $cDay = @MDAYGlobal $cMonth = @MONGlobal $cYear = @YEARGlobal $PointerGlobal $InputDataGlobal $SelectProgramListGlobal $SearchResultsGlobal $sPathGlobal $sLabelGlobal $CurrentProgramGlobal $SendValue = FalseGlobal $TBValue = FalseGlobal $LoginValue = False$gdi_Logo = 0$LOGO = 0#endregion ; Special Chr and coding begins here:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SPLASH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;$Splash = GUICreate("SPLASH", 588.5, 200, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP));GUISetBkColor(0xFFFFFF);$pSplash = GUICtrlCreatePic("C:\prog_res\Lab\test_res\storm_newlogo_TEST.jpg",0,0,588.5,200);GUISetState(@SW_SHOW, "SPLASH");Sleep(2000);GUIDelete("SPLASH");Sleep(10);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#region ; Main GUI begins here:#region ; $MainGUI$MainGUI = GUICreate("MainGUI", 774, 580, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))GUISetBkColor(0xFFFFFF)GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainGUIMinimize")GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MainGUIMaximize")GUISetOnEvent($GUI_EVENT_RESTORE, "MainGUIRestore")GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")#endregion ; $MainGUI#region ; Invisible Blocks behind buttons:#region ; $Block1$Block1 = GUICtrlCreateGraphic(10, 252, 125, 15)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0xFFFFFF)#endregion ; $Block1#region ; $Block2$Block2 = GUICtrlCreateGraphic(10, 306, 125, 15)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0xFFFFFF)#endregion ; $Block2#region ; $Block3$Block3 = GUICtrlCreateGraphic(10, 360, 125, 15)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0xFFFFFF)#endregion ; $Block3#region ; $Block4$Block4 = GUICtrlCreateGraphic(10, 414, 125, 15)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0xFFFFFF)#endregion ; $Block4#region ; $Block5$Block5 = GUICtrlCreateGraphic(0, 212, 10, 400)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0xFFFFFF)#endregion ; $Block5#endregion ; Invisible Blocks behind buttons:#region ; $Slogan$Slogan = GUICtrlCreateLabel($Qmark & "Every Order" & $Comma & " Every Time" & $Qmark, 525, 40, 200, 20)GUICtrlSetFont(-1, 12, 800, 0, "Arimo")#endregion ; $Slogan#region ; Black frame around data:#region ; $gHorBar1$gHorBar1 = GUICtrlCreateGraphic(175, 125, 600, 15)GUICtrlSetBkColor(-1, 0x3B3B3B)GUICtrlSetState(-1, $GUI_DISABLE)#endregion ; $gHorBar1#region ; $gHorBar2$gHorBar2 = GUICtrlCreateGraphic(475, 105, 400, 20)GUICtrlSetBkColor(-1, 0x3B3B3B)GUICtrlSetState(-1, $GUI_DISABLE)#endregion ; $gHorBar2#region ; $gVertBar1$gVertBar1 = GUICtrlCreateGraphic(175, 125, 15, 550)GUICtrlSetBkColor(-1, 0x3B3B3B)GUICtrlSetState(-1, $GUI_DISABLE)#endregion ; $gVertBar1#region ; $gVertBar2$gVertBar2 = GUICtrlCreateGraphic(10, 428, 125, 200)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)#endregion ; $gVertBar2#region ; $Input1$Input1 = GUICtrlCreateInput("", 503, 112, 250, 20)GUICtrlSetOnEvent(-1, "Input1ENTER")#endregion ; $Input1#endregion ; Black frame around data:#region ; MainGUI Buttons:#region ; $mButton1$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button1_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Send_Program")#endregion ; $mButton1#region ; $mButton2$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button2_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Tool_Box")#endregion ; $mButton2#region ; $mButton3$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button3_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "_Login")#endregion ; $mButton3#region ; $mButton4$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)_GUICtrl_OnHoverRegister(-1, "Button4_Hover", "Button_LeaveHover")GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "Reset")#endregion ; $mButton4#region ; $mButton5$mButton5 = GUICtrlCreateLabel(@CR & "X", 740, -10, 35, 30, $SS_CENTER)GUICtrlSetCursor(-1, 0)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)GUICtrlSetOnEvent(-1, "MainGUIClose")#endregion ; $mButton5#endregion ; MainGUI Buttons:#region ; $Clock$Clock = GUICtrlCreateLabel(@CR & $cDay & "/" & $cMonth & "/" & $cYear & " - " & $cHour - 12 & ":" & $cMin, 10, 428, 125, 40, $SS_CENTER)GUICtrlSetCursor(-1, 16)GUICtrlSetBkColor(-1, 0x353535)GUICtrlSetColor(-1, 0xFFFFFF)#endregion ; $ClockGUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT$Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", -10, -10)GUICtrlSetState(-1, $GUI_HIDE)GUISetState(@SW_SHOW, "MainGUI")#endregion ; Main GUI begins here:#endregion ; Pre-GUI#region ; Post-GUIGUIRegisterMsg($WM_COMMAND, "_WM_COMMAND");GUI watches for double clickAdlibRegister("ClockSetTime", 15000);Check and update clock every 15 seconds_GDIPlus_Startup()$gdi_Logo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test_res\storm_newlogo_title_sm.PNG")$LOGO = _GDIPlus_GraphicsCreateFromHWND($MainGUI)_GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)While 1   Sleep(100)WEnd#region ;Functions begin here:#region ; GUICtrl Functions:Func ClockSetTime() GUICtrlSetData($Clock, @CR & @MDAY & "/" & @MON & "/" & @YEAR & " - " & @HOUR - 12 & ":" & @MIN)EndFunc   ;==>ClockSetTimeFunc Search() Local $SearchPath = FileRead(@ScriptDir & "\test_res\PSS_T500_FilePath_Holder.txt") Local $InputData = GUICtrlRead($Input1) Local $SearchResults = _RecFileListToArray($SearchPath, $InputData & "*.lst*", 1, 1, 0, 2)  If @error Then      Local $eNote = _Toast_Show(0, "Error Code = " & @error, "Unable to locate file", 5)     _Toast_Hide()   Else        Local $tResults = _ArrayToString($SearchResults)        $sLabel = GUICtrlCreateLabel("Choose a program to begin: ", 275, 175, 200, 20)      $SelectProgramList = GUICtrlCreateList("", 275, 200, 400, 100)      GUICtrlSetData(-1, $tResults)   EndIfEndFunc   ;==>SearchFunc Input1ENTER() GUICtrlDelete($sLabel)  GUICtrlDelete($SelectProgramList)   Search()    GUICtrlSetData($Input1, "")EndFunc   ;==>Input1ENTERFunc Display_Results()  $SendValue = True   $TBValue = True $LoginValue = TrueEndFunc   ;==>Display_ResultsFunc _Send_Program() If $SendValue = False Then      MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX  Else        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX  EndIfEndFunc   ;==>_Send_ProgramFunc _Tool_Box()    If $TBValue = False Then        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX  Else        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX  EndIfEndFunc   ;==>_Tool_BoxFunc _Login()   If $LoginValue = False Then     $LoginValue = InputBox("Log In", "Enter Your Employee ID" & @CRLF, "", "*") Else        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$LoginValue' & @LF & @LF & 'Return:' & @LF & $LoginValue) ;### Debug MSGBOX    EndIfEndFunc   ;==>_Login#endregion ; GUICtrl Functions:#region ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);Dbl-clk processing #forceref $hWnd, $iMsg, $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word   $iCode = BitShift($wParam, 16) ; Hi Word    Switch $iCode       Case $LBN_DBLCLK            Switch $iIDFrom             Case $SelectProgramList                 $CurrentProgram = GUICtrlRead($SelectProgramList) ; Use the native function                 GUICtrlDelete($SelectProgramList)                   GUICtrlDelete($sLabel)                  Display_Results()           EndSwitch   EndSwitchEndFunc   ;==>_WM_COMMANDFunc WM_PAINT($MainGUI, $iMsg, $wParam, $lParam);PNG drawing  _GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435) Return 'GUI_RUNDEFMSG'EndFunc   ;==>WM_PAINTFunc WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam);Window Dragging   #forceref $hWnd, $iMsg, $wParam, $lParam    Return $HTCAPTIONEndFunc   ;==>WM_NCHITTEST#endregion ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:#region ; Window-Control Functions:Func MainGUIClose();Shuts down and disposes of GDI elements, Deletes GUI and exits script  _GDIPlus_GraphicsDispose($gdi_Logo) _GDIPlus_ImageDispose($LOGO)    _GDIPlus_Shutdown() GUIDelete("MainGUI")    ExitEndFunc   ;==>MainGUICloseFunc Reset();Exits, then runs the script again, thus resetting it If @Compiled Then       Run(FileGetShortName(@ScriptFullPath))  Else        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf   ExitEndFunc   ;==>ResetFunc MainGUIMaximize()EndFunc   ;==>MainGUIMaximizeFunc MainGUIMinimize()EndFunc   ;==>MainGUIMinimizeFunc MainGUIRestore()EndFunc   ;==>MainGUIRestore#endregion ; Window-Control Functions:#region ; Hover Functions:Func Button1_Hover()    GUICtrlSetPos($Pointer, 140, 220, 26, 25)    GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button1_HoverFunc Button2_Hover()    GUICtrlSetPos($Pointer, 140, 274, 26, 25)    GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button2_HoverFunc Button3_Hover()    GUICtrlSetPos($Pointer, 140, 328, 26, 25)    GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button3_HoverFunc Button4_Hover()    GUICtrlSetPos($Pointer, 140, 382, 26, 25)    GUICtrlSetState($Pointer, $GUI_SHOW)EndFunc   ;==>Button4_HoverFunc Button_LeaveHover()    GUICtrlSetState($Pointer, $GUI_HIDE)EndFunc   ;==>Button_LeaveHover#endregion ; H
over Functions:

Actually what I need to have is the "pointer" jpg drawn upon hover over a certain area (the buttons on the left) and, once drawn, it will move on its Y axis (up/down) according to the Y corrdinate value of the mouse until the mouse leaves the designated area which upon doing so would either delete or hide the "pointer" jpg.

so basically you hover over the area where the buttons are and the mouse is hidden, the pointer.jpg is drawn at a set X coordinate and the mouses Y coordinate, at which point it moves(follows) the mouses Y coordinate until the mouse leaves hover over the specified area.

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

  • Solution
Posted

OK, Now I get it

The following should help

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Storm Production Software Suite - Trumpf500;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Author: JohnPaul Niswonger                                                                            ;;
;; Script name: SPSS_T500.au3                                                                            ;;
;; Date Started: Aug/7/2013                                                                              ;;
;; Date Published: -/-/-                                                                                 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#region ; Pre-GUI

#region ; Includes begin here:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <_RecFileListToArray.au3>
#include <String.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <Toast.au3>
#NoTrayIcon
#endregion ; Includes begin here:

#region ; Options are set here:
Opt("GUIOnEventMode", 1)
Opt("GUICloseOnEsc", 1)
Opt("MouseCoordMode", 2)
#endregion ; Options are set here:

#region ; Special Chr and coding begins here:
Global $Qmark = Chr(34)
Global $Comma = Chr(44)
Global $InputDef = "Program Currently Loaded: "
Global $cHour = @HOUR
Global $cMin = @MIN
Global $cDay = @MDAY
Global $cMonth = @MON
Global $cYear = @YEAR
Global $Pointer
Global $StopLoop = False
Global $InputData
Global $SelectProgramList
Global $SearchResults
Global $sPath
Global $sLabel
Global $CurrentProgram
Global $SendValue = False
Global $TBValue = False
Global $LoginValue = False
$gdi_Logo = 0
$LOGO = 0
#endregion ; Special Chr and coding begins here:

#region ; Main GUI begins here:

#region ; $MainGUI
$MainGUI = GUICreate("MainGUI", 774, 580, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP))
GUISetBkColor(0xFFFFFF)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainGUIMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MainGUIMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "MainGUIRestore")
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
#endregion ; $MainGUI

#region ; Invisible Blocks behind buttons:
#region ; $Block1
$Block1 = GUICtrlCreateGraphic(10, 252, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block1

#region ; $Block2
$Block2 = GUICtrlCreateGraphic(10, 306, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block2

#region ; $Block3
$Block3 = GUICtrlCreateGraphic(10, 360, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block3

#region ; $Block4
$Block4 = GUICtrlCreateGraphic(10, 414, 125, 15)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block4

#region ; $Block5
$Block5 = GUICtrlCreateGraphic(0, 212, 10, 400)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ; $Block5

#endregion ; Invisible Blocks behind buttons:

#region ; $Slogan
$Slogan = GUICtrlCreateLabel($Qmark & "Every Order" & $Comma & " Every Time" & $Qmark, 525, 40, 200, 20)
GUICtrlSetFont(-1, 12, 800, 0, "Arimo")
#endregion ; $Slogan

#region ; Black frame around data:
#region ; $gHorBar1
$gHorBar1 = GUICtrlCreateGraphic(175, 125, 600, 15)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar1

#region ; $gHorBar2
$gHorBar2 = GUICtrlCreateGraphic(475, 105, 400, 20)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gHorBar2

#region ; $gVertBar1
$gVertBar1 = GUICtrlCreateGraphic(175, 125, 15, 550)
GUICtrlSetBkColor(-1, 0x3B3B3B)
GUICtrlSetState(-1, $GUI_DISABLE)
#endregion ; $gVertBar1

#region ; $gVertBar2
$gVertBar2 = GUICtrlCreateGraphic(10, 428, 125, 200)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
#endregion ; $gVertBar2

#region ; $Input1
$Input1 = GUICtrlCreateInput("", 503, 112, 250, 20)
GUICtrlSetOnEvent(-1, "Input1ENTER")
#endregion ; $Input1
#endregion ; Black frame around data:

#region ; MainGUI Buttons:
#region ; $mButton1
$mButton1 = GUICtrlCreateLabel(@CR & "SEND PROGRAM", 10, 212, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Send_Program")
#endregion ; $mButton1

#region ; $mButton2
$mButton2 = GUICtrlCreateLabel(@CR & "TOOL BOX", 10, 266, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Tool_Box")
#endregion ; $mButton2

#region ; $mButton3
$mButton3 = GUICtrlCreateLabel(@CR & "LOGIN", 10, 320, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "_Login")
#endregion ; $mButton3

#region ; $mButton4
$mButton4 = GUICtrlCreateLabel(@CR & "RESET", 10, 374, 125, 40, $SS_CENTER)
GUICtrlSetCursor(-1, 16)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "Reset")
#endregion ; $mButton4

#region ; $mButton5
$mButton5 = GUICtrlCreateLabel(@CR & "X", 740, -10, 35, 30, $SS_CENTER)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "MainGUIClose")
#endregion ; $mButton5

#endregion ; MainGUI Buttons:

#region ; $Clock
$Clock = GUICtrlCreateLabel(@CR & $cDay & "/" & $cMonth & "/" & $cYear & " - " & $cHour - 12 & ":" & $cMin, 10, 428, 125, 40, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
#endregion ; $Clock

$Pointer = GUICtrlCreatePic(@ScriptDir & "\test_res\storm_newlogo_pointer.jpg", 140, 220, 26, 25)
Global $iHeight = _WinAPI_GetWindowHeight(GUICtrlGetHandle(-1))
GUICtrlSetState(-1, $GUI_HIDE)

GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT

GUISetState(@SW_SHOW, "MainGUI")
#endregion ; Main GUI begins here:
#endregion ; Pre-GUI

#region ; Post-GUI
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND");GUI watches for double click

AdlibRegister("ClockSetTime", 15000);Check and update clock every 15 seconds

_GDIPlus_Startup()
$gdi_Logo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test_res\storm_newlogo_title_sm.PNG")
$LOGO = _GDIPlus_GraphicsCreateFromHWND($MainGUI)
_GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)

Local $aInfoMouse, $f_PointerON
While 1
    Sleep(10)
    $aInfoMouse = GUIGetCursorInfo($MainGUI)
    If IsArray($aInfoMouse) = 0 Then ContinueLoop

    Switch $aInfoMouse[0]
        Case 10 To 135  ;the X-Range

            Switch $aInfoMouse[1]
                Case 212 To 414 ;the Y-Range

                    GUICtrlSetPos($Pointer, 140, $aInfoMouse[1] - $iHeight / 2)
                    If $f_PointerON = False Then
                        GUICtrlSetState($Pointer, $GUI_SHOW)
                        $f_PointerON = True
                    EndIf

                    ContinueLoop

            EndSwitch

    EndSwitch

    If $f_PointerON Then
        GUICtrlSetState($Pointer, $GUI_HIDE)
        $f_PointerON = False
    EndIf

WEnd

#region ;Functions begin here:

#region ; GUICtrl Functions:

Func ClockSetTime()
    GUICtrlSetData($Clock, @CR & @MDAY & "/" & @MON & "/" & @YEAR & " - " & @HOUR - 12 & ":" & @MIN)
EndFunc   ;==>ClockSetTime

Func Search()
    Local $SearchPath = FileRead(@ScriptDir & "\test_res\PSS_T500_FilePath_Holder.txt")
    Local $InputData = GUICtrlRead($Input1)
    Local $SearchResults = _RecFileListToArray($SearchPath, $InputData & "*.lst*", 1, 1, 0, 2)
    If @error Then
        Local $eNote = _Toast_Show(0, "Error Code = " & @error, "Unable to locate file", 5)
        _Toast_Hide()
    Else
        Local $tResults = _ArrayToString($SearchResults)
        $sLabel = GUICtrlCreateLabel("Choose a program to begin: ", 275, 175, 200, 20)
        $SelectProgramList = GUICtrlCreateList("", 275, 200, 400, 100)
        GUICtrlSetData(-1, $tResults)

    EndIf
EndFunc   ;==>Search

Func Input1ENTER()
    GUICtrlDelete($sLabel)
    GUICtrlDelete($SelectProgramList)
    Search()
    GUICtrlSetData($Input1, "")
EndFunc   ;==>Input1ENTER

Func Display_Results()
    $SendValue = True
    $TBValue = True
    $LoginValue = True

EndFunc   ;==>Display_Results

Func _Send_Program()
    If $SendValue = False Then
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$SendValue' & @LF & @LF & 'Return:' & @LF & $SendValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Send_Program

Func _Tool_Box()
    If $TBValue = False Then
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$TBValue' & @LF & @LF & 'Return:' & @LF & $TBValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Tool_Box

Func _Login()
    If $LoginValue = False Then
        $LoginValue = InputBox("Log In", "Enter Your Employee ID" & @CRLF, "", "*")
    Else
        MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @LF & '$LoginValue' & @LF & @LF & 'Return:' & @LF & $LoginValue) ;### Debug MSGBOX
    EndIf
EndFunc   ;==>_Login

#endregion ; GUICtrl Functions:

#region ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);Dbl-clk processing

    #forceref $hWnd, $iMsg, $lParam

    $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
    $iCode = BitShift($wParam, 16) ; Hi Word

    Switch $iCode
        Case $LBN_DBLCLK
            Switch $iIDFrom
                Case $SelectProgramList
                    $CurrentProgram = GUICtrlRead($SelectProgramList) ; Use the native function
                    GUICtrlDelete($SelectProgramList)
                    GUICtrlDelete($sLabel)
                    Display_Results()
            EndSwitch
    EndSwitch

EndFunc   ;==>_WM_COMMAND

Func WM_PAINT($MainGUI, $iMsg, $wParam, $lParam);PNG drawing
    _GDIPlus_GraphicsDrawImage($LOGO, $gdi_Logo, -25, -435)
    Return 'GUI_RUNDEFMSG'
EndFunc   ;==>WM_PAINT

Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam);Window Dragging
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST
#endregion ; Drag&Drop, GDI-PNG-Drawing, and Window Dragging Functions:

#region ; Window-Control Functions:

Func MainGUIClose();Shuts down and disposes of GDI elements, Deletes GUI and exits script
    _GDIPlus_GraphicsDispose($gdi_Logo)
    _GDIPlus_ImageDispose($LOGO)
    _GDIPlus_Shutdown()
    GUIDelete("MainGUI")
    Exit
EndFunc   ;==>MainGUIClose

Func Reset();Exits, then runs the script again, thus resetting it
    If @Compiled Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>Reset

Func MainGUIMaximize()

EndFunc   ;==>MainGUIMaximize

Func MainGUIMinimize()

EndFunc   ;==>MainGUIMinimize

Func MainGUIRestore()

EndFunc   ;==>MainGUIRestore
#endregion ; Window-Control Functions:


#endregion ;Functions begin here:

PS: I you want to get help for a specific problem you should create a small reproducer rather than supplying the whole script. Its easier to modify the script that is made just for the correction.

Regards :)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

OK, Now I get itThe following should help

PS: I you want to get help for a specific problem you should create a small reproducer rather than supplying the whole script. Its easier to modify the script that is made just for the correction.

 

Regards :)

did you mean "If you want*" instead of "I you want to get"??

lol because those change the statement tremendously

and yes from now on i will write a small example instead of the entire script, though i'm cautious of this due to the fact that the script may contain components that cause the solution written for the example piece to not work... though that depends on the quality of the example i write huh :D

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

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