Verfasst: 14.05.2007 12:02
AnimateWindow_() wird auch von WinNT 4 nicht unterstützt. Wahrscheinlich sind gnozal und ich die einzigen, die noch WinNT einsetzen (und meine 2200+ Anwender) 

Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
http://msdn2.microsoft.com/en-us/library/ms632669.aspxMSDN hat geschrieben: AnimateWindow Function
:
:
Minimum operating systems Windows 98, Windows 2000
Code: Alles auswählen
Procedure SetWinTransparency(win,level)
If level>=0 And level<101
hLib = LoadLibrary_("user32.dll")
If hLib
adr = GetProcAddress_(hLib,"SetLayeredWindowAttributes")
If adr
SetWindowLong_(WindowID(win),#GWL_EXSTYLE,GetWindowLong_(WindowID(win),#GWL_EXSTYLE)|$00080000) ; #WS_EX_LAYERED = $00080000
CallFunctionFast(adr,WindowID(win),0,255*level/100,2)
EndIf
FreeLibrary_(hLib)
EndIf
EndIf
EndProcedure
Procedure StatusWindow(fenstername.s, text.s, width.l, BACKCOLOR.l)
If ExamineDesktops()
dh = DesktopHeight(0)
dw = DesktopWidth(0)
dh =dh - 150
dw =dw - width
tw = width - 10
If OpenWindow(1, dw, dh, width, 100,#PB_Window_BorderLess | #PB_Window_Invisible,fenstername.s)
hBrush.l = CreateSolidBrush_(BACKCOLOR)
SetClassLong_(WindowID(), #GCL_HBRBACKGROUND, hBrush.l)
InvalidateRect_(WindowID(), #Null, #True)
If CreateGadgetList(WindowID())
If LoadFont(0,"Arial",16)
SetGadgetFont(#PB_Default,FontID()) ; geladenen Arial 16 Zeichensatz als neuen Standard festlegen
EndIf
TextGadget(2, 5, 10, tw, 25, text.s, #PB_Text_Center)
SetWinTransparency(1,0)
Delay(20)
HideWindow(1,0)
For x=0 To 80
SetWinTransparency(1,x)
Delay(5)
Next
time = 0
Repeat
Event = WindowEvent()
time = time + 1
Delay(1)
Until time > 1500
x=100
SetWinTransparency(1,x)
Delay(200)
Repeat
SetWinTransparency(1,x)
x=x-1
Delay(10)
Until x =< 0
HideWindow(1,1)
Delay(100)
EndIf
EndIf
EndIf
EndProcedure
Code: Alles auswählen
StatusWindow("Fenster Titel", "Hallo =)", 300, RGB(20,0,100))
kurze frage, wie mach ich es dass es von oben nach unten geschossen wird, also genau umgekehrt ??AND51 hat geschrieben:Hallo!
Wollte schon früher posten, aber ging nicht. Ich hoffe, meine Lösung findet auch Verwendung. Ich verwende nur einen API-Aufruf: SystemParametersInfo_() (Abwärtskompatible bis Win95).
Das ist doch gemeint, oder?Code: Alles auswählen
EnableExplicit OpenWindow(0, 0, 0, 300, 250, "AND51", #PB_Window_BorderLess|#PB_Window_Invisible) CreateGadgetList(WindowID(0)) ButtonGadget(0, 50, 50, 200, 50, "Close", #PB_Button_Default) ; get the right location for the window. therefore, we get the WORKAREA-coords Define winpos.RECT SystemParametersInfo_(#SPI_GETWORKAREA, 0, @winpos, 0) ExamineDesktops() With winpos \Right-WindowWidth(0) \Bottom-WindowHeight(0) ResizeWindow(0, \Right, \Bottom, #PB_Ignore, #PB_Ignore) EndWith ; Show the window ; AnimateWindow_(WindowID(0), 1500, #AW_VER_NEGATIVE) ; Roll up AnimateWindow_(WindowID(0), 1500, #AW_VER_NEGATIVE|#AW_SLIDE) ; Slide up ; Wait for closing the window Repeat : Until WaitWindowEvent() = #PB_Event_Gadget And EventGadget() = 0 ; Hide the window ; AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_HIDE) ; Roll down AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_SLIDE|#AW_HIDE) ; Slide down
Code: Alles auswählen
EnableExplicit
OpenWindow(0, 0, 0, 300, 250, "AND51", #PB_Window_BorderLess|#PB_Window_Invisible)
CreateGadgetList(WindowID(0))
ButtonGadget(0, 50, 50, 200, 50, "Close", #PB_Button_Default)
; get the right location for the window. therefore, we get the WORKAREA-coords
Define winpos.RECT
SystemParametersInfo_(#SPI_GETWORKAREA, 0, @winpos, 0)
ExamineDesktops()
With winpos
\Right-WindowWidth(0)
\Bottom-WindowHeight(0)
ResizeWindow(0, \Right, \Bottom, #PB_Ignore, #PB_Ignore)
EndWith
; Show the window
; AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE) ; Roll up
AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_SLIDE) ; Slide up
; Wait for closing the window
Repeat : Until WaitWindowEvent() = #PB_Event_Gadget And EventGadget() = 0
; Hide the window
; AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_HIDE) ; Roll down
AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_SLIDE|#AW_HIDE) ; Slide down
Code: Alles auswählen
EnableExplicit
ExamineDesktops()
OpenWindow(0, 0, 0, DesktopWidth(0), DesktopHeight(0), "AND51", #PB_Window_BorderLess|#PB_Window_Invisible)
CreateGadgetList(WindowID(0))
ButtonGadget(0, 50, 50, 200, 50, "Close", #PB_Button_Default)
; get the right location for the window. therefore, we get the WORKAREA-coords
Define winpos.RECT
SystemParametersInfo_(#SPI_GETWORKAREA, 0, @winpos, 0)
With winpos
\Right-WindowWidth(0)
\Bottom-WindowHeight(0)
ResizeWindow(0, \Right, \Bottom, #PB_Ignore, #PB_Ignore)
EndWith
; Show the window
;AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE) ; Roll up
AnimateWindow_(WindowID(0), 500, #AW_VER_POSITIVE|#AW_SLIDE) ; Slide up
; Wait for closing the window
Repeat : Until WaitWindowEvent() = #PB_Event_Gadget And EventGadget() = 0
; Hide the window
; AnimateWindow_(WindowID(0), 1500, #AW_VER_POSITIVE|#AW_HIDE) ; Roll down
AnimateWindow_(WindowID(0), 500, #AW_VER_NEGATIVE|#AW_SLIDE|#AW_HIDE) ; Slide down
Code: Alles auswählen
+----------+
|XXXXXXXXXX|
|XXXXXXXXXX|
| |
| |
+----------+