Sign in to follow this  
Followers 0

an exemple to exit your script

24 posts in this topic

Posted

I am sure, I am not the first one who thought about it, but it is nice. I like it very much !

#include <GUIConstants.au3>

GUICreate("mygui",300,200,-1,-1)
GUISetState ()
GUICtrlCreateButton ("OK", 50,50,40,25)
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

For $i = 250 To 0 Step -10
    WinSetTrans ( "mygui", "", $i )
    Sleep(50)
Next

Easy and nice !

Share this post


Link to post
Share on other sites



Posted

I am sure, I am not the first one who thought about it, but it is nice. I like it very much !

#include <GUIConstants.au3>

GUICreate("mygui",300,200,-1,-1)
GUISetState ()
GUICtrlCreateButton ("OK", 50,50,40,25)
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

For $i = 250 To 0 Step -10
    WinSetTrans ( "mygui", "", $i )
    Sleep(50)
Next

Easy and nice !

That's good.

If you use that with a modification of ResNullius' script for closing a window you get this

#include <GUIConstants.au3>
#include <GuiConstants.au3>
Global $GuiX, $GuiY, $GuiW, $GuiH
$gui = GUICreate("My Gui")
$rollup = GUICtrlCreateButton("RollItUp", 50, 200, 100, 20);
GUISetState()

While 1
  $Msg = GUIGetMsg()
  Switch $Msg
	Case $GUI_EVENT_CLOSE
	  Exit
	Case $rollup
	  _RollUpGui($gui, 10)
	  ExitLoop
  EndSwitch
WEnd
Func _RollUpGui($hWnd, $step, $delay = "default")
  Local $GuiClientH, $MinH
  $GuiClientSize = WinGetClientSize($hWnd)
  $GuiClientH = $GuiClientSize[1]
  _GuiGetPos($hWnd)
  $MinH = $GuiH - $GuiClientH
  While $GuiW > 200;$GuiPos[3]
	_GuiGetPos($hWnd)
	If $GuiH > ($MinH) Then
	  $GuiH -= $step
	  $GuiY += $step / 2
	Else
	  $GuiH = $GuiH
	  $GuiY = $GuiY
	  $GuiW -= $step
	  $GuiX += $step / 2
	EndIf
	WinMove($gui, "", $GuiX, $GuiY, $GuiW, $GuiH)
	If $delay = "default" Then $delay = ($step * 2) + ($step / 2)
	Sleep($delay)
  WEnd
 ;GUIDelete($gui)
 ;Exit
EndFunc  ;==>_RollUpGui
Func _GuiGetPos($hWnd)
  $GuiPos = WinGetPos($hWnd)
  $GuiX = $GuiPos[0]
  $GuiY = $GuiPos[1]
  $GuiW = $GuiPos[2]
  $GuiH = $GuiPos[3]
EndFunc  ;==>_GuiGetPos


For $i = 250 To 0 Step -10
	WinSetTrans ( $gui, "", $i )
	Sleep(50)
Next

Share this post


Link to post
Share on other sites

Posted

I love the effect of the RollUp, looks great.

Share this post


Link to post
Share on other sites

Posted (edited)

Thats cool. If you put a number like 50000 in the For loop then it keeps flashing.

Edited by Mast3rpyr0

Share this post


Link to post
Share on other sites

Posted

Both are very nice!!

Share this post


Link to post
Share on other sites

Posted

Thats cool. If you put a number like 50000 in the For loop then it keeps flashing.

Thats because a window transparency is solid at 250.

Share this post


Link to post
Share on other sites

Posted

That's good.

If you use that with a modification of ResNullius' script for closing a window you get this...

Cool as well !!! :)

Share this post


Link to post
Share on other sites

Posted

That's good.

If you use that with a modification of ResNullius' script ...

@martin, you're really going to force me into making some sort of proper UDF out of this, aren't you :)

In the meantime, here's a modification that incorporates stepping transparency throughout the entire rollup:

#include <GuiConstants.au3>
Global $GuiX, $GuiY, $GuiW, $GuiH
$gui = GUICreate("My Gui")
$rollup = GUICtrlCreateButton("RollItUp", 50, 200, 100, 20);
GUISetState()

