The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 screen resolution
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tinkusch

Germany
94 Posts

Posted - 08/01/2005 :  10:35:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tinkusch

Germany
94 Posts

Posted - 08/02/2005 :  03:10:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Mike
that helps a lot!

bye

Stefan



Edited by - tinkusch on 08/02/2005 03:36:24 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000