2 Replies - 645 Views - Last Post: 09 November 2012 - 01:00 AM

#1 Latias  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 73
  • Joined: 28-June 12

how to change from control to control

Posted 08 November 2012 - 04:10 PM

hey i found a beatifully colored animated pixel moving code which is nice to have,but i dont want to apply the code on the main window, but in a label or groupbox window.

so i changed the hWnd to the id of the label, but then nothing happend.
so i thought ehmm maybe i should get the handle of the labelcontrol itself so i used getdlgitem and pushed the output to the code, but this doesnt work either.

so the main thing is it should not paint the whole dialog but only a part in this case only the label area

anybody who can tell what do you?


password of the rararchive is asm

This post has been edited by Latias: 09 November 2012 - 06:16 AM


Is This A Good Question/Topic? 0
  • +

Replies To: how to change from control to control

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: how to change from control to control

Posted 08 November 2012 - 06:34 PM

You mean like this:
http://www.gunnerinc...iles/Static.mp4

The problem with copy and paste code, is it does you no good. It teaches you nothing.

Why don't you read up on:
WM_PAINT and what it does, what it is used for, its parameters, and what it cannot do.
BeginPaint, same as above, parameters.
EndPaint, what it does.

You are all over the place with invokes, and push/calls. Stick with one! It will cause you troubles, and you gain nothing by manually pushing parameters and doing a call.

I see a pushad in your code, but no popad, this will cause troubles.

Where are you getting the handle to your static control????

Create a variable called hStatic in .data? and somewhere in WM_INITDIALOG add this:
invoke  GetDlgItem, hWnd, 1001  
        mov     hStatic, eax 


In WM_PAINT, change this:
mov	eax, [hWnd]        
		 mov	ecx, OFFSET ps  

to this:
mov	eax, hStatic        
		 mov	ecx, OFFSET ps  


Get rid of the brackets around variables, this is not NASM or FASM. MASM does not need them, do you know the difference between:
mov     eax, hStatic
    mov     eax, [hStatic]
they have two different meanings.
Was This Post Helpful? 1
  • +
  • -

#3 Latias  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 73
  • Joined: 28-June 12

Re: how to change from control to control

Posted 09 November 2012 - 01:00 AM

it seems to be working!thank you so much sir

i know the difference between the non brackets and brackets, just with the brackets in will take the value of the pointer, without brackets in will take pointer only

thanks again master
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1