explaining arrays :)





lets open a file using OPENFILENAME from windos api !!



lets read some :)


OPENFILENAME Type

Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustomFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As String
lpstrFileTitle As String
nMaxFileTitle As String
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type

OPENFILENAME-type variables work with the two Windows file dialog box APIs, GetOpenFileName and
GetSaveFileName. This type is used both to pass information to the function and returns data from it.






mmmmmm.......

Long , Integer whats that ?? lol never seen in my life hll is real stupid :) lol


well i make some research and i got this :




then i just got what that means in terms of bytes :)



data types
========
resb = byte = db 1 Byte ( 8 Bit)
resw = word = dw 2 Byte (16 Bit)
resd = dword = dd = doubleword 4 Byte (32 Bit)
resq = qword = = 8 Bytes

CString 4 bytes = resd
bool 1 byte
wchar_t 2 bytes = resw
float 4 bytes = resd
long double 10 bytes
double 8 bytes = resq
byte 8 contiguous bits, one address unit
word two contiguous address units
dword four contiguous address units, 'cell'
qword = eight contiguous address units = 8 bytes
char = 8bit = byte
short = 16bit = word
short int = 16bit = word
int = 32bit = dword
long 32bit dword
long int 32bit dword
long long 64bit qword
long long int 64bit qword



ok know you can convert any array !

















%include "\lab\vasm\inc\nagoa.inc"






..start:



section data

ofn resb OPENFILENAME_size ; ofn times 72 db 0 ;-)

%define ofn.lStructSize ofn
%define ofn.hwndOwner ofn +4
%define ofn.hInstance ofn + 8
%define ofn.lpstrFilter ofn 12
%define ofn.lpstrCustomFilter ofn +16
%define ofn.nMaxCustFilter ofn + 20
%define ofn.nFilterIndex ofn + 24
%define ofn.lpstrFile ofn + 28
%define ofn.nMaxFile ofn + 32
%define ofn.lpstrFileTitle ofn + 36
%define ofn.nMaxFileTitle ofn + 40
%define ofn.lpstrInitialDir ofn + 44
%define ofn.lpstrTitle ofn + 48
%define ofn.Flags ofn + 52
%define ofn.nFileOffset ofn + 54
%define ofn.nFileExtension ofn + 56
%define ofn.lpstrDefExt ofn + 60
%define ofn.lCustData ofn + 64
%define ofn.lpfnHook ofn + 68
%define ofn.lpTemplateName ofn + 72

section code

mov dword , 72 ; OPENFILENAME_size
push ebx ; save ebx so we can use it without causing any modification on him
sub ebx , 120 ; making a buffer using eax ;-)
mov , ebx
pop ebx ; restore ebx as it was
mov dword , buffer


call GetOpenFileNameA,ofn
call ExitProcess , 0



















another example






%include "\lab\vasm\inc\nagoa.inc"


..start:

section data

Pessoa:
dd 0
dd 0

%define Pessoa.Nome Pessoa
%define Pessoa.Familia Pessoa+4


section code

mov dword , "Pedro"
mov dword , "Carvalho"
mov eax ,
cmp eax ,
jne .out
call MessageBoxA , 0,"info=sim !","title1",MB_OK
jmp .exit
.out
call MessageBoxA , 0,"info nao !","title1",MB_OK
.exit
call ExitProcess , 0




using NASM syntax and NaGoA


http://groups.yahoo.com/group/win32-nasm-users/
Posted on 2004-02-12 12:15:41 by Nguga
GOOD STUFF
ALL THE BEST
nickdigital
Posted on 2004-10-05 13:38:50 by nickdigital