Can I ask why you want such an effect? It seems an odd way to scale a window to me. Normally you would want your screen layout to be locked in position.
I have had a go not sure if this is what you want. Bit of a bodge though.
Rem Project: Resize
Rem Created: Tuesday, June 29, 2010
Rem ***** Main Source File *****
set display mode desktop width(),desktop height(),32,1
sync on
load image "media\tile.png",1
scale=100
x=640
y=480
set window size x,y
do
sprite 1,0,0,1
gosub winsize
text 0,400,str$(x)+" "+str$(y)
if scancode()>0
set window size x,y
endif
sync
loop
winsize:
if scancode()=12
if scale>0
dec scale
dec x
dec y
endif
endif
if scancode()=13
inc scale
inc x
inc y
endif
scale sprite 1,scale
return
Obviously it doesn't work with resizing the screen manually using the mouse, you would have to lock the window size to stop people doing that. Then use your own options. If IanM's matrix utils can give you the current window size rather than the screen size then you could use that to scale the sprite or object. I'm not sure if it has that function or not. Not used any dlls for a while.
http://s6.bitefight.org/c.php?uid=103081