While 1
	$Msg = GUIGetMsg()
	Switch $Msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $rollup
			_RollUpGui($gui, 10)
	EndSwitch
WEnd


Func _RollUpGui($hWnd, $step, $delay = "default")
	Local $GuiClientH, $MinH, $TransStep, $TransCount = 0, $GuiTrans = 255
	$GuiClientSize = WinGetClientSize($hWnd)
	$GuiClientH = $GuiClientSize[1]
	_GuiGetPos($hWnd)
	$TransStep = (125 / $step) / 3
	$MinH = $GuiH - $GuiClientH
	While $GuiW > 0;$GuiPos[3]
		_GuiGetPos($hWnd)
		$TransCount += 1
		If $GuiH > ($MinH) Then
			$GuiH -= $step
			$GuiY += $step / 2
		Else
			$GuiH = $GuiH
			$GuiY = $GuiY
			$GuiW -= $step
			$GuiX += $step / 2
			
		EndIf
		If $TransCount >= $TransStep Then
			$GuiTrans -= 10
			$TransCount = 0
		EndIf
		WinSetTrans($hWnd, "", $GuiTrans)
		WinMove($hWnd, "", $GuiX, $GuiY, $GuiW, $GuiH)
		If $delay = "default" Then $delay = ($step * 2) + ($step / 2)
		Sleep($delay)
	WEnd
	GUIDelete($hWnd)
	Exit
EndFunc   ;==>_RollUpGui


Func _GuiGetPos($hWnd)
	$GuiPos = WinGetPos($hWnd)
	$GuiX = $GuiPos[0]
	$GuiY = $GuiPos[1]
	$GuiW = $GuiPos[2]
	$GuiH = $GuiPos[3]
EndFunc   ;==>_GuiGetPos

Note: I changed some "$gui" references in the function to "$hWnd" since thats the way the function is called; problem was also in my original source.

Share this post


Link to post
Share on other sites

Posted

@martin, you're really going to force me into making some sort of proper UDF out of this, aren't you :)

In the meantime, here's a modification that incorporates stepping transparency throughout the entire rollup:

#include <GuiConstants.au3>
Global $GuiX, $GuiY, $GuiW, $GuiH
$gui = GUICreate("My Gui")
$rollup = GUICtrlCreateButton("RollItUp", 50, 200, 100, 20);
GUISetState()

While 1
	$Msg = GUIGetMsg()
	Switch $Msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $rollup
			_RollUpGui($gui, 10)
	EndSwitch
WEnd
Func _RollUpGui($hWnd, $step, $delay = "default")
	Local $GuiClientH, $MinH, $TransStep, $TransCount = 0, $GuiTrans = 255
	$GuiClientSize = WinGetClientSize($hWnd)
	$GuiClientH = $GuiClientSize[1]
	_GuiGetPos($hWnd)
	$TransStep = (125 / $step) / 3
	$MinH = $GuiH - $GuiClientH
	While $GuiW > 0;$GuiPos[3]
		_GuiGetPos($hWnd)
		$TransCount += 1
		If $GuiH > ($MinH) Then
			$GuiH -= $step
			$GuiY += $step / 2
		Else
			$GuiH = $GuiH
			$GuiY = $GuiY
			$GuiW -= $step
			$GuiX += $step / 2
			
		EndIf
		If $TransCount >= $TransStep Then
			$GuiTrans -= 10
			$TransCount = 0
		EndIf
		WinSetTrans($hWnd, "", $GuiTrans)
		WinMove($hWnd, "", $GuiX, $GuiY, $GuiW, $GuiH)
		If $delay = "default" Then $delay = ($step * 2) + ($step / 2)
		Sleep($delay)
	WEnd
	GUIDelete($hWnd)
	Exit
EndFunc   ;==>_RollUpGui
Func _GuiGetPos($hWnd)
	$GuiPos = WinGetPos($hWnd)
	$GuiX = $GuiPos[0]
	$GuiY = $GuiPos[1]
	$GuiW = $GuiPos[2]
	$GuiH = $GuiPos[3]
EndFunc   ;==>_GuiGetPos

Note: I changed some "$gui" references in the function to "$hWnd" since thats the way the function is called; problem was also in my original source.

