Look up AddressOf and SetWindowLong. Using these, you can intercept the Windows messages that are generated. SBM_GETPOS may be a helpful constant. Because you're interfering with Windows messages, it's a lot easier to crash your program, so you should save before each run.