Sign in to follow this  
Followers 0
Guest Rush

A tiny 12 button GUI menu without V3 GUI

5 posts in this topic

#1 ·  Posted (edited)

You don't click the buttons in the following GUI menu. Selections are simply made by placing the mouse pointer. So, presently active window or app stays active. Works without V3 GUI installed!

This may be a useful menu for several small scripts you use while within an app.

$mtlx = 200                            ;top left x position for menu bar
$mtly = 0                              ;top left y position for menu bar

;load and display menu buttons image
SplashImageOn("", ".\hrzstrpmnu.gif", 278, 15, $mtlx, $mtly, 1)

;pre menu loop initialization
Global $pick=0
Global $StartDwn = 3                   ;# of progress bar segments before pick executes
Global $CountDwn = 0
Global $PrgrsSeg = 100 / $StartDwn     ;calc segment size
Global $PrgrsSel = ""                  ;shows on progress bar what pick will execute
Global $LastSec = @SEC                 ;toggle to update progress bar

While $pick <> 12
  $Mpos = MouseGetPos()
  $Mx = $Mpos[0]
  $My = $Mpos[1]
  $PrgrsShown = 0

  If $My > $mtly + 1 AND $My < $mtly + 15 Then

    If $Mx > $mtlx + 2 AND $Mx < $mtlx + 25 Then         ;pointer over first button?
      If NOT $CountDwn Then
        $CountDwn = $StartDwn
        $PrgrsSel = "Copy Item to Excel"
        ProgressOn("Selection", $PrgrsSel)
        ProgressSet($CountDwn * $PrgrsSeg, "", $PrgrsSel)
        $LastSec = @SEC
      EndIf
      $pick = 1
      $PrgrsShown = 1
    EndIf

    If $Mx > $mtlx + 25 AND $Mx < $mtlx + 48 Then        ;pointer over second button?
      If NOT $CountDwn Then
        $CountDwn = $StartDwn
        $PrgrsSel = "Blank"
        ProgressOn("Selection", $PrgrsSel)
        ProgressSet($CountDwn * $PrgrsSeg, "", $PrgrsSel)
        $LastSec = @SEC
      EndIf
      $pick = 2
      $PrgrsShown = 1
    EndIf

    If $Mx > $mtlx + 255 AND $Mx < $mtlx + 278 Then      ;pointer over close button?
      If NOT $CountDwn Then
        $CountDwn = $StartDwn
        $PrgrsSel = "Close Menu Bar"
        ProgressOn("Selection", $PrgrsSel)
        ProgressSet($CountDwn * $PrgrsSeg, "", $PrgrsSel)
        $LastSec = @SEC
      EndIf
      $pick = 12
      $PrgrsShown = 1
    EndIf

  EndIf

  $ThisSec = @SEC
  If $ThisSec <> $LastSec AND $PrgrsShown Then
    $CountDwn = $CountDwn - 1
    ProgressSet($CountDwn * $PrgrsSeg, "", $PrgrsSel)
    $LastSec = $ThisSec
  EndIf

  If NOT $PrgrsShown Then 
    ProgressOff()
    $CountDwn = 0
  EndIf

  If $CountDwn < 1 AND $PrgrsShown Then
    $PrgrsShown = 0
    ProgressOff()
    Sleep(1000)
  Else
    $pick = 0
  EndIf

  Sleep(5)              ;reduce loop cpu load
WEnd                    ;looping until pick = 12

SplashOff()             ;stop displaying menu, exit script
Edited by Rush

Share this post


Link to post
Share on other sites



Hi Rush,

nice job. :(

A quick one. As I don't know if Jon has to pay for the traffic on this forum (I guess yes), and *.bmp's are often a waste of time/bandwith aka money check this out:

ezimagecenter

or that

imageshack

TBH. :ph34r: Don't miss the providers image lifecycle spec ...

Share this post


Link to post
Share on other sites

I always advice .gif for windows screenshot.

Share this post


Link to post
Share on other sites

ezimagecenter: .jpg, .gif, .png, .bmp - (500 KB limit)

ImageShack: .jpg, .jpeg, .gif, .png, .swf (1024 KB limit)

-----

I've seen a posting with a subject similiar to "I'm so bored ..."

So what about to create a screenshoter with this requirements:

command line driven

values/variables are set as /<parameters> on the command line

eg.

screen = /s

active window = /a

region (x+y coord) = /r:x,y

image = /bmp /jpeg /png /gif

destination = /d:C:\<MyPath>

filenamespec = /f:<MyFileNameFormat>

Sample:

AU3Screenshot.exe /a /r:10,200 /gif /d:C:\ /f:YYYYMMDDhhmmss_

yep, it makes no sense to reinvent the wheel (as there are zillions of screen captures' available), but I haven't found any of it which is free, runs from the command line and provides the option to capture only a region of the screen. :ph34r:

-----

Rush,

if you use MSOffice check out its included Photo Editor (*.jpg), or MSPaint if your OS >= W2K/XP, as it offers to save as *.gif.

Share this post


Link to post
Share on other sites

I always advice .gif for windows screenshot.

<{POST_SNAPBACK}>

a fine suggestion. I've edited the post. (409 bytes vs. 5278)

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