procedure TSkinPopUpMenu.DestroyWindow;
var
IntI: Integer;
hResource: HBitmap;
begin
UnSubClass(gP.ParentHandle);
KillTimer(
Handle, SKAERO_AERO_TIMER);
KillTimer(
Handle, POPUP_TIMER);
// Alle Skinresourcen freigeben.
if SubMenuHandleCount > 0
then
for IntI := 0
to SubMenuHandleCount - 1
do
SkinEngine.DestroyWindowResource(SubMenuWindow[IntI].Handle);
// Privaten font freigeben
if Assigned(FPrivateFont)
then
GdipCheck(GdipDeletePrivateFontCollection(FPrivateFont));
// erstellte Button freigeben
if ButtonCount > 0
then
begin
for IntI := 0
to ButtonCount - 1
do
begin
btnMenu[IntI].DestroyWindow;
btnMenu[IntI] :=
nil;
end;
FillChar(btnMenu, ButtonCount, 0);
ButtonCount := 0;
end;
// Sidebar resourcen freigeben
if SideBarCount > 0
then
begin
for IntI := 0
to SideBarCount - 1
do
begin
SideBarFrame[IntI].DestroyWindow;
SideBarFrame[IntI] :=
nil;
end;
FillChar(SideBarFrame, SideBarCount, 0);
SideBarCount := 0;
end;
hResource := SkinEngine.GetPaintBitmap(SkinPopUpMenu.Handle);
DeleteObject(hResource);
if SubMenuHandleCount > 0
then
begin
for IntI := 0
to SubMenuHandleCount - 1
do
if Windows.DestroyWindow(SubMenuWindow[IntI].Handle)
then
SubMenuWindow[IntI].Handle := 0;
FillChar(SubMenuWindow, SubMenuHandleCount, 0);
end;
if Windows.DestroyWindow(
Handle)
then
UnRegisterClass(wc.lpszClassName, hInstance);
// Skinresource des Hauptfenster freigeben
SkinEngine.DestroyWindowResource(
Handle);
// TODO
// FillChar(SkinPopUpMenu, SizeOf(SkinPopUpMenu), 0);
if not Assigned(SkinPopUpMenu)
then
PopUpCallback(OnPopupDestroyed);
end;