Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to detect full-screen window? Pin
Steve Echols21-Sep-06 17:59
Steve Echols21-Sep-06 17:59 
GeneralRe: How to detect full-screen window? Pin
jipai21-Sep-06 22:13
jipai21-Sep-06 22:13 
QuestionKeeping window within boundry, win32 sdk [modified] Pin
beeejay21-Sep-06 16:19
beeejay21-Sep-06 16:19 
AnswerRe: Keeping window within boundry, win32 sdk Pin
Nibu babu thomas21-Sep-06 17:24
Nibu babu thomas21-Sep-06 17:24 
GeneralRe: Keeping window within boundry, win32 sdk Pin
beeejay21-Sep-06 17:34
beeejay21-Sep-06 17:34 
GeneralRe: Keeping window within boundry, win32 sdk Pin
Nibu babu thomas21-Sep-06 17:43
Nibu babu thomas21-Sep-06 17:43 
GeneralRe: Keeping window within boundry, win32 sdk Pin
beeejay21-Sep-06 17:56
beeejay21-Sep-06 17:56 
GeneralRe: Keeping window within boundry, win32 sdk Pin
Nibu babu thomas21-Sep-06 18:23
Nibu babu thomas21-Sep-06 18:23 
beeejay wrote:
OK it doesn't look like there is an OnMoving function within the SDK.


Heh, when did I say that Big Grin | :-D . I was just calling that function when the event WM_MOVING happens, in order to isolate the code.


beeejay wrote:
would your program function the same way if you were just to paste the contents of your method into the WM_MOVING case?


It won't. As I said you will have to convert MFC to SDK.

For eg: GetParent( hWndChild );

Anyway here is the SDK code and don't tell me again it doesn't work...;)

case WM_MOVING:
        {
            LPRECT lpRect = ( LPRECT )lParam;

            static RECT rcPreviousCoords = *lpRect;
            
            // Get parent window
            HWND pParentWnd = ::GetParent( hWnd );
            
            if( !pParentWnd )
                break ;
            
            RECT crParentRect;
            ::GetClientRect( pParentWnd, &crParentRect );
            ::ClientToScreen(pParentWnd, (LPPOINT)&crParentRect);
	    ::ClientToScreen(pParentWnd, ((LPPOINT)&crParentRect)+1);
            
            if( lpRect->left <= crParentRect.left || lpRect->right >= crParentRect.right )
            {
                lpRect->left = rcPreviousCoords.left;
                lpRect->right = rcPreviousCoords.right;
            }
            else
            {
                rcPreviousCoords.left = lpRect->left;
                rcPreviousCoords.right = lpRect->right;
            }
            
            if( lpRect->top <= crParentRect.top || lpRect->bottom >= crParentRect.bottom )
            {
                lpRect->top = rcPreviousCoords.top;
                lpRect->bottom = rcPreviousCoords.bottom;
            }
            else
            {
                rcPreviousCoords.top = lpRect->top;
                rcPreviousCoords.bottom = lpRect->bottom;
            }

            return TRUE;
        }



Nibu thomas
A Developer

Programming tips[^]  My site[^]

GeneralRe: Keeping window within boundry, win32 sdk Pin
beeejay21-Sep-06 18:34
beeejay21-Sep-06 18:34 
GeneralRe: Keeping window within boundry, win32 sdk Pin
Nibu babu thomas21-Sep-06 18:36
Nibu babu thomas21-Sep-06 18:36 
GeneralRe: Keeping window within boundry, win32 sdk Pin
beeejay21-Sep-06 18:47
beeejay21-Sep-06 18:47 
GeneralRe: Keeping window within boundry, win32 sdk Pin
Nibu babu thomas21-Sep-06 19:03
Nibu babu thomas21-Sep-06 19:03 
QuestionComposite Control Info Pin
Demian Panello21-Sep-06 16:14
Demian Panello21-Sep-06 16:14 
AnswerRe: Composite Control Info Pin
Rick York21-Sep-06 16:45
mveRick York21-Sep-06 16:45 
AnswerRe: Composite Control Info Pin
Hamid_RT21-Sep-06 18:41
Hamid_RT21-Sep-06 18:41 
QuestionWarning messages Pin
dacky21-Sep-06 15:36
dacky21-Sep-06 15:36 
AnswerRe: Warning messages Pin
Stephen Hewitt21-Sep-06 16:03
Stephen Hewitt21-Sep-06 16:03 
GeneralRe: Warning messages Pin
dacky21-Sep-06 16:13
dacky21-Sep-06 16:13 
QuestionMoving VC7 app to VC8 Pin
paulb21-Sep-06 12:46
paulb21-Sep-06 12:46 
AnswerRe: Moving VC7 app to VC8 Pin
Christian Graus21-Sep-06 12:52
protectorChristian Graus21-Sep-06 12:52 
Questionweb application in vc++.net Pin
sandeep_thakur21-Sep-06 11:05
sandeep_thakur21-Sep-06 11:05 
AnswerRe: web application in vc++.net Pin
Christian Graus21-Sep-06 11:34
protectorChristian Graus21-Sep-06 11:34 
Questionhow to prevent a file from being opened? Pin
sundar15621-Sep-06 10:58
sundar15621-Sep-06 10:58 
AnswerRe: how to prevent a file from being opened? Pin
Christian Graus21-Sep-06 11:36
protectorChristian Graus21-Sep-06 11:36 
GeneralRe: how to prevent a file from being opened? Pin
sundar15621-Sep-06 12:13
sundar15621-Sep-06 12:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.