Jump to content
Tuts 4 You

How To Make The Text Scroll


arlequim

Recommended Posts

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

  • arlequim

    6

  • diablo2oo2

    5

  • yamraaj

    4

  • wunder

    4

  • 9 months later...

Has anyone here used ReWolf from HtB's scroller lib?

I can't seem to get it to scroll only on my window... The scrolling works fine - however it doesn't seem to use my form - it takes whatever coordinates I give it as the screen. So if I give it coords to my actual form, it will scroll - but when form is moved it stays in the same spot...

Any insight to this?

Link to comment
Has anyone here used ReWolf from HtB's scroller lib?

I can't seem to get it to scroll only on my window... The scrolling works fine - however it doesn't seem to use my form - it takes whatever coordinates I give it as the screen. So if I give it coords to my actual form, it will scroll - but when form is moved it stays in the same spot...

Any insight to this?

Maybe you are not passing handle of your window. Have you looked in the sources provided with the lib. When you create scroll thread then u should pass your window handle too.

From source

_init:

xor eax,eax

push 0

push esp

push eax

push hDlg ;This is what needs attention

push offset thProc

push eax

push eax

call CreateThread

Link to comment
Has anyone here used ReWolf from HtB's scroller lib?

I can't seem to get it to scroll only on my window... The scrolling works fine - however it doesn't seem to use my form - it takes whatever coordinates I give it as the screen. So if I give it coords to my actual form, it will scroll - but when form is moved it stays in the same spot...

Any insight to this?

Maybe you are not passing handle of your window. Have you looked in the sources provided with the lib. When you create scroll thread then u should pass your window handle too.

From source

_init:

xor eax,eax

push 0

push esp

push eax

push hDlg ;This is what needs attention

push offset thProc

push eax

push eax

call CreateThread

Well isn't that the same as... invoke CreateThread,0,0,addr thProc,hWnd,0,addr ThreadID ?

Then I use...

mov eax, hWnd

call GetDC

mov scrTest.hBkgDC, eax

Link to comment
Well isn't that the same as... invoke CreateThread,0,0,addr thProc,hWnd,0,addr ThreadID ?

Then I use...

mov eax, hWnd

call GetDC

mov scrTest.hBkgDC, eax

The above code is wrong. Should be

push eax

call GetDC

That's why better stick to invoke if using masm

u could post ur source or i will code a quick one if u want.

Link to comment
Well isn't that the same as... invoke CreateThread,0,0,addr thProc,hWnd,0,addr ThreadID ?

Then I use...

mov eax, hWnd

call GetDC

mov scrTest.hBkgDC, eax

The above code is wrong. Should be

push eax

call GetDC

That's why better stick to invoke if using masm

u could post ur source or i will code a quick one if u want.

Yea I changed everything to invokes and fixed it up a little bit and it all worked fine, thanks guys

Link to comment
  • 3 weeks later...
  • 1 month later...
  • 1 month later...

I have a problem with my own coded scroller. It works fine on usual windows. but when i set the window to WS_EX_LAYERED and make it transparent, the scroller doesnt move so smooth....

any ideas? i attached also the scrollercode.

scroller.window.problem.rar

Edited by diablo2oo2
Link to comment

I didn't try, but maybe double buffering helps, when it's layered :?

Swapping 2 DCs, after the scroller has been drawn or something.

Edited by Ufo-Pu55y
Link to comment
I didn't try, but maybe double buffering helps, when it's layered :?

Swapping 2 DCs, after the scroller has been drawn or something.

i really dont understand what you mean. because i am new in gfx coding... :wacko:

ufo, are online on irc sometimes?

Link to comment
I didn't try, but maybe double buffering helps, when it's layered :?

Swapping 2 DCs, after the scroller has been drawn or something.

i really dont understand what you mean. because i am new in gfx coding... :wacko:

ufo, are online on irc sometimes?

Ah lol :happy:

I remember I had that prob in the past. All you need is to update the layered window.

I tried with UpdateLayeredWindow first like I'm doing for uPPP, but somehow it didn't work. Anyway

SetLayeredWindowAttributes is enough and doesn't require the mess of args for UpdateLayeredWindow.

Here we go:

	@loop:
.if [esi].scroll_pause==0
invoke BitBlt,local_hdc_text,0,0,[esi].scroll_width,local_scroll_height,local_hdc_window_copy,[esi].scroll_x,[esi].scroll_y,SRCCOPY
invoke TextOut,local_hdc_text,ebx,0,[esi].scroll_text,local_text_len
invoke BlendBitmap,local_hdc_text,local_hdc_window_copy,local_scroll_height,[esi].scroll_width,[esi].scroll_x,[esi].scroll_y,[esi].scroll_textcolor
invoke BitBlt,local_hdc_window,[esi].scroll_x,[esi].scroll_y,[esi].scroll_width,local_scroll_height,local_hdc_text,0,0,SRCCOPY
dec ebx
.if ebx==local_text_endpos
;---reset text position to begining---
mov ebx,[esi].scroll_width
.endif invoke SetLayeredWindowAttributes,[esi].scroll_hwnd,0,155,LWA_ALPHA; Well.. not 155 but the used transparency ofc ! .endif
invoke Sleep,30
jmp @loop

;)

Edited by Ufo-Pu55y
Link to comment
I didn't try, but maybe double buffering helps, when it's layered :?

Swapping 2 DCs, after the scroller has been drawn or something.

i really dont understand what you mean. because i am new in gfx coding... :wacko:

ufo, are online on irc sometimes?

Ah lol :happy:

I remember I had that prob in the past. All you need is to update the layered window.

I tried with UpdateLayeredWindow first like I'm doing for uPPP, but somehow it didn't work. Anyway

SetLayeredWindowAttributes is enough and doesn't require the mess of args for UpdateLayeredWindow.

Here we go:

	@loop:
.if [esi].scroll_pause==0
invoke BitBlt,local_hdc_text,0,0,[esi].scroll_width,local_scroll_height,local_hdc_window_copy,[esi].scroll_x,[esi].scroll_y,SRCCOPY
invoke TextOut,local_hdc_text,ebx,0,[esi].scroll_text,local_text_len
invoke BlendBitmap,local_hdc_text,local_hdc_window_copy,local_scroll_height,[esi].scroll_width,[esi].scroll_x,[esi].scroll_y,[esi].scroll_textcolor
invoke BitBlt,local_hdc_window,[esi].scroll_x,[esi].scroll_y,[esi].scroll_width,local_scroll_height,local_hdc_text,0,0,SRCCOPY
dec ebx
.if ebx==local_text_endpos
;---reset text position to begining---
mov ebx,[esi].scroll_width
.endif invoke SetLayeredWindowAttributes,[esi].scroll_hwnd,0,155,LWA_ALPHA; Well.. not 155 but the used transparency ofc ! .endif
invoke Sleep,30
jmp @loop

;)

Ufopussy! you are my hero! it works. next dup version with textscroller! thank you!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...