| View previous topic :: View next topic |
| Author |
Message |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu Jul 09, 2009 12:07 pm Post subject: dynamic list |
|
|
i wanna make a dynamic list like CE's address list. the user can add entries one by one and delete them. the implementation of the 'list' will be a linked list which i need to code.
i was wondering how CE does it.. for its GUI
edit : i think it's a listbox.. gotta figure out how to use it
awesome figured it out. but how does CE make it so there's multiple 'fields' for each row ?
edit : fck that i was wasting my time. it's list-view i want, not listbox
oh wow gay.. just realised dialog units aren't the same as pixels and the column width needs to be given in pixels. OMG GAYYYYYY
okay i actually have a question now. if i want to split the listview into 2 columns then i need to add each column with LVM_INSERTCOUMN where a width is specified. let's say the control's entire width is 150 DLU. now i tried converting 100 DLU and 50 DLU to pixels and then creating those columns with the converted lengths but it always ends up a tiny bit too big so then it generates a lame little horizontal scroll at the bottom of the control. i then tried converting 100 DLU and 150 DLU then creating a column with index 0 of width 'converted 100 DLU' and the colum with index 1 of width 'converted 150 DLU - converted 100 DLU' but the same thing happens and i get the horizontal bar. any ideas anyone ?!
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Jul 10, 2009 6:06 pm Post subject: |
|
|
hey thanks for that but i really, really hate using undocumented functions.. i keep thinking back to it and it's like an itch that won't go away till i change it LOL
i guess i will have to root around in CE source sometime..
btw in case what i said was unclear to anyone, here is what i mean :
see how under the list view there is a gay little horizontal scrollbar..
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Jul 11, 2009 2:39 am Post subject: |
|
|
| Remember that the dialog size (and size of controls in the dialog) depends on the font size you are using for the dialog.
|
|
| Back to top |
|
 |
DoomsDay Grandmaster Cheater
Reputation: 0
Joined: 06 Jan 2007 Posts: 768 Location: %HomePath%
|
Posted: Sat Jul 11, 2009 4:50 am Post subject: |
|
|
| If my memory serves me right there shoud be an example of how to use a listview in the masm32 examples.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sat Jul 11, 2009 5:51 am Post subject: |
|
|
i'm okay with using listview for the time being, just trying to get rid of that horizontal bar..
it seems to disappear when i include a manifest during building o_O
top example is with manifest included of course.
|
|
| Back to top |
|
 |
DoomsDay Grandmaster Cheater
Reputation: 0
Joined: 06 Jan 2007 Posts: 768 Location: %HomePath%
|
Posted: Sat Jul 11, 2009 10:30 am Post subject: |
|
|
| It also depends on the frame then.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sat Jul 11, 2009 4:42 pm Post subject: |
|
|
| DoomsDay wrote: | | It also depends on the frame then. |
what frame o_O
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sat Jul 11, 2009 4:59 pm Post subject: |
|
|
| How about allocating a block of memory around 1024 Bytes, than write the addresses there?
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sat Jul 11, 2009 5:29 pm Post subject: |
|
|
| wat
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sat Jul 11, 2009 11:51 pm Post subject: |
|
|
My asm sucks...
| Code: |
dwAddr dd ?
push 0
push 512 ;How big you want it
push MEM_COMMIT
push PAGE_EXECUTE_READWRITE
call VirtualAlloc
mov [dwAddr], eax
|
When you want the address you could do...
| Code: |
mov eax, dword ptr ds:[addrIndex]
xor ebx, ebx
@@:
cmp ebx, 512
jge @f
mov ecx,[dwAddr+4]
add ebx, 4
jmp @b
@@:
test ecx, ecx
jnz Win
;lose
|
Edit:
Oh, you guys are talking about something else, nvm. Feel free to criticize my shiz.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Jul 12, 2009 5:41 am Post subject: |
|
|
i would criticize but i have no clue what you're even trying to do and i have no clue why you thought we were trying to do anything even vaguely related to addresses
| Code: | @@:
cmp ebx, 512
jge @f
mov ecx,[dwAddr+4]
add ebx, 4
jmp @b
@@:
test ecx, ecx
jnz Win |
since dwAddr does not change in that first loop at all there is no point in having that so you could move it down to have :
| Code: | @@:
mov ecx, dword ptr ds:[dwAddr+4]
test ecx, ecx
jnz Win |
in which case you could just do :
| Code: | @@:
cmp dword ptr ds:[dwAddr+4], 0
jnz Win |
so now the top part of your loop is like this :
| Code: | @@:
cmp ebx, 512
jge @f
add ebx, 4
jmp @b |
which you can convert to be less inefficient..
| Code: | sub ebx, 4
@@:
add ebx, 4 ; not sure if lea ebx, [ebx+4] is faster
cmp ebx, 512 ; could be converted to a test i think ?!
jl @b |
so..
| Code: | mov eax, dword ptr ds:[addrIndex]
xor ebx, ebx
@@:
cmp ebx, 512
jge @f
mov ecx,[dwAddr+4]
add ebx, 4
jmp @b
@@:
test ecx, ecx
jnz Win
;lose |
can be converted to..
| Code: | mov ebx, -4
@@:
add ebx, 4 ; not sure if lea ebx, [ebx+4] is faster
cmp ebx, 512 ; could be converted to a test i think ?!
jl @b
cmp dword ptr ds:[dwAddr+4], 0
jnz Win |
your first line of code also does nothing useful since eax is never used in the loop
actually what the hell are you even doing with the ebx. in my loop it's more 'clear'. you're doing nothing but counting up LOL. wowwwww you're pro ; )
in fact after 'optimizing' your code we can all see that you can't code and were in fact talking out of your ass ^_^
good game
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sun Jul 12, 2009 10:09 am Post subject: |
|
|
Ohhhh, ok. I can still see you're still an immature out of place faggot who's trying to prove he's worth something in the world, but really, he's not worth shit.
inb4spencer
You'd probably show this to spencer, because you couldn't have an argument with me without inviting someone else.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Jul 12, 2009 11:04 am Post subject: |
|
|
what... you posted some obsolete and useless code. i pointed it out and even kindly gave you an optimized version regardless of its functionality as a learning exercise to you and you throw it back in my face by attacking me ?
what are you void, a rabid dog ?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Jul 12, 2009 3:37 pm Post subject: |
|
|
| can you chodes ever not get into a stupid argument about anything?
|
|
| Back to top |
|
 |
|