Click here to Skip to main content
16,013,747 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple template function question? Pin
Rutger Ellen29-May-02 3:36
Rutger Ellen29-May-02 3:36 
GeneralRe: Simple template function question? Pin
30-May-02 16:12
suss30-May-02 16:12 
GeneralMAKEWPARAM Pin
Arjan Schouten28-May-02 21:41
Arjan Schouten28-May-02 21:41 
GeneralRe: MAKEWPARAM Pin
Arjan Schouten28-May-02 23:23
Arjan Schouten28-May-02 23:23 
GeneralRe: MAKEWPARAM Pin
Mike Nordell28-May-02 23:40
Mike Nordell28-May-02 23:40 
GeneralRe: MAKEWPARAM Pin
Alex Cramer29-May-02 0:01
Alex Cramer29-May-02 0:01 
GeneralRe: MAKEWPARAM Pin
Arjan Schouten29-May-02 0:05
Arjan Schouten29-May-02 0:05 
Generalsize and position of a control like a button or static text. Pin
aldeba28-May-02 21:26
aldeba28-May-02 21:26 
How do i get the size of a button or a static text.
Assuming i have a class that is a subclass or a button/static text.

I can get the size of this control by GetWindowRect let's say in OnPaint();
But the position returned by the GetWindowRect in OnPaint gives the position and size
according to the actual whole screen.

How can i get the position and size relative to the dialog box?

void CMyButton::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetWindowRect(&rect);
// Do not call CButton::OnPaint() for painting messages
}

CMyButton is a subclass of CButton.

The purpose of this is to create a control that has a size determined by metric like mm rather than pixel. Thus making the control look the same size on all resolution.

Anyone? being looking around for the proper command.
Thanxs a billion in advance

GeneralRe: size and position of a control like a button or static text. Pin
Eugene Pustovoyt28-May-02 21:36
Eugene Pustovoyt28-May-02 21:36 
GeneralRe: size and position of a control like a button or static text. Pin
Mike Nordell28-May-02 21:33
Mike Nordell28-May-02 21:33 
GeneralRe: size and position of a control like a button or static text. Pin
Joaquín M López Muñoz28-May-02 21:42
Joaquín M López Muñoz28-May-02 21:42 
GeneralRe: size and position of a control like a button or static text. Pin
aldeba28-May-02 21:58
aldeba28-May-02 21:58 
GeneralRe: size and position of a control like a button or static text. Pin
Mike Nordell28-May-02 22:51
Mike Nordell28-May-02 22:51 
GeneralRe: size and position of a control like a button or static text. Pin
aldeba30-May-02 0:45
aldeba30-May-02 0:45 
GeneralConverting from CString to std::string Pin
Poul Haahr Klemmensen28-May-02 20:33
Poul Haahr Klemmensen28-May-02 20:33 
GeneralRe: Converting from CString to std::string Pin
Joaquín M López Muñoz28-May-02 20:49
Joaquín M López Muñoz28-May-02 20:49 
GeneralRe: Converting from CString to std::string Pin
Bernhard28-May-02 20:56
Bernhard28-May-02 20:56 
GeneralRe: Converting from CString to std::string Pin
Poul Haahr Klemmensen29-May-02 7:17
Poul Haahr Klemmensen29-May-02 7:17 
GeneralPublic-Private key encryption alternatives Pin
Nish Nishant28-May-02 20:15
sitebuilderNish Nishant28-May-02 20:15 
GeneralRe: Public-Private key encryption alternatives Pin
Joaquín M López Muñoz28-May-02 20:20
Joaquín M López Muñoz28-May-02 20:20 
GeneralRe: Public-Private key encryption alternatives Pin
Nish Nishant28-May-02 21:26
sitebuilderNish Nishant28-May-02 21:26 
GeneralPGP anyone Pin
Nish Nishant28-May-02 20:12
sitebuilderNish Nishant28-May-02 20:12 
GeneralRe: PGP anyone Pin
markkuk28-May-02 22:25
markkuk28-May-02 22:25 
GeneralRe: PGP anyone Pin
Nish Nishant29-May-02 0:49
sitebuilderNish Nishant29-May-02 0:49 
GeneralRemove Systray Icon Pin
Derick Cyril Thomas28-May-02 19:58
Derick Cyril Thomas28-May-02 19:58 

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.