News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Remove window styles

Started by ragdog, January 25, 2014, 11:38:56 PM

Previous topic - Next topic

ragdog

Hello

I have a window style with WS_THICKFRAME and WS_WS_SIZEBOX
Now wish i remove via code this styles

       invoke  GetWindowLong, hWnd, GWL_STYLE 
       mov  ebx,WS_SIZEBOX
       not ebx
   and eax,ebx
       invoke  SetWindowLong, hWnd, GWL_STYLE, eax 

       xor     eax,eax
      invoke  SetWindowPos,hWnd,eax,eax,eax,eax,eax,SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_FRAMECHANGED or SWP_SHOWWINDOW



Must i use SetwindowPos or gives a better Api for it?


If I do not use SetWindowPos and I move the window  have a white frame on the dialog :(

Ok i can change it in the resource but i wish it with code

hutch--

What happens if you just set the window style completely with SetWindowLong() then issue a repaint ?

dedndave

if you change the frame, you should call SetWindowPos

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545%28v=vs.85%29.aspx

QuoteIf you have changed certain window data using SetWindowLong, you must call
SetWindowPos for the changes to take effect. Use the following combination for
uFlags: SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED.