News:

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

How in the world do you...

Started by Liquibyte, August 08, 2005, 02:34:02 AM

Previous topic - Next topic

Liquibyte

Obviously it is useless to ask anything about WM_NCPAINT in any assembler community and expect any kind of useful information.

hutch--

Hi,

Try this idea out, whenever you return the default behaviour in a WndProc you get a default Windows repaint so when you use the WM_NCxxxx messages you may have to perform the action yourself then exit with zero instead of default. There is another area to try out, when for example you use a WM_NCHITTEST, you call the default window proc API and check the return value.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

hitchhikr

What about this:


invoke RedrawWindow, hWnd, 0, 0, RDW_ERASE or RDW_INVALIDATE


Or using InvalidateRect.

hitchhikr

Well i guess you'll have to define precisely what a "WM_NCPAINT'ed application" means for you.

hitchhikr

You should have started by posting the code directly.


.if wParam == FALSE
   invoke DefWindowProc, hWnd, uMsg, wParam, lParam
   mov eax,TRUE
   ret
.endif


I don't see why sizey is added to y, since it's not in the original code:


invoke GetSystemMetrics,SM_CYSIZE
add eax,sizey
mov rect.bottom,eax



y = GetSystemMetrics( SM_CYFRAME );


Also:


SetBkColor( hDC, GetSysColor(COLOR_ACTIVECAPTION) );
DrawText( hDC, (LPSTR)"Left Justified Caption", -1, (LPRECT)&rc1, DT_LEFT );


should be translated as:


invoke GetSysColor, COLOR_ACTIVECAPTION
invoke SetBkColor, hDC, eax
invoke DrawText, hDC, addr title, -1, addr rect, DT_LEFT


Notice that there's no break statement before the case WM_NCPAINT:, if it is intentional then this event is triggered 2 times (1 one in the WM_NCACTIVATE when wParam is TRUE & one time when actually recieving the WM_NCPAINT message itself).