[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Retrieve Size of ActiveX

Posted on 2006-04-28
5
Medium Priority
?
173 Views
Last Modified: 2013-11-20
So I am creating an ActiveX which basically creates a CListCtrl inside of it.  So when the person selects my ActiveX and draw's the 'square' that places the activeX into it, I am interested in knowing those dimensions so I can find size my CListCtrl appropriately inside of this.

Thanks,
0
Comment
Question by:cophi
  • 3
  • 2
5 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 2000 total points
ID: 16562683
CRect rc;
GetWindowRect(&rc);

rc.Width() - width
rc.Height() - height

and rc.left, rc.top give the co-ordinates in SCREEN co-ordinates
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16562691
WINDOWPLACEMENT wndPlacement;

// Get the current position
m_ActiveXControl.GetWindowPlacement(&wndPlacement);

now you may use like wndPlacement.ptMinPosition.x, wndPlacement.ptMinPosition.y,wndPlacement.ptMaxPosition.x, wndPlacement.ptMaxPosition.y to get dimensions.


MAHESH



0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16562702
m_lstCtrl.SetWindowPos(NULL, 0, 0, width, height, SWP_NOZORDER);
That should position the list control at 0, 0 in the parent and with the width and height you specify.
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16562742
WINDOWPLACEMENT wndPlacement;

// Get the current position
m_ActiveXControl.GetWindowPlacement(&wndPlacement);


 int nWidth = 400;    // substitute your new width
 int nHeigth = 200;    // substitute your new height


 m_ActiveXControl.MoveWindow ( wndPlacement.ptMinPosition.x, wndPlacement.ptMinPosition.y,
      nWidth,  nHeigth);


MAHESH
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16563069

WINDOWPLACEMENT wndPlacement;


// Get the current position
m_ActiveXControl.GetWindowPlacement(&wndPlacement);


 int nWidth = 400;    // substitute your new width
 int nHeigth = 200;    // substitute your new height


 m_ActiveXControl.MoveWindow (
      wndPlacement.rcNormalPosition.left,
      wndPlacement.rcNormalPosition.top,
      nWidth,
      nHeigth);


0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question