| Author |
Topic  |
|
|
tinkusch
Germany
94 Posts |
Posted - 08/01/2005 : 10:35:04 AM
|
Origin Version (Select Help-->About Origin): 7.5 G Operating System:XP Professional
Hi, how do I get the pixel values for the actual screen width and height in ORIGIN? How do I get the pixel coordinates, width and heigth of the ORIGIN desktop, i.e. the "grey and empty" Origin Window minus Menue bar, status bar and icon list?
My aim is to find out automatically the screen resolution dependent maximum available height and the respective coordinates for a worksheet window (in pixel). I like to fit automatically the window of my application to different screen resolutions such, that the whole window is always visible
Thanks for any hint
bye Stefan
|
|
|
Mike Buess
USA
3037 Posts |
Posted - 08/01/2005 : 1:43:22 PM
|
Hi Stefan,quote: How do I get the pixel coordinates, width and heigth of the ORIGIN desktop, i.e. the "grey and empty" Origin Window minus Menue bar, status bar and icon list?
Sounds like you want the coordinates of a maximized graph or worksheet window. The following OC function will get the screen coordinates of the Origin program window and a maximized window inside. (Project must contain at least one child window.)void get_screen_coordinates() { HWND hwnd = GetWindow(); Window org(hwnd); RECT rect; org.GetWindowRect(&rect); printf("Program window:\n"); printf("upper-left position, x:%d, y:%d\n", rect.left, rect.top); printf("lower-right position: x:%d, y:%d\n", rect.right, rect.bottom); Page pg = Project.Pages(-1); Window win = pg.GetWindow(); win.ShowWindow(SW_MAXIMIZE); win.GetWindowRect(&rect); printf("Maximized window:\n"); printf("upper-left position, x:%d, y:%d\n", rect.left, rect.top); printf("lower-right position: x:%d, y:%d\n", rect.right, rect.bottom); } Use Window::MoveWindow to resize a window.
Mike Buess Origin WebRing Member |
 |
|
|
tinkusch
Germany
94 Posts |
Posted - 08/02/2005 : 03:10:46 AM
|
Thanks, Mike that helps a lot!
bye
Stefan
Edited by - tinkusch on 08/02/2005 03:36:24 AM |
 |
|
| |
Topic  |
|
|
|