If there is any problem that database currently in use and you are not able to restore database than you can run this query for block all processes currently running.
Use Master
Go
Declare @dbname sysname
Set @dbname = 'CDM_HVMS'
Declare @spid int
Select @spid = min(spid) from master.dbo.sysprocesses
where dbid = db_id(@dbname)
While @spid Is Not Null
Begin
Execute ('Kill ' + @spid)
Select @spid = min(spid) from master.dbo.sysprocesses
where dbid = db_id(@dbname) and spid > @spid
End
print 'done'