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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 window size and position

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
couturier Posted - 08/17/2020 : 04:49:02 AM
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 ?
2   L A T E S T    R E P L I E S    (Newest First)
couturier Posted - 08/17/2020 : 07:31:21 AM
Excellent !!!!

thanx
Castiel Posted - 08/17/2020 : 06:41:20 AM
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
------------------------------------------

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000