Easy and nice !
an exemple to exit your script
#1
Posted 18 August 2007 - 11:36 PM
Easy and nice !
My Autoit programs: MAC Address - - Delete Temp Files Ping Test - - Play Video with VLC full screen dual monitors Set IP - - Pics Converter AutoUpdater - - CPU Usage Ending Script Nicely - - GDI+ GUI crossfades (slide transitions)Beamer Others:Export Icons into DllMy website
#2
Posted 19 August 2007 - 12:20 AM
That's good.I am sure, I am not the first one who thought about it, but it is nice. I like it very much !
Easy and nice !
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
#3
Posted 19 August 2007 - 12:52 AM
#4
Posted 19 August 2007 - 01:17 AM
Edited by Mast3rpyr0, 19 August 2007 - 01:18 AM.
#5
Posted 19 August 2007 - 04:00 AM
#6
Posted 19 August 2007 - 10:26 AM
Thats because a window transparency is solid at 250.Thats cool. If you put a number like 50000 in the For loop then it keeps flashing.
#7
Posted 19 August 2007 - 11:59 AM
Cool as well !!!That's good.
If you use that with a modification of ResNullius' script for closing a window you get this...
My Autoit programs: MAC Address - - Delete Temp Files Ping Test - - Play Video with VLC full screen dual monitors Set IP - - Pics Converter AutoUpdater - - CPU Usage Ending Script Nicely - - GDI+ GUI crossfades (slide transitions)Beamer Others:Export Icons into DllMy website
#8
Posted 19 August 2007 - 05:47 PM
@martin, you're really going to force me into making some sort of proper UDF out of this, aren't youThat's good.
If you use that with a modification of ResNullius' script ...
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.
#9
Posted 19 August 2007 - 06:24 PM
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.@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:AutoIt#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.
#10
Posted 19 August 2007 - 06:56 PM
Even with the transparency alone I have some flickering as well !!!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.
It is quite impressive what ideas of people can do when put toghether...
My Autoit programs: MAC Address - - Delete Temp Files Ping Test - - Play Video with VLC full screen dual monitors Set IP - - Pics Converter AutoUpdater - - CPU Usage Ending Script Nicely - - GDI+ GUI crossfades (slide transitions)Beamer Others:Export Icons into DllMy website
#11
Posted 19 August 2007 - 07:18 PM
Well, that sounds like a bit of a challengeDoesn'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.
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.
#12
Posted 20 August 2007 - 06:12 AM
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.
#13
Posted 20 August 2007 - 06:16 AM
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?
#14
Posted 20 August 2007 - 08:06 AM
Thats cool... It didn't flicker on my pc. Thats just cause nothing else was running yet. I guess...@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:AutoIt#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.
#15
Posted 20 August 2007 - 08:51 AM
I don't follow. How would one do that, except for not having a transparency effect whilst resizing?
Precisely, see post #2.
#16
Posted 20 August 2007 - 01:02 PM
#17
Posted 20 August 2007 - 06:00 PM
#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, 20 August 2007 - 06:01 PM.
#18
Posted 24 August 2007 - 11:54 PM
OK, I'm back from my little trip and have been tinkering with this a bit.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.
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½Ì
#19
Posted 25 August 2007 - 12:51 AM
#20
Posted 25 August 2007 - 03:28 AM
If you're talking about the demo it iterates through three instances as indicated by the Gui title(s):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?
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





