About time I create another (half-finished) addin, I am thinking on a real cool addition to RadAsm (as far as I am concerned). But to achieve my goal I need to know how I can programmatically add a line to a file in the RadAsm Project folder I am in. I could do it with CreateFile, WriteFile but if the file is open confusion may occur by me overwriting stuff. (Also the undo would not work as I circumvented RadAsm entirely.

I do not need to figure out which file or what to write just the add a line of text somewhere without setting focus on that file or anything similar. Any hints?
Posted on 2008-12-03 10:31:57 by JimmyClif
Hi JC,

Take a look at ResourceID plugin by Ketil, it does exactly what you need.
If the file is open use EM_REPLACESEL, otherwise use WriteFile.
if hOpen
invoke GetWindowLong,hOpen,GWL_USERDATA
mov hOpen,eax
mov chrg.cpMin,0
mov chrg.cpMax,-1
invoke SendMessage,hOpen,EM_EXSETSEL,0,addr chrg
invoke SendMessage,hOpen,EM_REPLACESEL,TRUE,hMem
.else
push eax
invoke CreateFile,lpFile,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
mov hFile,eax
pop edx
invoke WriteFile,hFile,hMem,edx,addr dwWrite,NULL
invoke CloseHandle,hFile
.endif


Cheers!
Posted on 2008-12-03 11:14:56 by drizz
Thanks Drizz. Sorry for the late reply.. My kids just won't stop bugging me :)

Another question: Do you know where the source code is for the InfoTool window under the toolbar? How would I add my own in that spot?

Cheers :thumbsup:
Posted on 2008-12-07 07:43:20 by JimmyClif
Im not sure if you can programatically add toolbox, or how to do it... better ask Ketil.

Ps: i think the handler is in "Tools.Asm".
Posted on 2008-12-08 10:47:30 by drizz
Thanks.. I'll try to get ahold of Ketil... Could you please enlighten me about RadAsm's source's whereabouts? Not RadAsm.com ?
Posted on 2008-12-09 14:59:09 by JimmyClif
https://fbedit.svn.sourceforge.net/svnroot/fbedit/RadASM/
http://fbedit.svn.sourceforge.net/viewvc/fbedit/RadASM/
http://fbedit.svn.sourceforge.net/viewvc/fbedit/RadASM.tar.gz?view=tar
Posted on 2008-12-10 03:15:36 by drizz
wow I didn't know KetilO release the source of radasm.
Posted on 2008-12-10 07:33:20 by roticv

wow I didn't know KetilO release the source of radasm.
About year and a half ago! :O
Posted on 2008-12-10 09:44:42 by drizz
I thought I had the source once but I must have misplaced it, deleted it by accident, lost in a hard disk crash or something similar must have happened...

Ketil got back to me and I hope I am now well on my way to deliver some goods in a few days to a week.

Thanks for the help :thumbsup:
Posted on 2008-12-10 10:28:46 by JimmyClif