A picture says more than thousand words:
It uses "SetParent" Windows API dll call. Another feature is to show the Start menu.
UPDATED: Now the script is more stable, it should work on newer versions of Windows too. However still use it on your risk.
; StealStartButtonAndClock.ahk - Moving Windows controls between windows ; ; Tested with AutoHotkey 1.0.46.10 and Windows XP ; There may be problems on Windows Vista, use it on your risk! ; ; Created by HuBa ; Contact: http://www.autohotkey.com/forum/profile.php?mode=viewprofile&u=4693 ControlGet hStartButton, Hwnd, , Button1, ahk_class Shell_TrayWnd ; StartButton ControlGet hClock, Hwnd, , TrayClockWClass1, ahk_class Shell_TrayWnd ; Clock hButtonParent := GetParent(hStartButton) ; Parent of Start button hClockParent := GetParent(hClock) ; Parent of Clock Gui Add, Button, X10 Y90 W180 gShowStartMenu, &Show StartMenu Gui Add, Button, X10 Y120 W80 gStealButton, Steal &Button Gui Add, Button, X110 Y120 W80 gRestoreButton, &Restore Button Gui Add, Button, X10 Y150 W80 gStealClock, Steal &Clock Gui Add, Button, X110 Y150 W80 gRestoreClock, R&estore Clock Gui Show, W200 H200, Steal Start button hGuiWindow := WinExist("ahk_class AutoHotkeyGUI") Return ShowStartMenu: SendMessage 0x112, 0xF130 ; WM_SYSCOMMAND = 0x112 SC_TASKLIST = 0xF130 Return StealButton: if (SetParent(hStartButton, hGuiWindow) = hButtonParent) ButtonStealed := True Return RestoreButton: if (SetParent(hStartButton, hButtonParent) = hGuiWindow) ButtonStealed := False Return StealClock: if (SetParent(hClock, hGuiWindow) = hClockParent) ClockStealed := True Return RestoreClock: if (SetParent(hClock, hClockParent) = hGuiWindow) ClockStealed := False Return GuiClose: GuiEscape: if ButtonStealed GoSub RestoreButton if ClockStealed GoSub RestoreClock ExitApp GetParent(hControl) { Return DllCall("GetParent", "UInt", hControl) } SetParent(hControl, hNewParent) { Return DllCall("SetParent", "UInt", hControl, "UInt", hNewParent) }