Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help Needed for getting record from database Pin
Y_Kaushik19-Dec-07 19:22
Y_Kaushik19-Dec-07 19:22 
GeneralRe: Help Needed for getting record from database Pin
Roger Broomfield19-Dec-07 19:41
Roger Broomfield19-Dec-07 19:41 
GeneralRe: Help Needed for getting record from database Pin
Y_Kaushik19-Dec-07 19:53
Y_Kaushik19-Dec-07 19:53 
GeneralRe: Help Needed for getting record from database Pin
Y_Kaushik19-Dec-07 20:01
Y_Kaushik19-Dec-07 20:01 
GeneralRe: Help Needed for getting record from database Pin
Y_Kaushik19-Dec-07 20:36
Y_Kaushik19-Dec-07 20:36 
QuestionNeed help with restricting window movement to the screen... Pin
demxine19-Dec-07 16:35
demxine19-Dec-07 16:35 
GeneralRe: Need help with restricting window movement to the screen... Pin
Maxwell Chen19-Dec-07 16:45
Maxwell Chen19-Dec-07 16:45 
QuestionRe: Need help with restricting window movement to the screen... [modified] Pin
demxine19-Dec-07 19:47
demxine19-Dec-07 19:47 
I've used OnWindowPosChanging already and my code looks like this:

void CSnapDialog::OnWindowPosChanging( WINDOWPOS* lpwndpos )
{
int m_EdgeSnapGap = 1;

RECT rcScrn;
SystemParametersInfo (SPI_GETWORKAREA, 0, &rcScrn, 0);

//Snap X axis
if (abs(lpwndpos->x - rcScrn.left) <= m_EdgeSnapGap)
{
lpwndpos->x = rcScrn.left;
//???
//Code is needed here to prevent window from drifting
//outside the left edge of visible screen
}
else if (abs(lpwndpos->x + lpwndpos->cx - rcScrn.right) <= m_EdgeSnapGap)
{
lpwndpos->x = rcScrn.right - lpwndpos->cx;
//???
//Code is needed here to prevent window from drifting
//outside the right edge of the visible screen
}

//Snap Y axis
if (abs(lpwndpos->y - rcScrn.top) <= m_EdgeSnapGap)
{
lpwndpos->y = rcScrn.top;
//???
//Code is needed here to prevent window from drifting
//outside the top edge of the visible screen
}
else if (abs(lpwndpos->y + lpwndpos->cy - rcScrn.bottom) <= m_EdgeSnapGap)
{
lpwndpos->y = rcScrn.bottom - lpwndpos->cy;
//???
//Code is needed here to prevent window from drifting
//outside the bottom edge of the visible screen
}
}

Can anyone help me on what code I should supply to make this work correctly?
<div class="ForumMod">modified on Thursday, December 20, 2007 2:01:10 AM</div>
GeneralFake Memory Leak!! Pin
Lea Hayes19-Dec-07 16:06
Lea Hayes19-Dec-07 16:06 
GeneralRe: Fake Memory Leak!! [modified] Pin
Maxwell Chen19-Dec-07 16:34
Maxwell Chen19-Dec-07 16:34 
GeneralRe: Fake Memory Leak!! Pin
Lea Hayes19-Dec-07 21:14
Lea Hayes19-Dec-07 21:14 
GeneralRe: Fake Memory Leak!! Pin
Roger Broomfield19-Dec-07 17:09
Roger Broomfield19-Dec-07 17:09 
GeneralRe: Fake Memory Leak!! Pin
Lea Hayes19-Dec-07 22:02
Lea Hayes19-Dec-07 22:02 
GeneralDestroy/Close the window Pin
CodingLover19-Dec-07 14:21
CodingLover19-Dec-07 14:21 
GeneralRe: Destroy/Close the window Pin
CodingLover19-Dec-07 17:54
CodingLover19-Dec-07 17:54 
GeneralRe: Destroy/Close the window Pin
Mark Salsbery20-Dec-07 6:01
Mark Salsbery20-Dec-07 6:01 
GeneralRe: Destroy/Close the window Pin
CodingLover31-Dec-07 17:41
CodingLover31-Dec-07 17:41 
GeneralRe: Destroy/Close the window Pin
Mark Salsbery2-Jan-08 7:58
Mark Salsbery2-Jan-08 7:58 
QuestionHow to know Project type Pin
s196675m19-Dec-07 14:00
s196675m19-Dec-07 14:00 
AnswerRe: How to know Project type Pin
Hamid_RT19-Dec-07 18:06
Hamid_RT19-Dec-07 18:06 
Generalgdiplusimaging.h error Pin
Anthony Appleyard19-Dec-07 11:54
Anthony Appleyard19-Dec-07 11:54 
GeneralRe: gdiplusimaging.h error Pin
Mark Salsbery20-Dec-07 6:38
Mark Salsbery20-Dec-07 6:38 
Questionoperator &lt;&lt; inherited? Pin
Budric B.19-Dec-07 11:48
Budric B.19-Dec-07 11:48 
AnswerRe: operator &lt;&lt; inherited? Pin
Lea Hayes19-Dec-07 16:15
Lea Hayes19-Dec-07 16:15 
GeneralRe: operator &lt;&lt; inherited? Pin
Budric B.20-Dec-07 4:53
Budric B.20-Dec-07 4:53 

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.