Jump to content

_WinAPI_SetWindowPos background/bottom


Champak
 Share

Recommended Posts

My gui is set up for one gui to fade out and another to fade in. Since there doesn't seem to be a way to fade one gui into another...haven't really searched for that but it seems like a multithread duty...I'm having the 1st gui fade to a blank gui of the same color and then the 2nd gui fade in. Problem is I have to bring in the blank gui in the background to serve as the backdrop for the fade. I found _WinAPI_SetWindowPos in the help, but I guess I'm not using it correctly, haven't really seen anything here about it that clearly defines how I should use it. So in short, I want to bring a window up ("show"), in the background.

So:

1/ Does the _WinAPI_SetWindowPos need to be called each time, or just once?

2/ Do I have the settings correct?

3/ Is there a better/different way to do what I want?

Global $HWND_BOTTOM

Case $msg = $dddd
                _WinAPI_SetWindowPos($BlankFadeGUI, $HWND_BOTTOM, -1, -1, -1, -1, BitOR($SWP_NOMOVE,$SWP_NOSIZE))
                GUISetState(@SW_SHOW,$BlankGUI);This is not to actualy be seen at this point, it should be behind GUI1 at this point
                _WinAnimate($GUI1, $AW_FADE_OUT, 400)
                _WinAnimate($GUI2, $AW_FADE_IN, 400)
                GUISetState(@SW_HIDE,$BlankGUI)
Link to comment
Share on other sites

My gui is set up for one gui to fade out and another to fade in. Since there doesn't seem to be a way to fade one gui into another...haven't really searched for that but it seems like a multithread duty...I'm having the 1st gui fade to a blank gui of the same color and then the 2nd gui fade in. Problem is I have to bring in the blank gui in the background to serve as the backdrop for the fade. I found _WinAPI_SetWindowPos in the help, but I guess I'm not using it correctly, haven't really seen anything here about it that clearly defines how I should use it. So in short, I want to bring a window up ("show"), in the background.

So:

1/ Does the _WinAPI_SetWindowPos need to be called each time, or just once?

2/ Do I have the settings correct?

3/ Is there a better/different way to do what I want?

Global $HWND_BOTTOM

