News:

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

reusing the wordpad

Started by ToutEnMasm, April 27, 2009, 08:26:32 AM

Previous topic - Next topic

ToutEnMasm


This example run the wordpad
           - extract the handle of the richedit
           - use the handle to write some text in it
Then he try to select the text and get the charformat.
This failed,it seems there is some memory problems.
Who can help ?




[attachment deleted by admin]

dedndave

look at it with olly and see what the "sizeof" operator is yielding

   mov commun.defautcharformat.cbSize,sizeof CHARFORMAT2
   mov commun.charformat.cbSize,sizeof CHARFORMAT2

ToutEnMasm


the more simple case to solve is the text selection.
Quote
   mov commun.charrange.cpMin,0
   mov commun.charrange.cpMax,-1
   invoke SendMessage,Hredit,EM_SETSEL,0,-1
   ;invoke SendMessage,Hredit,EM_EXSETSEL,NULL,addr commun.charrange
As a alternate soluce,i used the EM_SETSEL message (Edit message) that work.
The EM_EXSETSEL failed with no visible reason and there isn't problem with unicode and the size of the structure.
Size of  charformat2 is 9C







dedndave

glad you got it running  :U
i mentioned the sizeof operator because i had seen a number of other posts regarding sizeof problems