Jump to content

an exemple to exit your script


cramaboule
 Share

Recommended Posts

@Rizzet,

Marvelous! It actually flickered only once at that was at the beginning of the loop.

@ResNullius,

Stupendous! As stated by gesller, the first two are amazing. Smooth and *no* flickering whatsoever. Which for the record, is the *FIRST* time I have seen an AutoIt application without flicker that did a "neat little trick" like this.

The 3rd one flickered, but mostly was *jittery*. The button for example bounced up and down several pixels on each iteration.

I know how it feels to go so far down one avenue and kind of get stuck looking back up a one-way street, cussing yourself. Perhaps though the 3rd example is the jumping off point? I did not look at the code intensely, so is there something fundamentally different from the 1st and 2nd compared to the 3rd?

EDIT: Forgot to add a couple things, my bad, I am a bit inebriated.

1. The third one runs at least 2 to 3 times slower (the transition, not clock cycles).

2. Right before it's height reaches the minimum before switching to the width transition, it seems to jerk the last 10 to 15 pixels upward.

So for example at approximately (just guessing) 45 or 50 pixels high, it skips at least 10 to 15 pixels going all the way to 30 or 35 pixels high. Did that make sense?

3. The width transition also runs faster than the height transition.

I hope this helps you make this already awesome demo that much better!

Edited by fowmow
Link to comment
Share on other sites

Same for me ,the first 2 are really good now but the fade is very slow and flickers a lot.

There are some ways to animate windows using an API but in general they don't look so great.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$gui = GUICreate("Animated by API", 353, 256, 303, 219)
GUISetIcon("D:07.ico")
$ListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$Button1 = GUICtrlCreateButton(">", 156, 15, 30, 25, 0)
$Button2 = GUICtrlCreateButton(">>", 156, 48, 31, 25, 0)
$Button3 = GUICtrlCreateButton("<", 157, 81, 31, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button4 = GUICtrlCreateButton("<<", 157, 114, 32, 25, 0)
$ListBox2 = GUICtrlCreateList("", 200, 8, 137, 201)
$Button5 = GUICtrlCreateButton("&OK", 104, 225, 75, 25, 0)
$Button6 = GUICtrlCreateButton("&Cancel", 184, 225, 75, 25, 0)
$Button7 = GUICtrlCreateButton("&Help", 264, 225, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



Const $AW_SHOW = 0x00020000
 ; AW_SLIDE Uses slide animation.
 Const $AW_SLIDE = 0x00040000
 ; ROLL/SLIDE need to be used with one of the following:
Const $AW_RIGHT = 0x00000001
Const $AW_LEFT = 0x0000002
Const $AW_DOWN = 0x0000004
Const $AW_EUP = 0x0000008
 ; Add RIGHT/LEFT with UP/DOWN for diagonal effects.
  
 ; AW_BLEND Uses a fade effect.Can be used only if hwnd is a top-level window.
 ; Win 2000 or higher
Const $AW_BLEND = 0x00080000


 ; AW_CENTER Makes the window appear to collapse inward if AW_HIDE is used or expand
 ; outward if the AW_HIDE is not used.
Const $AW_CENTER = 0x00000010
Const $AW_HIDE = 0x00010000
 ;time animation takes, in milliseconds.
Const $AWTime = 500



AnimateClose($gui,$AW_LEFT,1200)
Sleep(500);
AnimateOpen($gui,$AW_CENTER,1200)
Sleep(500)
AnimateClose($gui,$AW_EUP,1200)
Sleep(500);
AnimateOpen($gui,$AW_DOWN,1200)
Sleep(500)
AnimateClose($gui,BitOR($AW_LEFT,$AW_EUP),1200)
Sleep(500);
AnimateOpen($gui,BitOR($AW_RIGHT,$AW_EUP),1200)
Sleep(500)

;faded
AnimateClose($gui,$AW_BLEND,1200)
Sleep(500);
AnimateOpen($gui,$AW_BLEND,2000)
Sleep(500)
Sleep(500)



Func AnimateOpen($hW,$AOStyle,$ttime)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hw, "int", $ttime, "long", $AOStyle)
    
EndFunc

Func AnimateClose($hW,$ACStyle,$ttime = 500);$AWTime)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hw, "int", $ttime, "long", BitOR($AW_HIDE,$ACStyle))
EndFunc
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.
Link to comment
Share on other sites

@ResNullius: No problem it is fun to see you all running after a script to close or ends nice from my little tiny idea that I posted at the beginning !!!

@all Great job !!! keep going !!!

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