Click here to Skip to main content
15,914,924 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: int array problem Pin
Mark Salsbery16-May-07 6:48
Mark Salsbery16-May-07 6:48 
AnswerRe: int array problem Pin
CPallini16-May-07 9:31
mveCPallini16-May-07 9:31 
AnswerRe: int array problem Pin
John R. Shaw16-May-07 22:34
John R. Shaw16-May-07 22:34 
QuestionAES encryption for steaming data for Windows Mobile 5.0 Pin
gauravzhere16-May-07 4:27
gauravzhere16-May-07 4:27 
AnswerRe: AES encryption for steaming data for Windows Mobile 5.0 Pin
JudyL_MD16-May-07 10:18
JudyL_MD16-May-07 10:18 
GeneralRe: AES encryption for steaming data for Windows Mobile 5.0 Pin
gauravzhere17-May-07 23:36
gauravzhere17-May-07 23:36 
GeneralRe: AES encryption for steaming data for Windows Mobile 5.0 Pin
newbiesworld8-Feb-10 5:39
newbiesworld8-Feb-10 5:39 
QuestionWhy does SetWindowPos called with original ClientCoordinates move the window? Pin
Chilli7116-May-07 4:26
Chilli7116-May-07 4:26 
I've a tab control inside a Dialog that I would like to resize.
After getting unexpected results I created this sample code:
GetWindowRect(&Screen1);
Client1 = Screen1;
ScreenToClient(&Client1);
GetClientRect(&m_ClientRect);
SetWindowPos(NULL, m_ClientRect.left, m_ClientRect.top, m_ClientRect.right, m_ClientRect.bottom, SWP_NOCOPYBITS || SWP_NOOWNERZORDER || SWP_NOREDRAW);
GetWindowRect(&Screen2);
GetClientRect(&Client2);
Result:
Screen1		{top=0x000001ca bottom=0x000002ef left=0x00000253 right=0x0000035e}
Screen2		{top=0x000001c5 bottom=0x000002ea left=0x000001be right=0x000002c9}
Client1		{top=0x00000000 bottom=0x00000125 left=0x00000000 right=0x0000010b}
Client2		{top=0x00000000 bottom=0x00000125 left=0x00000000 right=0x0000010b}
m_ClientRect	{top=0x00000000 bottom=0x00000125 left=0x00000000 right=0x0000010b}

Getting the window pos (Screen1) and converting to Client Pos (Client1) gives the same result like directly retriving the client position (m_ClientRect).
Also getting the client position after the SetWindowPos (Client2) gives the same results like before.
Nevertheless the window has moved since the screen coordinates before/after calling SetWindowPos (Screen1/Screen2) are totally different.

Where does this behaviour come from, what can I do to avoid it?

Regards
Leo
AnswerRe: Why does SetWindowPos called with original ClientCoordinates move the window? Pin
Hans Dietrich16-May-07 4:37
mentorHans Dietrich16-May-07 4:37 
GeneralRe: Why does SetWindowPos called with original ClientCoordinates move the window? Pin
Chilli7116-May-07 8:50
Chilli7116-May-07 8:50 
GeneralRe: Why does SetWindowPos called with original ClientCoordinates move the window? Pin
Hans Dietrich16-May-07 9:09
mentorHans Dietrich16-May-07 9:09 
GeneralRe: Why does SetWindowPos called with original ClientCoordinates move the window? Pin
Chilli7117-May-07 7:53
Chilli7117-May-07 7:53 
AnswerSolution Pin
Chilli717-Jun-07 20:07
Chilli717-Jun-07 20:07 
QuestionAbout Tetris game Pin
Mojtaba Karimi16-May-07 4:22
Mojtaba Karimi16-May-07 4:22 
AnswerRe: About Tetris game Pin
ajitatif angajetor16-May-07 4:35
ajitatif angajetor16-May-07 4:35 
AnswerRe: About Tetris game Pin
CPallini16-May-07 9:36
mveCPallini16-May-07 9:36 
QuestionCatching Key Event of an Edit Box Pin
ajitatif angajetor16-May-07 3:49
ajitatif angajetor16-May-07 3:49 
AnswerRe: Catching Key Event of an Edit Box Pin
led mike16-May-07 5:13
led mike16-May-07 5:13 
GeneralRe: Catching Key Event of an Edit Box Pin
ajitatif angajetor16-May-07 6:34
ajitatif angajetor16-May-07 6:34 
GeneralRe: Catching Key Event of an Edit Box Pin
malaugh16-May-07 8:58
malaugh16-May-07 8:58 
Questionstatic text box , GetClientRect, GetTextExtent [modified] Pin
daveyerwin16-May-07 3:34
daveyerwin16-May-07 3:34 
AnswerRe: static text box , GetClientRect, GetTextExtent Pin
shivditya16-May-07 4:55
shivditya16-May-07 4:55 
AnswerRe: static text box , GetClientRect, GetTextExtent Pin
Mark Salsbery16-May-07 5:21
Mark Salsbery16-May-07 5:21 
GeneralRe: static text box , GetClientRect, GetTextExtent Pin
daveyerwin16-May-07 7:50
daveyerwin16-May-07 7:50 
GeneralRe: static text box , GetClientRect, GetTextExtent [modified] Pin
Mark Salsbery16-May-07 8:24
Mark Salsbery16-May-07 8:24 

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.