Windows transitions
Posted: Tue Nov 02, 2004 5:49 pm
Any one know how to use or code windows transitions for like a slide show.
Thanks
Thanks
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
If OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE)
AnimateWindow_(WindowID(0), 1000, #AW_BLEND)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
AnimateWindow_(WindowID(0), 1000, #AW_CENTER)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE)
quit = 1
Repeat
event = WaitWindowEvent()
If event = #PB_Event_CloseWindow
quit = 1
EndIf
Until quit
EndIf
Code: Select all
OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Code: Select all
#AW_ACTIVATE = $20000
#AW_BLEND = $80000
#AW_CENTER = $10
#AW_HIDE = $10000
#AW_HOR_NEGATIVE = 2
#AW_HOR_POSITIVE = 1
#AW_SLIDE = $40000
#AW_VER_NEGATIVE = 8
#AW_VER_POSITIVE = 4
OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Repeat
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE)
SendMessage_(WindowID(0), #WM_PAINT, 0, 0)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_BLEND)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_CENTER)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE)
Delay(1000)
Until Event = #PB_Event_CloseWindow
End
Tried that, and still nothing. All I get is a button in the Taskbar. I'm using v4.20 Beta 4 too. I'm not stupid.ts-soft wrote:Minimize the PB-Ide after start to see the result!
Code: Select all
Procedure CreateShellObject()
Protected obj.l, hResult.l
CoInitialize_(#Null)
hResult = CoCreateInstance_(?CLSID_Shell_Application, 0, 1, ?IID_IShellDispatch, @obj)
If Not hResult
ProcedureReturn obj
Else
ProcedureReturn #False
EndIf
DataSection
CLSID_Shell_Application: ; {13709620-C279-11CE-A49E-444553540000}
Data.l $13709620
Data.w $C279,$11CE
Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
IID_IShellDispatch: ; {D8F015C0-C278-11CE-A49E-444553540000}
Data.l $D8F015C0
Data.w $C278,$11CE
Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
EndDataSection
EndProcedure
Procedure ReleaseShellObject(obj.l)
Protected object.IUnknown = obj
object\Release()
EndProcedure
Define.IShellDispatch shell
shell = CreateShellObject()
If shell
shell\MinimizeAll() ; alle Fenster minimieren
#AW_ACTIVATE = $20000
#AW_BLEND = $80000
#AW_CENTER = $10
#AW_HIDE = $10000
#AW_HOR_NEGATIVE = 2
#AW_HOR_POSITIVE = 1
#AW_SLIDE = $40000
#AW_VER_NEGATIVE = 8
#AW_VER_POSITIVE = 4
OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE)
SendMessage_(WindowID(0), #WM_PAINT, 0, 0)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_BLEND)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_CENTER)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER)
Delay(1000)
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE)
Delay(1000)
shell\UndoMinimizeALL() ; minimieren rückgängig machen
ReleaseShellObject(shell)
EndIf
What would the bug be? All the code posted use mainly API functions.UserOfPure wrote:Yes, that works perfectly now (except for the #AW_BLEND animation, which still fails). I get a window in the center of the screen doing all the animations. But it's still a bug if v3.94 did it but v4.20 doesn't (on all PCs, that is). And who wants to minimize all windows to do it, when v3.94 didn't have to?