There was only one thing wrong with the code you tried:
(set-window-dedicated (selected-window) t)
The function is set-window-dedicated-p, not set-window-dedicated. Try again, without the typo.
There was only one thing wrong with the code you tried:
(set-window-dedicated (selected-window) t)
The function is set-window-dedicated-p, not set-window-dedicated. Try again, without the typo.