The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: Vortex on July 06, 2005, 08:18:14 AM

Title: Scroll demo
Post by: Vortex on July 06, 2005, 08:18:14 AM
Here is an algo to create scrolling effect on the desktop:
Quote
.386
.model flat,stdcall
option casemap:none

include   \masm32\include\windows.inc
include   \masm32\include\kernel32.inc
include   \masm32\include\user32.inc
include   \masm32\include\gdi32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\gdi32.lib

.data?
x   dd ?
y   dd ?
counter   dd ?
hdc   dd ?

.code

start:
   invoke   GetSystemMetrics,SM_CXSCREEN
   mov   x,eax
   invoke   GetSystemMetrics,SM_CYSCREEN
   mov   y,eax
   shr   eax,1
   mov   counter,eax
   invoke   GetDC,0
   mov   hdc,eax
@@:
   invoke   BitBlt,hdc,1,1,x,y,hdc,0,0,SRCCOPY
   dec   y
   dec   counter
   jnz   @b
   invoke   ReleaseDC,0,hdc
   invoke   ExitProcess,NULL

END start

[attachment deleted by admin]
Title: Re: Scroll demo
Post by: Phil on July 06, 2005, 08:22:09 AM
Super sweet and simple! Thanks Vortex ...
Title: Re: Scroll demo
Post by: hutch-- on July 06, 2005, 09:25:32 AM
Vortex,

You have started a monster.  :bg

Here is a hscroll demo.



[attachment deleted by admin]
Title: Re: Scroll demo
Post by: Vortex on July 06, 2005, 09:37:41 AM
That's nice Hutch  :U
Title: Re: Scroll demo
Post by: Rifleman on July 06, 2005, 02:30:49 PM
Hutch,
That is very kewl!  And it does not mess up the display!

Paul
Title: Re: Scroll demo
Post by: Phil on July 06, 2005, 04:46:51 PM
And here's a variation one, using Hutch's template, for those who prefer to view from right to left!


[attachment deleted by admin]
Title: Re: Scroll demo
Post by: Vortex on July 13, 2005, 06:26:43 PM
Here is my classical bouncing window example  :toothy

[attachment deleted by admin]
Title: Re: Scroll demo
Post by: Phil on July 14, 2005, 04:25:43 AM
Yeah, that's cool! It would certainly be difficult to close it after a few too many! Took me about 15 seconds to finally hit the right spot and all I've been drinking is tea!
Title: Re: Scroll demo
Post by: Vortex on July 14, 2005, 05:36:50 AM
Hi Phil,

Yes, that window,it's difficult to catch. :toothy