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?
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?
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.
Cheers!
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!
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:
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:
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".
Ps: i think the handler is in "Tools.Asm".
Thanks.. I'll try to get ahold of Ketil... Could you please enlighten me about RadAsm's source's whereabouts? Not RadAsm.com ?
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
http://fbedit.svn.sourceforge.net/viewvc/fbedit/RadASM/
http://fbedit.svn.sourceforge.net/viewvc/fbedit/RadASM.tar.gz?view=tar
wow I didn't know KetilO release the source of radasm.
wow I didn't know KetilO release the source of radasm.
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:
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: