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
 Forum for Origin C
 window size and position
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

couturier

France
291 Posts

Posted - 08/17/2020 :  04:49:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 220b
Operating System:win10 64

I want to position and size a wks into workspace.

I'm currently using

void move_size_wks(Worksheet wks)
{
    Window win;
    Page pb = wks.GetPage();
    win = pb.GetWindow(); 
    
    RECT rect1 = {5, 5, 800, 885};
    win.MoveWindow(&rect1);
}


This will size the wks to perfect dimensions according to my own screen resolution.
Now, what about other screen sizes, expecially high resolution ?
I could adapt the numbers depending on GetSystemMetrics() but how can I deal with windows' zooming factor ?

Castiel

343 Posts

Posted - 08/17/2020 :  06:41:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

Origin Ver. and Service Release (Select Help-->About Origin): 220b
Operating System:win10 64

I want to position and size a wks into workspace.

I'm currently using

void move_size_wks(Worksheet wks)
{
    Window win;
    Page pb = wks.GetPage();
    win = pb.GetWindow(); 
    
    RECT rect1 = {5, 5, 800, 885};
    win.MoveWindow(&rect1);
}


This will size the wks to perfect dimensions according to my own screen resolution.
Now, what about other screen sizes, expecially high resolution ?
I could adapt the numbers depending on GetSystemMetrics() but how can I deal with windows' zooming factor ?



See if this works for you:
bool check_convert_rect_with_DPI(Window& wnd, RECT& rect, bool bForHTMLDlg)


Find it in analysis_utils.c.

It calls
double okutil_get_DPI_scale_factor(int nIndex)



------------------------------------------
       Be The Change
             You Want To See
                   In The World
------------------------------------------
Go to Top of Page

couturier

France
291 Posts

Posted - 08/17/2020 :  07:31:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Excellent !!!!

thanx
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