News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Edit box, with multiple line and color

Started by hfheatherfox07, July 24, 2011, 02:07:03 AM

Previous topic - Next topic

hfheatherfox07

Hi  I created an Edit box, with multiple line and color , does anybody know why when I press"Backspace" the cursor just moves back instead of deleting ...

Also How to delete the whole screen like in Console app I need to be able to delete all the text with a button or hotkey

xandaz

    relative to the fact that backspace just moves backwords you must remind that you used TRANSPARENT as BkMode. You should use opaque and EM_SETCHARFORMAT for the colors. To delete the whole text send a WM_SETTEXT with a null string usually works.
    Hope it was helpful

xandaz

   correction.... you dont really need to use bkmode in edit controils ...

bomz

invoke SetWindowLong,hwnD,GWL_WNDPROC,addr NewEditProc

hfheatherfox07

Thank you , I will try this tonight .... :U

hfheatherfox07

Quote from: xandaz on July 24, 2011, 04:06:53 PM
    relative to the fact that backspace just moves backwords you must remind that you used TRANSPARENT as BkMode. You should use opaque and EM_SETCHARFORMAT for the colors. To delete the whole text send a WM_SETTEXT with a null string usually works.
    Hope it was helpful

What this did for me was to have only 1 line that is the background color and the text color that I want ?

hfheatherfox07

Quote from: bomz on July 24, 2011, 04:10:25 PM
invoke SetWindowLong,hwnD,GWL_WNDPROC,addr NewEditProc

This crashes my app :(

Gunner

Do you know why it crashed your app?  Did you lookup SetWindowLong and see what the WNDPROC flag makes it return?

You are telling Windows to use NewEditProc as the new callback for that control - did you create that proc the same way other window msg handler callbacks are created?

2 - bomz left out one important thing - SetWindowLong returns the address of the original proc for that control that you MUST save, and in the new proc you MUST use that address with CallDefProc (something like that) for ALL messages not handled...
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com