Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiongetting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 6:41
Member 258447412-Sep-13 6:41 
SuggestionRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
David Crow12-Sep-13 16:10
David Crow12-Sep-13 16:10 
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 18:01
Member 258447412-Sep-13 18:01 
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 18:04
Member 258447412-Sep-13 18:04 
AnswerRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
jeron113-Sep-13 5:20
jeron113-Sep-13 5:20 
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447413-Sep-13 7:39
Member 258447413-Sep-13 7:39 
QuestionResizing Controls and Texts Pin
Don Guy11-Sep-13 14:00
Don Guy11-Sep-13 14:00 
AnswerRe: Resizing Controls and Texts Pin
digitalspace.xjtu11-Sep-13 15:02
digitalspace.xjtu11-Sep-13 15:02 
OnSize() method which respond to the change of windows could do this job

C++
// Resize the list control contained in the view to
// fill the entire view when the view's window is
// resized. CMyView is a CView derived class.
void CMyView::OnSize(UINT nType, int cx, int cy)
{
   CView::OnSize(nType, cx, cy);
   // Resize list to fill the whole view.
   m_List.MoveWindow (0, 0, cx, cy);
}


1. keep the original size of dialog, suppose Old_width is original width of dialog. We also deal with the height like this

2. use GetWindowRect( LPRECT lpRect ), which Copies the dimensions of the bounding rectangle of the CWnd object to the structure pointed to by lpRect. From it
you get New_Width (it is new width of dialog now)

3. calculate rate = Old_width/ New_Width .

4. use
C++
CWnd* GetDlgItem(
   int nID
) const;

to get pointer(suppose ptr) of button or other control,
use ptr->GetWindowRect( BtnRect ) to get boundary rect of button ( or other ..)
calculate new rect of button( suppose new_btn_rect ) through rate and BtnRect (the height also shoud be consided)

5. use ptr->MoveWindows(new_btn_rect ) to move button and change its size
AnswerRe: Resizing Controls and Texts Pin
SoMad11-Sep-13 17:16
professionalSoMad11-Sep-13 17:16 
QuestionWhat is doscreatemutexsem Pin
Carl Cioffi11-Sep-13 9:57
Carl Cioffi11-Sep-13 9:57 
QuestionRe: What is doscreatemutexsem Pin
David Crow11-Sep-13 10:33
David Crow11-Sep-13 10:33 
AnswerRe: What is doscreatemutexsem Pin
Carl Cioffi12-Sep-13 3:20
Carl Cioffi12-Sep-13 3:20 
GeneralRe: What is doscreatemutexsem Pin
David Crow12-Sep-13 3:36
David Crow12-Sep-13 3:36 
GeneralRe: What is doscreatemutexsem Pin
Carl Cioffi12-Sep-13 3:55
Carl Cioffi12-Sep-13 3:55 
QuestionRun MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 6:53
Andraw11110-Sep-13 6:53 
AnswerRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 7:58
Alan Balkany10-Sep-13 7:58 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 8:20
Andraw11110-Sep-13 8:20 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 8:23
Alan Balkany10-Sep-13 8:23 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 11:11
Andraw11110-Sep-13 11:11 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 11:39
Alan Balkany10-Sep-13 11:39 
AnswerRe: Run MFC Program Without Dialog Showing Pin
Richard MacCutchan10-Sep-13 10:42
mveRichard MacCutchan10-Sep-13 10:42 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 11:13
Andraw11110-Sep-13 11:13 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Richard MacCutchan10-Sep-13 11:31
mveRichard MacCutchan10-Sep-13 11:31 
GeneralRe: Run MFC Program Without Dialog Showing Pin
digitalspace.xjtu10-Sep-13 22:50
digitalspace.xjtu10-Sep-13 22:50 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Freak3010-Sep-13 23:21
Freak3010-Sep-13 23:21 

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.