WM_NCRBUTTONDOWN:
begin
hPopupMenu := CreatePopupMenu; // Bitmap Popupmenu
hSubSkinMenu := CreatePopupMenu; // Bitmap SkinSubmenu
if hPopupMenu <> 0 then
begin
AppendMenu(hPopupMenu, MF_OWNERDRAW, IDM_ABOUT, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW or MF_SEPARATOR, 102, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW or MF_POPUP, hSubSkinMenu, 'Skins');
MnuSkins := nil;
Files := nil;
FindAllFiles(ExtractFilePath(ParamStr(0)) + 'Skins', '.ske', True);
SetLength(MnuSkins, length(Files));
for IntI := 0 to length(Files) - 1 do
AppendMenu(hSubSkinMenu, MF_OWNERDRAW, IDM_SKINS + IntI, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW or MF_SEPARATOR, 102, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW, IDM_AddFile, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW, IDM_AddFolder, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW or MF_SEPARATOR, 102, '');
AppendMenu(hPopupMenu, MF_OWNERDRAW, IDM_Close, '');
GetCursorPos(p);
MenuWahl := TrackPopupMenuEx(hPopupMenu, TPM_RETURNCMD, p.X, p.Y, WinHandle, nil);
DestroyMenu(hPopupMenu);
if MenuWahl then
SendMessage(WinHandle, WM_COMMAND, Makelong(Word(MenuWahl), 0), 0);
end;
end;