I used:

CRect TotalSize = GetClientRect()
SetScaleToFitSize(CSize(TotalSize.right,TotalSize.right))



and it worked.

I don´t know if there is a better method or if it works with splitter windows.

This function only sets the scroll size to the full window automatically. To show the scroll bars again use SetScrollSize(MM_TEXT,myDocSize).