Case $msg = $dddd
                _WinAPI_SetWindowPos($BlankFadeGUI, $HWND_BOTTOM, -1, -1, -1, -1, BitOR($SWP_NOMOVE,$SWP_NOSIZE))
                GUISetState(@SW_SHOW,$BlankGUI);This is not to actualy be seen at this point, it should be behind GUI1 at this point
                _WinAnimate($GUI1, $AW_FADE_OUT, 400)
                _WinAnimate($GUI2, $AW_FADE_IN, 400)
                GUISetState(@SW_HIDE,$BlankGUI)oÝ÷ Ûú®¢×²Øb±©ò¶§X¤{*.j·­¯(§Ú¡«­¢+Ø¥¹±Õ±ÐíMÑÑ¥
½¹ÍѹÑ̹ÔÌÐì((ÀÌØí¡U%|ÄôU%
ÉÑ ÅÕ½ÐíMÉÐ5ÍÍÅÕ½Ðì°ÌÀÀ°ÄÀÀ°ÈÀÀ°ÈÀÀ¤)U%MÑ ­
½±½È ÁàÀÁÀÀ¤)U%
Ñɱ
ÉÑ1° ÅÕ½ÐíÉ¥¹¬ÅÕ½Ðì°ÈÀ°ÈÀ°ÈØÀ°ÐÀ°ÀÌØíMM}
9QH¤)U%
ÑɱMѽ¹Ð ´Ä°ÄÈ°ØÀÀ°È¤)]¥¹MÑQÉ¹Ì ÀÌØí¡U%|Ä°ÅÕ½ÐìÅÕ½Ðì°ÈÔÔ¤(ÀÌØí¡U%|ÈôU%
ÉÑ ÅÕ½ÐíMÉÐ5ÍÍÅÕ½Ðì°ÌÀÀ°ÄÀÀ°ÈÀÀ°ÈÀÀ¤)U%MÑ ­
½±½È ÁàÀÀÀÁ¤)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí5½ÉÅÕ½Ðì°ÈÀ°ÈÀ°ÈØÀ°ÐÀ°ÀÌØíMM}
9QH¤)U%
ÑɱMѽ¹Ð ´Ä°ÄÈ°ØÀÀ°È¤)]¥¹MÑQÉ¹Ì ÀÌØí¡U%|È°ÅÕ½ÐìÅÕ½Ðì°À¤(ÀÌØí¡U%|ÌôU%
ÉÑ ÅÕ½ÐíMÉÐ5ÍÍÅÕ½Ðì°ÌÀÀ°ÄÀÀ°ÈÀÀ°ÈÀÀ¤)U%MÑ ­
½±½È ÁàÀÁÀÀ¤)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí=ٱѥ¹ÌÌìÅÕ½Ðì°ÈÀ°ÈÀ°ÈØÀ°ÐÀ°ÀÌØíMM}
9QH¤)U%
ÑɱMѽ¹Ð ´Ä°ÄÈ°ØÀÀ°È¤)]¥¹MÑQÉ¹Ì ÀÌØí¡U%|Ì°ÅÕ½ÐìÅÕ½Ðì°À¤)U%MÑMÑÑ¡M]}M!=°ÀÌØí¡U%|̤)U%MÑMÑÑ¡M]}M!=°ÀÌØí¡U%|Ȥ)U%MÑMÑÑ¡M]}M!=°ÀÌØí¡U%|Ĥ((ÀÌØí¡=ÕÐôÀÌØí¡U%|Ä(ÀÌØí¡%¸ôÀÌØí¡U%|È)}=ÕÑ%¸ ÀÌØí¡=ÕаÀÌØí¡%¸¤((ÀÌØí¡=ÕÐôÀÌØí¡U%|È(ÀÌØí¡%¸ôÀÌØí¡U%|Ì)}=ÕÑ%¸ ÀÌØí¡=ÕаÀÌØí¡%¸¤()Õ¹}=ÕÑ%¸ ÀÌØí¡]¥¹=ÕаÀÌØí¡]¥¹%¸¤(%½ÈÀÌØí¸ôÀQ¼ÈÔÔ($%]¥¹MÑQÉ¹Ì ÀÌØí¡]¥¹=ÕаÅÕ½ÐìÅÕ½Ðì°ÈÔÔ´ÀÌØí¸¤($%]¥¹MÑQÉ¹Ì ÀÌØí¡]¥¹%¸°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¸¤($%M±À ÈÀ¤(%9áÐ)¹Õ¹ìôôÐí}=ÕÑ%¸

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi, thanks, that's great. I improved it slightly to combine everything:

_FadeOutIn($hGUI_1, $hGUI_2, $hGUI_3)

Func _FadeOutIn($hWinOut, $hWinIn, $hWinTrans)

    WinSetTrans($hWinIn, "", 255)
    For $n = 0 To 255
        WinSetTrans($hWinOut, "", 255 - $n)
        WinSetTrans($hWinTrans, "", $n)
        ;Sleep(5)
    Next
    GUISetState(@SW_HIDE, $hWinTrans)
    
EndFunc   ;==>_FadeOutIn

Your version was also giving a flicker sometimes in the transition which was irritating the hell out of me. My version still gives a flicker, but just SLIGHTLY less.

Now here is the problem, within my app which has now reached 5200 lines, there is a flicker EVERY TIME (with both versions). And also the transition is taking between 3.2 and 7.5 seconds. The 7.5 seconds is only during the very first fade transition, the second one is around 5 seconds, then all others average between 3.2 and 5 seconds. Obviously this is unacceptable. Now I don't really think this has to do with the size of the app, but more to the weight of the GUIS...which are relatively large. So any other ideas of how to accomplish this.

Link to comment
Share on other sites

Now here is the problem, within my app which has now reached 5200 lines, there is a flicker EVERY TIME (with both versions). And also the transition is taking between 3.2 and 7.5 seconds. The 7.5 seconds is only during the very first fade transition, the second one is around 5 seconds, then all others average between 3.2 and 5 seconds. Obviously this is unacceptable. Now I don't really think this has to do with the size of the app, but more to the weight of the GUIS...which are relatively large. So any other ideas of how to accomplish this.

Sleep() was introduced to slow the loop down intentionally. If no Sleep() is not fast enough for you, then Step the For/Next loop to make the transition faster:

For $n = 0 To 255 Step 5
        WinSetTrans($hWinOut, "", 255 - $n)
        WinSetTrans($hWinTrans, "", $n)
    Next

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...