It depends on the operation/wm you're using. Consulting its manual is the best thing you could do.
To clarify it depends on the Operation System (OS) or Window Manager (wm).
Note: I am guessing on the wm meaning.
Please re-read the rules you maybe breaking
http://forums.codeblocks.org/index.php/topic,9996.0.html.
Edit: In this case, I think you are not violating the rules because I think CB should have a way to do what you want.
Which is to do File Associations with the CB Application. I do NOT know of a way to do File Associations under CB.
And, the answer likely would vary per the OS/wm used.
Edit2: Found a location inside CB to do it for Windows; "Settings" -> "Environment" -> "General Setting"
Tim S.