Pitaschio can do this, and much much more:
- Snap a window to other windows when moving and resizing
- Restrict a window position to inside of the screen
- Always keep a window above all other windows
- Minimize a window to the system tray
- Use small icons in the desktop
- Disable Windows key, Insert key, Alt key etc.
- Lock the mouse or keyboard while cleaning them
- Take statistics about mouse and keyboard
- Calculate Moon's age
- Control the sound volume using the mouse wheel
- Display the sound volume level on the screen

Pitaschio is freeware.
If you only want the top of the screen to be a boundary, you can use AutoHotkey's functions WinGetPos and WinMove.
To get the position of the active window, and store it in the variables X and Y:
WinGetPos, X, Y, , , A
if the window you're moving goes out of the top boundary (negative value for Y), call WinMove:
WinGetTitle, Title, A ; get its title
WinMove, %Title% , , %X%, 0 ; leave X value alone, modify Y