The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Liquibyte on August 08, 2005, 02:34:02 AM

Title: How in the world do you...
Post by: Liquibyte on August 08, 2005, 02:34:02 AM
Obviously it is useless to ask anything about WM_NCPAINT in any assembler community and expect any kind of useful information.
Title: Re: How in the world do you...
Post by: hutch-- on August 08, 2005, 08:04:15 AM
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.
Title: Re: How in the world do you...
Post by: hitchhikr on August 08, 2005, 12:35:40 PM
What about this:


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


Or using InvalidateRect.
Title: Re: How in the world do you...
Post by: hitchhikr on August 09, 2005, 01:59:59 AM
Well i guess you'll have to define precisely what a "WM_NCPAINT'ed application" means for you.
Title: Re: How in the world do you...
Post by: hitchhikr on August 11, 2005, 12:45:49 PM
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).