The MASM Forum

General => The Campus => Topic started by: jimg on March 12, 2016, 10:48:25 AM

Title: scroll to top left
Post by: jimg on March 12, 2016, 10:48:25 AM
I'm having a senior moment here.

I have a dialog I've been moving around with ScrollWindow.   After awhile, I'm out of sync due to roundoff error or some other factor.   What is the command to scroll the window to the zero,zero position so I can re-calibrate?   ScrollWindow only seems to be relative to the current position, and I've lost that position.  I can't even think of a good enough term to search online and get an answer.
Title: Re: scroll to top left
Post by: TouEnMasm on March 12, 2016, 05:47:08 PM
If you can post your code or a sample,it will be more simple to help you.
Title: Re: scroll to top left
Post by: jj2007 on March 12, 2016, 06:46:06 PM
Quote from: jimg on March 12, 2016, 10:48:25 AMAfter awhile, I'm out of sync due to roundoff error or some other factor.

Even if you are working with integer results, and keep them in global variables?

If nothing helps, hide it a second, resize to w=1, h=1, update(?), then restore the old size, update and show again. But as Yves wrote, code for testing would be nice ;)
Title: Re: scroll to top left
Post by: MichaelW on March 13, 2016, 12:54:33 AM
You could maintain a set of coordinates that track the offset of the window from the original position, updating them each time you scroll the window.
Title: Re: scroll to top left
Post by: jimg on March 13, 2016, 01:15:56 AM
Thank you.  I thought I was having a real brain glitch.   From your comments, there apparently is no scroll to origin command.  :)   
What an oversight on Microsoft's part.