News:

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

about Iczelion tut12

Started by Farbis, April 26, 2008, 01:55:25 PM

Previous topic - Next topic

Farbis

Bonjour, please could you help me ?
There's something in tut12 Iczelion i would like to change:

when i open a  text file, the size of main window is "smaller" than whole text file.So only a part of the text appears
in the main window.
I understand that size of main window are "brought,recovered" in this section:

.ELSEIF uMsg==WM_SIZE
        mov eax,lParam
        mov edx,eax
        shr edx,16
        and eax,0ffffh
        invoke MoveWindow,hwndEdit,0,0,eax,edx,TRUE

Is there a way to udpdate the main window size with the size of the text file?
And so, the whole text appears in the main window.

Thanks for help. :wink

MichaelW

The WM_SIZE handler is sizing the edit control to fit the client area of the window whenever the window is resized. Since you cannot make the window large enough to fit most text files, I think it would probably make more sense to increase the size, currently 300x200, in WinMain, and then add the WS_HSCROLL and WS_VSCROLL styles to the CreateWindowEx call that creates the edit control. You would then be able to position the text file within the edit control. It would be possible to determine the area that the file would occupy within the edit control, and resize the window to fit, if possible, but doing so would require some moderately complex code.
eschew obfuscation

Farbis

Thanks MichaelW, i thought there was an easy way to do it.
Now, it works. :bg