flat assembler
Message board for the users of flat assembler.

Index > Windows > I need help please

Author
Thread Post new topic Reply to topic
edie



Joined: 11 Nov 2004
Posts: 4
edie
hi, my name is edie I'm from Panama and I need some help Confused :
this is the problem, i need to do an app that may read (open) a txt file then if the user change the text, it need to save it. I'm new in Flat Assambler, and I don't have a list of the APIs, if somebody can help me please, I need it for november 12 Crying or Very sad (tomorrow) I have this but it isn't compleate

Code:
++++++++++++++[b]ASM FILE[/b]++++++++
format PE GUI
include 'macros.inc'
NULL = 00h
WM_DESTROY = 0002h
GWL_WNDPROC = -4
WS_VISIBLE = 010000000h
WS_SYSMENU = 000080000h
WS_THICKFRAME = 000040000h
WS_EX_TOPMOST = 00008h
ES_MULTILINE = 0040h
ES_AUTOVSCROLL = 0004h
struc POINT
{
.x dd ?
.y dd ?
}
struc MSG
{
.hwnd dd ?
.message dd ?
.wParam dd ?
.lParam dd ?
.time dd ?
.pt POINT
}
section '.code' code readable executable
call CreateWindowEx,WS_EX_TOPMOST,_class,_title,\
WS_VISIBLE or WS_SYSMENU or WS_THICKFRAME\
or ES_AUTOVSCROLL or ES_MULTILINE,\
0,0,800,570,\
NULL,NULL,NULL,NULL
mov [hwnd],eax
call SetWindowLong,eax,GWL_WNDPROC,WndProc
mov [oldproc],eax
msg_loop:
call GetMessage,msg,NULL,0,0
or eax,eax
jz terminate
call TranslateMessage,msg
call DispatchMessage,msg
jmp msg_loop
terminate:
call ExitProcess,[msg.wParam]
WndProc:
push ebp
mov ebp,esp
mov eax,[ebp+12]
cmp eax,WM_DESTROY
jne .default
call PostQuitMessage,0
.default:
call CallWindowProc,[oldproc],[ebp+8],\
[ebp+12],[ebp+16],[ebp+20]
leave
retn 16
section '.data' data readable writeable
hwnd dd ?
oldproc dd ?
msg MSG
_class db 'EDIT',0
_title db 'Ensamblando Win32',0
section '.idata' import data readable
library kernel,'KERNEL32.DLL',\
user,'USER32.DLL'
import kernel,\
ExitProcess,'ExitProcess'
import user,\
CallWindowProc,'CallWindowProcA',\
CreateWindowEx,'CreateWindowExA',\
DispatchMessage,'DispatchMessageA',\
GetMessage,'GetMessageA',\
PostQuitMessage,'PostQuitMessage',\
SetWindowLong,'SetWindowLongA',\
TranslateMessage,'TranslateMessage'    



Code:
************** [b]macros.inc [/b]********************

macro library [name,string]
{ forward
local _label
dd RVA name,0,0,RVA _label,RVA name
common
dd 0,0,0,0,0
forward
_label db string,0
}
macro import name,[label,string]
{
common
name:
forward
local _label
label dd RVA _label
API.#label = 1
common
dd 0
forward
_label dw 0
db string,0
}
macro call proc,[arg]
{
reverse
if arg eq
else
pushd arg
end if
common
if defined API.#proc
call [proc]
else
call proc
end if
}                               
******************************************    

Sorry my English Laughing
[edit by moderator]please use the [ code ] [ / code ] tags around sections of code[/edit by moderator]
Post 11 Nov 2004, 21:20
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
this thread is assembly related, Heap is for non assembly related (primarily) you may wanna move it somewhere else?
Post 11 Nov 2004, 22:33
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Matrix wrote:
this thread is assembly related, Heap is for non assembly related (primarily) you may wanna move it somewhere else?


Sorry, my fault. It was in "IDE developement" and IMHO, the proper place is "Windows", but I move it by mistake to the "Heap". Decard can fix the problem tomorow.

Regards.
Post 11 Nov 2004, 23:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edie



Joined: 11 Nov 2004
Posts: 4
edie
No mather. Thank u, I'm trying to do by my self but i need some help Smile
Post 12 Nov 2004, 04:28
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.