Your lpxPos and lpyPos variables should be fine...they are being passed by Reference and thus by the address of the variable.

The only thing I can think of is that your Terminal custom control is not passing the proper hWnd value. Is that a control that you wrote yourself?

(You might want to drop a standard VB control into your app and do some experimenting with the DLL call to make sure everything works with a basic text box or something.)

I'm sorry I'm not helping you out too much here...