Doesn't work very well on my old laptop PC- lots of flickering and the size change is not at all smooth. On my newer but not fast desktop PC it's even worse. For me it's best to keep the resizing and transparency separate.

Share this post


Link to post
Share on other sites

Posted

Doesn't work very well on my old laptop PC- lots of flickering and the size change is not at all smooth. On my newer but not fast desktop PC it's even worse. For me it's best to keep the resizing and transparency separate.

Even with the transparency alone I have some flickering as well !!!

It is quite impressive what ideas of people can do when put toghether...

Share this post


Link to post
Share on other sites

Posted

Doesn't work very well on my old laptop PC- lots of flickering and the size change is not at all smooth. On my newer but not fast desktop PC it's even worse. For me it's best to keep the resizing and transparency separate.

Well, that sounds like a bit of a challenge :)

I'm sure it can be done smoothly, just have to figure it out.

However, I am leaving for a 3 or 4 day trip, sans computer or web access, so I'll have to have a go at it when I get back.

Share this post


Link to post
Share on other sites

Posted

Same here (regarding flickering and such). It looks choppy (assuming I'm using choppy correctly) and the fading doesn't even occur until its almost gone.

I, admiring after ResNullius' code again, wrote an example of it with fade out. It's not pretty, and I do get *one* initial flicker, which I don't even undersand...

...but if anyone would like to see it, let me know. It's hard coded (I know, horrible), and probably sloppy to boot.

Share this post


Link to post
Share on other sites

Posted

For me it's best to keep the resizing and transparency separate.

I don't follow. How would one do that, except for not having a transparency effect whilst resizing?

Share this post


Link to post
Share on other sites

Posted

@martin, you're really going to force me into making some sort of proper UDF out of this, aren't you :)

In the meantime, here's a modification that incorporates stepping transparency throughout the entire rollup:

#include <GuiConstants.au3>
Global $GuiX, $GuiY, $GuiW, $GuiH
$gui = GUICreate("My Gui")
$rollup = GUICtrlCreateButton("RollItUp", 50, 200, 100, 20);
GUISetState()

While 1
	$Msg = GUIGetMsg()
	Switch $Msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $rollup
			_RollUpGui($gui, 10)
	EndSwitch
WEnd
Func _RollUpGui($hWnd, $step, $delay = "default")
	Local $GuiClientH, $MinH, $TransStep, $TransCount = 0, $GuiTrans = 255
	$GuiClientSize = WinGetClientSize($hWnd)
	$GuiClientH = $GuiClientSize[1]
	_GuiGetPos($hWnd)
	$TransStep = (125 / $step) / 3
	$MinH = $GuiH - $GuiClientH
	While $GuiW > 0;$GuiPos[3]
		_GuiGetPos($hWnd)
		$TransCount += 1
		If $GuiH > ($MinH) Then
			$GuiH -= $step
			$GuiY += $step / 2
		Else
			$GuiH = $GuiH
			$GuiY = $GuiY
			$GuiW -= $step
			$GuiX += $step / 2
			
		EndIf
		If $TransCount >= $TransStep Then
			$GuiTrans -= 10
			$TransCount = 0
		EndIf
		WinSetTrans($hWnd, "", $GuiTrans)
		WinMove($hWnd, "", $GuiX, $GuiY, $GuiW, $GuiH)
		If $delay = "default" Then $delay = ($step * 2) + ($step / 2)
		Sleep($delay)
	WEnd
	GUIDelete($hWnd)
	Exit
EndFunc   ;==>_RollUpGui
Func _GuiGetPos($hWnd)
	$GuiPos = WinGetPos($hWnd)
	$GuiX = $GuiPos[0]
	$GuiY = $GuiPos[1]
	$GuiW = $GuiPos[2]
	$GuiH = $GuiPos[3]
EndFunc   ;==>_GuiGetPos

Note: I changed some "$gui" references in the function to "$hWnd" since thats the way the function is called; problem was also in my original source.

Thats cool... It didn't flicker on my pc. Thats just cause nothing else was running yet. I guess...

Share this post


Link to post
Share on other sites

Posted

I don't follow. How would one do that, except for not having a transparency effect whilst resizing?

Precisely, see post #2.

Share this post


Link to post
Share on other sites

Posted

