Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question.ani picture or animation control Pin
Chris Geddes10-Jan-12 1:45
Chris Geddes10-Jan-12 1:45 
QuestionRe: .ani picture or animation control Pin
Richard MacCutchan10-Jan-12 2:33
mveRichard MacCutchan10-Jan-12 2:33 
AnswerRe: .ani picture or animation control Pin
Albert Holguin10-Jan-12 3:44
professionalAlbert Holguin10-Jan-12 3:44 
GeneralRe: .ani picture or animation control Pin
Chris Geddes11-Jan-12 1:00
Chris Geddes11-Jan-12 1:00 
QuestionEmbedding a CDialog in a CMFCOutlookbar Pin
UrbanBlues9-Jan-12 11:16
UrbanBlues9-Jan-12 11:16 
AnswerRe: Embedding a CDialog in a CMFCOutlookbar Pin
«_Superman_»9-Jan-12 14:40
professional«_Superman_»9-Jan-12 14:40 
GeneralRe: Embedding a CDialog in a CMFCOutlookbar Pin
UrbanBlues10-Jan-12 7:01
UrbanBlues10-Jan-12 7:01 
QuestionProblem with resizing window Pin
blackbolek9-Jan-12 4:45
blackbolek9-Jan-12 4:45 
Hi all,

I have a problem when trying to resize main window of my application. I spent some time reserching possible solutions, but so for nothing works for me. I guess I make some basic mistake.
So - the code bellow is executed when user clicks on one of the buttons. I tried 3 different approaches to achieve it, everytime getting assertion error (looks to me like the window handle is invalid...)
My first approach:
C++
WINDOWPLACEMENT wpc;
CRect rc(0, 0, 0, 0);

    this->GetWindowRect(&rc);
    rc.right += 50;  // make it wider

    this->GetWindowPlacement (&wpc);
    wpc.rcNormalPosition = rc;
    this->SetWindowPlacement(&wpc);


Second approach:

C++
CRect rc(0, 0, 0, 0);

this->GetWindowRect(&rc);
rc.right += 50;

ScreenToClient( &rc );

    this->MoveWindow(rc);


and the third one:
C++
CRect rc(0, 0, 0, 0);

this->GetWindowRect(&rc);
rc.right += 50;

ScreenToClient( &rc );

this->SetWindowPos(this->m_hWnd, rc.left, rc.top, rc.Width(), rc.Height(), SWP_SHOWWINDOW);


The SetWindowPos() function doesn't return assertion error when I use this combination of flags: SWP_SHOWWINDOW|SWP_NOSIZE. However then it doesn't resize the window and it's useless for me.

I also checked than 'this' pointer is not corrupted by checking the
window text:
C++
char title[80];
		::GetWindowText (m_hWnd, title, sizeof(title));

It comes as I expect so I guess 'this' pointer itself is OK.
Any ideas?
QuestionRe: Problem with resizing window Pin
Albert Holguin9-Jan-12 4:58
professionalAlbert Holguin9-Jan-12 4:58 
AnswerRe: Problem with resizing window Pin
blackbolek9-Jan-12 10:01
blackbolek9-Jan-12 10:01 
AnswerRe: Problem with resizing window Pin
Albert Holguin9-Jan-12 10:18
professionalAlbert Holguin9-Jan-12 10:18 
GeneralRe: Problem with resizing window Pin
blackbolek9-Jan-12 22:01
blackbolek9-Jan-12 22:01 
GeneralRe: Problem with resizing window Pin
Albert Holguin10-Jan-12 3:27
professionalAlbert Holguin10-Jan-12 3:27 
GeneralRe: Problem with resizing window Pin
blackbolek9-Jan-12 23:30
blackbolek9-Jan-12 23:30 
GeneralRe: Problem with resizing window Pin
Richard MacCutchan10-Jan-12 2:31
mveRichard MacCutchan10-Jan-12 2:31 
GeneralRe: Problem with resizing window Pin
Albert Holguin10-Jan-12 3:29
professionalAlbert Holguin10-Jan-12 3:29 
GeneralRe: Problem with resizing window Pin
blackbolek10-Jan-12 20:52
blackbolek10-Jan-12 20:52 
GeneralRe: Problem with resizing window Pin
Albert Holguin11-Jan-12 7:55
professionalAlbert Holguin11-Jan-12 7:55 
AnswerRe: Problem with resizing window Pin
Richard MacCutchan9-Jan-12 5:50
mveRichard MacCutchan9-Jan-12 5:50 
GeneralRe: Problem with resizing window Pin
Albert Holguin9-Jan-12 7:26
professionalAlbert Holguin9-Jan-12 7:26 
GeneralRe: Problem with resizing window Pin
blackbolek9-Jan-12 10:14
blackbolek9-Jan-12 10:14 
AnswerRe: Problem with resizing window Pin
Luc Pattyn9-Jan-12 11:07
sitebuilderLuc Pattyn9-Jan-12 11:07 
GeneralRe: Problem with resizing window Pin
Richard MacCutchan9-Jan-12 21:19
mveRichard MacCutchan9-Jan-12 21:19 
QuestionTop level menu - Message on losing focus Pin
RavishB9-Jan-12 3:22
RavishB9-Jan-12 3:22 
AnswerRe: Top level menu - Message on losing focus Pin
Code-o-mat9-Jan-12 6:14
Code-o-mat9-Jan-12 6:14 

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.