modify style window
-
hello, How can i modify style of child window, i use
pChild->ModifyStyle(0,WS_THICKFRAME,SWP_NOMOVE | SWP_NOSIZE );
but the window haven't resizable border. you know how to do this ? thx in advance
does the window have WS_DLGFRAME style also? if it does, i think you will have to remove it. some window styles cannot be used together. also, for some styles you have to call SetWindowPos() after ModifyStyle(), to make them active (IIRC, ES_READONLY for edit controls ,etc)
-
does the window have WS_DLGFRAME style also? if it does, i think you will have to remove it. some window styles cannot be used together. also, for some styles you have to call SetWindowPos() after ModifyStyle(), to make them active (IIRC, ES_READONLY for edit controls ,etc)
thx Zed my window doesn't have
WS_DLGFRAME
. I have a little problem withSetWindowPos()
:pChild->SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
after SetWindowPos my window has resizable borders, but i put the flagsSWP_NOMOVE
but my view move and it does not remain where it was. So i would like to get border without callSetWindowPos
it isn't posible ?:confused: -
thx Zed my window doesn't have
WS_DLGFRAME
. I have a little problem withSetWindowPos()
:pChild->SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
after SetWindowPos my window has resizable borders, but i put the flagsSWP_NOMOVE
but my view move and it does not remain where it was. So i would like to get border without callSetWindowPos
it isn't posible ?:confused:jeremysay wrote: So i would like to get border without call SetWindowPosit isn't posible ? i'm not sure the problem is that SWP_FRAMECHANGED flags resulst in WM_NCCALCSIZE being sent to window, which forces the window to change its size. maybe you can add SWP_NOREDRAW flag which will defer repainting, and then call MoveWindow() to resize the window to its previous size. i'm not sure if this will work, but you can try
-
jeremysay wrote: So i would like to get border without call SetWindowPosit isn't posible ? i'm not sure the problem is that SWP_FRAMECHANGED flags resulst in WM_NCCALCSIZE being sent to window, which forces the window to change its size. maybe you can add SWP_NOREDRAW flag which will defer repainting, and then call MoveWindow() to resize the window to its previous size. i'm not sure if this will work, but you can try
thx Zed for your help ! Zed wrote: maybe you can add SWP_NOREDRAW flag which will defer repainting, and then call MoveWindow() to resize the window to its previous size. i'm not sure if this will work, but you can try before call ModifyStyle ,i moved the view with ScrollWindow, there is a possibility to get "window scrolling" position (and not use GetScrollPos for scrollbar) ? thx again Zed
-
thx Zed for your help ! Zed wrote: maybe you can add SWP_NOREDRAW flag which will defer repainting, and then call MoveWindow() to resize the window to its previous size. i'm not sure if this will work, but you can try before call ModifyStyle ,i moved the view with ScrollWindow, there is a possibility to get "window scrolling" position (and not use GetScrollPos for scrollbar) ? thx again Zed
GetScrollInfo(), but i'm not quiter sure what are you trying to achieve. can you post some more details?
-
GetScrollInfo(), but i'm not quiter sure what are you trying to achieve. can you post some more details?
in fact i scroll the view without use the scrollbar. when i click in the view and move my mouse i do :
if (pMsg->message == WM_MOUSEMOVE) ) { if (pMsg->wParam & VK_LBUTTON) { POINT Point = pMsg->pt; long ScrollX = Point.x - m_Point.x; long ScrollY = Point.y - m_Point.y; ScrollWindow(-ScrollX,-ScrollY); m_pPoint = Point } }
so i move my view and i don't know really its coordinates. when i use :
pChild->SetWindowPos(NULL, 0, 0, 0, 0,SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
my view loose its scrolling, so i want to know its coordinate before
SetWindowPos
. Or get a way to put the sizable border without useSetWindowPos
. have you any idea ? -
in fact i scroll the view without use the scrollbar. when i click in the view and move my mouse i do :
if (pMsg->message == WM_MOUSEMOVE) ) { if (pMsg->wParam & VK_LBUTTON) { POINT Point = pMsg->pt; long ScrollX = Point.x - m_Point.x; long ScrollY = Point.y - m_Point.y; ScrollWindow(-ScrollX,-ScrollY); m_pPoint = Point } }
so i move my view and i don't know really its coordinates. when i use :
pChild->SetWindowPos(NULL, 0, 0, 0, 0,SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
my view loose its scrolling, so i want to know its coordinate before
SetWindowPos
. Or get a way to put the sizable border without useSetWindowPos
. have you any idea ?i'm not sure if i correctly understood the relationship between the view and pChild. is that the same window or are they parent-child? if the view is scrolled only from your code, maybe you can accumulate ScrollX and ScrollY in every WM_MOUSEMOVE handler call and thus have the total ammount by which the view was scrolled, so you can use that (i'm just guessing here).
-
i'm not sure if i correctly understood the relationship between the view and pChild. is that the same window or are they parent-child? if the view is scrolled only from your code, maybe you can accumulate ScrollX and ScrollY in every WM_MOUSEMOVE handler call and thus have the total ammount by which the view was scrolled, so you can use that (i'm just guessing here).
Zed wrote: is that the same window or are they parent-child? pChild is the parent child. Zed wrote: if the view is scrolled only from your code, maybe you can accumulate ScrollX and ScrollY in every WM_MOUSEMOVE handler call and thus have the total ammount by which the view was scrolled, so you can use that (i'm just guessing here). OK thx, i'll go to do this, i hoped there was a "function" like GetScrollWindow"....but no. thx Zed for you help!