1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43:
| procedure ShowStartMenu(uPosition: TPoint; uPosRelativeTo: Hwnd; uMoveOnTopOfPos: Boolean); var StartMenuWinRect: TRect; DropShadow: BOOL; StartMenuHandle: HWND; begin if uPosRelativeTo <> 0 then ClientToScreen(uPosRelativeTo, uPosition); StartMenuHandle := FindWindow('DV2ControlHost', nil); if uMoveOnTopOfPos then begin GetWindowRect(StartMenuHandle, StartMenuWinRect); uPosition.Y := uPosition.Y - StartMenuWinRect.Bottom + StartMenuWinRect.Top; end; if CheckWin32Version(5, 1) then begin SystemParametersInfo(SPI_GETDROPSHADOW, 0, @DropShadow, 0); if DropShadow then SystemParametersInfo(SPI_SETDROPSHADOW, 0, Pointer(False), 0); end; SetWindowPos(StartMenuHandle, 0, uPosition.X, uPosition.Y, 0, 0, SWP_NOSIZE or SWP_SHOWWINDOW); if CheckWin32Version(5, 1) and DropShadow then SystemParametersInfo(SPI_SETDROPSHADOW, 0, Pointer(True), 0); end; |