Jump to content
Tuts 4 You

Create A Log


Fungus

Recommended Posts

I'd like to create a log (in an edit box or?)

Like in dup2's patch window, and ImpREC's log window.

How do I go about doing this, I've searched and searched and can find no src on how to do this.

I'd also like to be able to save the log to a file, and be able to scroll the log up and down.

thnx in advance =)

Link to comment

You have to use SendMessage commands. There is a bunch of different ways to use the command. For instance using

invoke SendMessage, eax, LB_ADDSTRING, -1h, offset bufferwhere eax = handle of window, buffer = text to be added

will keep adding lines of text. But there is a lot of different ways to go about doing that. I hope this at least points you in the right direction.

Edited by What
Link to comment

I never used it, but I think I would prefer a simple multiline editbox instead of a listbox.

(ES_AUTOVSCROLL + ES_MULTILINE + WS_VSCROLL)

Then simply using lstrcat for adding text with 13,10 at the end.

Saving the whole stuff will be easier, too, coz you only got 1 string in the end.

Something like:

szInfoText db 'hello',0
sz_13_10 db 13,10,0invoke lstrcat,addr szLog,addr szInfoText
invoke lstrcat,addr szLog,addr sz_13_10
invoke SetDlgItemText,hWnd,IDC_EDITBOX,addr szLog
invoke SendDlgItemMessage,hWnd,IDC_EDITBOX,EM_LINESCROLL,0,7FFFFFFFh; for always seeing the last added line

Tho it might be kinda slow way, if the log's getting really huge...

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...