Oooh. The fade-out "title bar" script. :) Gotcha!

Share this post


Link to post
Share on other sites

Posted (edited)

i diffrent way to do the same as ResNullius did.. i hope this isnt flickering

#include <GuiConstants.au3>
Global $GuiX, $GuiY, $GuiW, $GuiH
$gui = GUICreate("My Gui")
$rollup = GUICtrlCreateButton("RollItUp", 50, 200, 100, 20);
GUISetState()

While 1
  $Msg = GUIGetMsg()
  Switch $Msg
    Case $GUI_EVENT_CLOSE
      Exit
    Case $rollup
      _RollUpGui($gui, 10)
      ExitLoop
  EndSwitch
WEnd

Func _RollUpGui($hWnd, $step, $delay = "default")
  Local $GuiClientH, $MinH
  Local $trans = 250
  $GuiClientSize = WinGetClientSize($hWnd)
  $GuiClientH = $GuiClientSize[1]
  _GuiGetPos($hWnd)
  $MinH = $GuiH - $GuiClientH
  While $GuiW > 50;$GuiPos[3]
    _GuiGetPos($hWnd)
    If $GuiH > ($MinH) Then
      $GuiH -= $step
      $GuiY += $step / 2
    Else
      $GuiH = $GuiH
      $GuiY = $GuiY
      $GuiW -= $step
      $GuiX += $step / 2
    EndIf
    WinMove($gui, "", $GuiX, $GuiY, $GuiW, $GuiH)
    If $delay = "default" Then $delay = ($step * 2) + ($step / 2)
    Sleep($delay)
	
	;Trans section
	WinSetTrans ( $gui, "",  $trans)
	if $trans > $step then 
		$trans -= $step/2
	else
	WinSetTrans ( $gui, "",  0)
	endif
  WEnd
;GUIDelete($gui)
;Exit
EndFunc  ;==>_RollUpGui
Func _GuiGetPos($hWnd)
  $GuiPos = WinGetPos($hWnd)
  $GuiX = $GuiPos[0]
  $GuiY = $GuiPos[1]
  $GuiW = $GuiPos[2]
  $GuiH = $GuiPos[3]
EndFunc  ;==>_GuiGetPos

edit: oops posted wrong code..

Edited by Rizzet

Share this post


Link to post
Share on other sites

Posted

Doesn't work very well on my old laptop PC- lots of flickering and the size change is not at all smooth. On my newer but not fast desktop PC it's even worse. For me it's best to keep the resizing and transparency separate.

OK, I'm back from my little trip and have been tinkering with this a bit.

I've cleaned up the code, changed some of the logic, and made the roll-up callable with or without 2 different transparency effects.

Run the demo to see.

I know there is probably a much simpler way of dealing with the whole logic of interspersing the transparency with the rollup, but I'm so far down this road that I can't see anything else right now.

I've tested with different GUI styles and sizes but, as always, feedback appreciated on results, flicker, etc on different systems. Thanks

@martin,

Should now work OK with $WS_SIZEBOX and other styles

@cramaboule,

Sorry for hijacking your thread, but it's really martin's fault for combining the two ideas in the first place :)

DEMO:

#include <GuiConstants.au3>
#include "_RollUpGui.au3"

For $i = 0 To 2
	Switch $i
		Case 0
			$GuiTitle = "No Transparency"
		Case 1
			$GuiTitle = "Transparency on Width Only"
		Case 2
			$GuiTitle = "Transparency on Height & Width Both"
	EndSwitch
	$gui = GUICreate($GuiTitle, 400, 450, -1, -1);,$WS_Sizebox)
	$rollup = GUICtrlCreateButton("Roll It Up", 50, 200, 100, 20);
	GUISetState()

	While 1
		$Msg = GUIGetMsg()
		Switch $Msg
			Case $GUI_EVENT_CLOSE
				Exit
			Case $rollup
				_RollUpGui ($gui, 5, Default, $i) ; use a value between 4 & 9 for best result
				ExitLoop
		EndSwitch
	WEnd
	GUIDelete($gui)
	Sleep(750)
Next
MsgBox(4096, "", "Demo finished", 1)oÝ÷ Ù´hU)è¿m«­¢+Ø¥¹±Õµ½¹)±½°ÀÌØíÁÕ¥`°ÀÌØíÁÕ¥d°ÀÌØíÁÕ¥°ÀÌØíÁÕ¥ ()Õ¹}I½±±UÁÕ¤ ÀÌØí¡]¹°ÀÌØíÍÑÀôаÀÌØí±äôձаÀÌØíQɹÍ5Ñ¡½ôÀ¤ìÀô¹½¹°ÄôÑɹÌн¸]¥Ñ ½¹±ä°ÈôÑɹ̽¸]¥Ñ ¹!¥¡Ð(%1½°ÀÌØíÕ¥
±¥¹Ñ °ÀÌØí5¥¹ °ÀÌØí5¥¹°ÀÌØíÕ¥=±°ÀÌØíQɹÍMÑÁÌ°ÀÌØíQɹÍ
½Õ¹ÐôÀ°ÀÌØíQɹÍ5àôÈÔÀ°ÀÌØíQɹÍ%¹Éµ¹ÐôÄÀ°ÀÌØíÕ¥QɹÌ($ÀÌØíÕ¥QɹÌôÀÌØíQɹÍ5à($ÀÌØíÕ¥
±¥¹ÑM¥éô]¥¹Ñ
±¥¹ÑM¥é ÀÌØí¡]¹¤($ÀÌØíÕ¥
±¥¹Ñ ôÀÌØíÕ¥
±¥¹ÑM¥élÅt($ÀÌØíÕ¥
±¥¹ÑôÀÌØíÕ¥
±¥¹ÑM¥élÁt(%}Õ¥ÑA½Ì ÀÌØí¡]¹¤($ÀÌØíQɹÍMÑÁÌô ÀÌØíÕ¥
±¥¹Ñ ¼ÀÌØíÍÑÀ¤¼  ÀÌØíQɹÍ5à¼ÀÌØíQɹÍ5Ñ¡½¤¼ÀÌØíQɹÍ%¹Éµ¹Ð¤($ÀÌØí5¥¹ ôÀÌØíÁÕ¥ ´ÀÌØíÕ¥
±¥¹Ñ (%%ÀÌØí±äôÕ±ÐQ¡¸ÀÌØí±äô ÀÌØíÍÑÀ¨Ä¸Ô¤($ÀÌØíÉÍÐôÀ(%%ÀÌØí5¥¹ ±ÐìÈØQ¡¸ÀÌØí5¥¹ ôÈØ($ÀÌØíµå
½Õ¹ÐôÀÌØíQɹÍ
½Õ¹Ð(%]¡¥±ÀÌØíÁÕ¥ ÐìÀÌØí5¥¹ ì($$ÀÌØíÁÕ¥d¬ô ÀÌØíÍÑÀ¼È¤ì¼È¤($$ÀÌØíÁÕ¥ ´ôÀÌØíÍÑÀì¨È($%]¥¹5½Ù ÀÌØí¡]¹°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÁÕ¥`°ÀÌØíÁÕ¥d°ÀÌØíÁÕ¥°ÀÌØíÁÕ¥ ¤($%%ÀÌØíQɹÍ5Ñ¡½ÐìÄQ¡¸($$$ÀÌØíQɹÍ
½Õ¹Ð¬ôÄ($$%%ÀÌØíQɹÍ
½Õ¹ÐÐìôÀÌØíQɹÍMÑÁÌQ¡¸($$$$ÀÌØíÕ¥Qɹ̴ôÀÌØíQɹÍ%¹Éµ¹Ð($$$%%ÀÌØíÕ¥Qɹ̱ÐìôÀÌØíQɹÍ5à¼ÀÌØíQɹÍ5Ñ¡½Q¡¸($$$$$ÀÌØíÕ¥QɹÌôÀÌØíQɹÍ5à¼ÀÌØíQɹÍ5Ñ¡½($$$$$ÀÌØíÉÍЬôÄ($$$$%
½¹Ñ¥¹Õ1½½À($$$%¹%($$$%]¥¹MÑQÉ¹Ì ÀÌØí¡]¹°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÕ¥Qɹ̤($$$$ÀÌØíQɹÍ
½Õ¹ÐôÀ($$%¹%($$$ÀÌØíµå
½Õ¹Ð¬ôÄ($%¹%($%M±À ÀÌØí±ä¤(%]¹($($ÀÌØíQɹÍMÑÁÌô ÀÌØíÕ¥
±¥¹Ñ¼ÀÌØíÍÑÀ¤¼  ÀÌØíQɹÍ5à¼ÀÌØíQɹÍ5Ñ¡½¤¼ÀÌØíQɹÍ%¹Éµ¹Ð¤($ÀÌØí±äôÀÌØí±ä¨Ä¸Ô($ÀÌØíQɹÍ
½Õ¹ÐôÀ(%]¡¥±ÀÌØíÁÕ¥ÐìÀÌØí5¥¹ì($$ÀÌØíÁÕ¥`¬ô ÀÌØíÍÑÀ¼È¤ì¼È¤($$ÀÌØíÁÕ¥´ôÀÌØíÍÑÀì¨È($%]¥¹5½Ù ÀÌØí¡]¹°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÁÕ¥`°ÀÌØíÁÕ¥d°ÀÌØíÁÕ¥°ÀÌØíÁÕ¥ ¤($%%ÀÌØíQɹÍ5Ñ¡½ÐìôÄQ¡¸($$$ÀÌØíQɹÍ
½Õ¹Ð¬ôÄ($$%%ÀÌØíQɹÍ
½Õ¹ÐÐìôÀÌØíQɹÍMÑÁÌQ¡¸($$$$ÀÌØíÕ¥Qɹ̴ôÀÌØíQɹÍ%¹Éµ¹Ð($$$%%ÀÌØíÕ¥Qɹ̱ÐìôÀQ¡¸($$$$$ÀÌØíÕ¥QɹÌôÀ($$$$%
½¹Ñ¥¹Õ1½½À($$$%¹%($$$%]¥¹MÑQÉ¹Ì ÀÌØí¡]¹°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÕ¥Qɹ̤($$$$ÀÌØíQɹÍ
½Õ¹ÐôÀ($$%¹%($$$ÀÌØíµå
½Õ¹Ð¬ôÄ($%¹%($%}Õ¥ÑA½Ì ÀÌØí¡]¹¤($%%ÀÌØíÕ¥=±ôÀÌØíÁÕ¥Q¡¸á¥Ñ1½½À($$ÀÌØíÕ¥=±ôÀÌØíÁÕ¥($%M±À ÀÌØí±ä¤(%]¹(%IÑÕɸ)¹Õ¹ìôôÐí}I½±±UÁÕ¤(()Õ¹}Õ¥ÑA½Ì ÀÌØí¡]¹¤($ÀÌØíÁÕ¥A½Ìô]¥¹ÑA½Ì ÀÌØí¡]¹¤($ÀÌØíÁÕ¥`ôÀÌØíÁÕ¥A½ÍlÁt($ÀÌØíÁÕ¥dôÀÌØíÁÕ¥A½ÍlÅt($ÀÌØíÁÕ¥ôÀÌØíÁÕ¥A½ÍlÉt($ÀÌØíÁÕ¥ ôÀÌØíÁÕ¥A½ÍlÍt)¹Õ¹ìôôÐí}Õ¥ÑA½Ì

Share this post


Link to post
Share on other sites

Posted

Hello.. Windows XP SP2 Works Great! No flickering,,, Although when it rolls up and disapears it opens right back up till manually closed. Is this intended? :)

Share this post


Link to post
Share on other sites

Posted

Hello.. Windows XP SP2 Works Great! No flickering,,, Although when it rolls up and disapears it opens right back up till manually closed. Is this intended? :)

If you're talking about the demo it iterates through three instances as indicated by the Gui title(s):

1) "No Transparency"

2) "Transparency on Width Only"

3) "Transparency on Height & Width Both"

So just click the "Roll it up" button when the Gui reappears to see the next iteration.

If that's not what you mean, can you explain or provide an example? Thanks.

Share this post


Link to post
Share on other sites

Posted

Oh, So it does.. I was just messing with it and didn't really look at the code. Works very well and on the third instance it gets a bit jittery. The first two is pretty smooth..

Share this post


Link to post
Share on other sites

Posted (edited)

@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

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

@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 !!!

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