flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > open last file!

Thread Post new topic Reply to topic

Joined: 08 May 2005
Posts: 22
I added function i wanted in fasmw that of course didn't exist or i wouldn't create it DOH Wink

fasmw now saves last file u opened so when start fasmw again it will open last used file at startup, this is of course change to IDE version since other ones don't have any point in such function!

asm file i attach is for newest version of fasmw IDE 1.61.1 and i never added label in menu for this function so u could turn it off and on, beacuse i had no idea howto, never worked with menus before, and source isn't commented anywhere, but anyway if anyone wants this function just download asm source and replace old one under IDE dir, and almost forgot mention that it only saves 1 file and that is last, so even if u got 3 documents open i it will only savelast opened one and only open that one at startup...ah u know what i mean! *i hope*

anyone is free add menu item for this or improve it more, plz post in this thread if so!

suggest use winmerge to find where i added all this, my code is between "new begin" and "new end"
this is what i added:

section name in ini file is [File] and Path, so it knows where last file open was.

invoke GetObject,ebx,sizeof.BITMAP,bm
invoke ImageList_Create,[bm.bmWidth],[bm.bmHeight],ILC_COLOR4,1,0
or eax,eax
jz failed
mov [himl],eax
invoke ImageList_Add,[himl],ebx,NULL
invoke DeleteObject,ebx
invoke SendMessage,[hwnd_tabctrl],TCM_SETIMAGELIST,0,[himl]
;New begin
cmp [open_path] ,0 ; is path in "ini" file empty?
jz new_one ; if so create new document as old fasm does
mov [lparam],open_path ; filepath to lparam for later use
invoke GetFileTitle,open_path,name_buffer,100h ; get file name
mov [wparam],name_buffer ; save it to wparam for sendmessage
jmp load_file ; Ok all done jump to old fasm code and load it
new_one: ; if wasn't any path in ini file then run default fasm code below
;New end
invoke SendMessage,[hwnd],FM_NEW,_untitled,0
cmp eax,-1
je failed
mov esi,[program_arguments]

Description: Enjoy
Filename: FASMW.ASM
Filesize: 84.44 KB
Downloaded: 602 Time(s)

Post 09 May 2005, 06:26
View user's profile Send private message Reply with quote

Joined: 02 Apr 2004
Posts: 326
Location: US
nice work. i think it would be convenient to have a recent files menu, showing the last 4-5 files worked on
Post 09 May 2005, 16:11
View user's profile Send private message Reply with quote

Joined: 08 May 2005
Posts: 22
I try update source with that is i get hang of it Razz

and fix bug, if u got fasm IDE associated with asm files and open one though explorer, then last open file will open instead of file u clicked on!

but if u or anyone want help then come along hehe, i need all help i can get, just doing this for learning!
Post 09 May 2005, 19:23
View user's profile Send private message 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.