RE: Re: Floating Toolbar

"Gert Scheepers" <[email protected]> Thu, 4 Oct 2007 11:03:55 +0200
Newsgroups gmane.comp.windows.autoit.user
Organization Galileo
Message-ID <[email protected]>
Hi all

 

Thanks to all those who responded, I appreciate it.

 

I have used a bit of Larry's and Petr's script and added it in to mine. I
think the results is quite satisfactory.

 

Here is the result in case anyone else want to look at it.

 

;---------------------------------------------------

 

#include <GUIConstants.au3>

 

Run(@ScriptDir & "\TurboRisk.exe")

WinWait("TurboRisk","")

$hwnd = WinGetHandle("TurboRisk")

 

$pos = WinGetPos($hwnd)

$toolbar = GUICreate("", 104, 16, $pos[0] + $pos[2] - 114, $pos[1] + 30,
$WS_POPUP,$WS_EX_WINDOWEDGE + $WS_EX_DLGMODALFRAME, $hwnd)

$ButtonDone = GUICtrlCreateButton("Done", 0, 0, 38, 15, 0)

$Button5 = GUICtrlCreateButton("5", 38, 0, 22, 15, 0)

$Button10 = GUICtrlCreateButton("10", 60, 0, 22, 15, 0)

$Button15 = GUICtrlCreateButton("15", 82, 0, 22, 15, 0)

GUISetState()

 

While WinExists($hwnd)

            $nMsg = GUIGetMsg()

            $pos = WinGetPos($hwnd)

            WinMove ( "", "Done", $pos[0] + $pos[2] - 114 , $pos[1] + 30)

            Switch $nMsg

                        Case $GUI_EVENT_CLOSE

                                    WinClose("TurboRisk","")

                                    Exit

                        Case $ButtonDone

                                    WinWait("TurboRisk","")

                                    If Not WinActive("TurboRisk","") Then
WinActivate("TurboRisk","")

                                    WinWaitActive("TurboRisk","")

                                    Send("{Space}")

                        Case $Button5

                                    WinWaitActive("TurboRisk","")

                                    $pos = MouseGetPos()

                                    MouseClick("", $pos[0], $pos[1],4)

                        Case $Button10

                                    WinWaitActive("TurboRisk","")

                                    $pos = MouseGetPos()

                                    MouseClick("", $pos[0], $pos[1],9)

                        Case $Button15

                                    WinWaitActive("TurboRisk","")

                                    $pos = MouseGetPos()

                                    MouseClick("", $pos[0], $pos[1],14)

            EndSwitch         

Wend

 

;---------------------------------------------------

 

Gert

 

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of larrydalooza
Sent: 03 October 2007 16:31 PM
To: [email protected]
Subject: [AutoIt] Re: Floating Toolbar

 

> I want the toolbar to only float above a specific application and
not float
> on top of any other apps. 
> 
> I seem to get it right but after minimizing the app and restoring
use the
> toolbar does not return with the app.

does this get you started?

#include <GUIConstants.au3>

Run("calc")
WinWait("Calculator")
$hwnd = WinGetHandle("Calculator")

$pos = WinGetPos($hwnd)

$toolbar =
GUICreate("tools",300,25,$pos+10,$pos+60,$WS_CAPTION,$WS_EX_TOOLWINDOW,$hwnd
)

GUISetState()

While WinExists($hwnd)
IF GUIGetMsg() = -3 Then Exit
WEnd

 



[Non-text portions of this message have been removed]