A useful program I found for dota, which can be used for Diablo 2 in window mode.
Original Source: http://veeteesoftware.blogspot.com/search?q=wmc
WMC is an extended version of Warcraft III Mouse Capture.
It allows you to lock the mouse within a specified window (not just limited to Warcraft III).
The primary use of this program is to have a game (in window mode) on one monitor and applications such as IM and internet browser on another.
Without WMC if you move your mouse to the edge of the screen while playing your game, your mouse will just leave the game. You wont be able to aim!
Errors while trying to start the application?
Then you need .Net Version 2 Framework.
Right click the icon on the taskbar, click specify.
Now left click inside the window you want to specify (not on the taskbar).
Enable Capture/Release mode
Press your set hotkey to enable/disable capture mode.
The icon will change color to indicate the status:
* White: WMC is not enabled for capturing
* Yellow: WMC is enabled for capturing but window isnt active
* Red: WMC has captured the mouse
To switch windows either alt-tab or press the hotkey to disable capture mode.
Right click the icon on the taskbar, click inside the text box and press your hotkey.
(NOTE: It is advised to download this when a mod has approved it. I've never had any problems with this, but you never know...)