If I'm following you correctly you're attempting to center a "desktop" window relative to mIRC's position? where -C centers it to the desktop?

I broke this down into a few sections, mIRC's position on the desktop (-2 both .dx and .dy) and mIRC's dimensions on the desktop (-2 .w and .w)
so knowing this, mIRC's position + half of it's dimension = center pixel relative to mIRC's overall size and position on the desktop.

If you know your custom @window's size, then simply taking that position and subtracting half it's dimensions would be the screen coordinates you need to be centered within the mIRC window. Here's a quick example alias demonstrating the effect.

cwt {
  var %mx = $window(-2).dx , %my = $window(-2).dy
  var %mw = $window(-2).w , %mh = $window(-2).h
  var %cw = 320 , %ch = 240 
  var %px = $calc(%mx + %mw / 2 - %cw / 2) , %py = $calc(%my + %mh / 2 - %ch / 2)
  window -dpf @CenterWindowTest %px %py %cw %ch