Tenaya Posted September 26, 2006 Share Posted September 26, 2006 I'm using GUICreate to create a from with a certain size. With the code below, the real size on the form differs from PC to PC. Maybe the difference is related to different Windows versions and screen resolutions - on one machine the form is bigger on another PC it's smaller. How can I specify the real size of a form which will work the same on different PCs and Windows versions? $Form_Main = GUICreate($TitleMain, 115, 26, $SIP_XPos, $SIP_YPos, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS)) Link to comment Share on other sites More sharing options...
martin Posted September 26, 2006 Share Posted September 26, 2006 I'm using GUICreate to create a from with a certain size. With the code below, the real size on the form differs from PC to PC. Maybe the difference is related to different Windows versions and screen resolutions - on one machine the form is bigger on another PC it's smaller. How can I specify the real size of a form which will work the same on different PCs and Windows versions? $Form_Main = GUICreate($TitleMain, 115, 26, $SIP_XPos, $SIP_YPos, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS)) The size of the form should be 115 pixels wide x 26 pixels high on any PC. If one PC has a screen resolution of 1600 x 1200 pixels the form will take up a very much smaller part of the screen than one which has a resolution of 800 x 600. The screen resolution width is obtainable from the sytem info macros @DesktopWidth and @DesktopHeight. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Tenaya Posted September 26, 2006 Author Share Posted September 26, 2006 It's not that simple. I've made two screen-shots: - Form1 - From2 Both screen-shots show the same form created with the same code and exe. Form1 is from my desktop PC with a resolution of 1152x864 and Form2 is from my notebook with a resolution of 1400x1050. Both PCs run Windows XP. As you can see, the client area differs. On a third machine running Windows XP embedded the rigth boarder line cut's the "ABC" button. It's not only a matter of a different boarder or title bar. It doesn't desturb me, whether title bar or boarder are different from machine to machine. But the asymetric appearence of Form2 is very annoying. Any ideas? Link to comment Share on other sites More sharing options...
Tenaya Posted September 27, 2006 Author Share Posted September 27, 2006 Yes, in deed the reason for the different sizes is the dpi setting. So is there a possibility to query the dpi setting? This way it would be possible to readjust the form. Link to comment Share on other sites More sharing options...
Uten Posted September 27, 2006 Share Posted September 27, 2006 Rescale dialog Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
livewire Posted September 27, 2006 Share Posted September 27, 2006 So is there a possibility to query the dpi setting? This way it would be possible to readjust the form.$DPI_setting = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics", "AppliedDPI") Link to comment Share on other sites More sharing options...
Tenaya Posted September 27, 2006 Author Share Posted September 27, 2006 I've fixed it now. At least the different size was not related to the size of the form itself. It's related to the form style. I create now the form with $Form_Main = GUICreate($TitleMain, 117, 25, $SIP_XPos, $SIP_YPos, $WS_CAPTION, $WS_EX_TOOLWINDOW) This works fine for both dpi settings (96/120). However, thanks a lot for your advise. Great forum and great people here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now