• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

Is there any way to find the Screen Resolution through TCL/TK

Hi,
I have developed a tool using TCL/TK
If I operate it with the resolution 1024x768 I can get the full view of the tool
If I port it to some other m/c which has resolution less than that
ie 800x600 or 640x480
I could not get the full view of the tool
If I resize it, the buttons and other widgets are going inside so that I cannot able to operate those
Is there any way to get the screen resolution and resize it accordingly
or else any other way to solve this issue

Thanx in advance
Rajmahesh
0
Rajmahesh
Asked:
Rajmahesh
  • 3
  • 2
1 Solution
 
osmodeanCommented:
The best way to solve this problem, is redesign your user interface and develop it for 800x600 or even 640x480
This way your application will be viewable in higher resolutions with no problem and the lower resolutions still look as you intended to.

Optionally you can detect the screen resolution with an api call and show different forms for different resolutions, but this is more work in my opinion.

I hope this helps!
0
 
RajmaheshAuthor Commented:
Thanxs for your reply
I had done the same before you gave me the answer
But still for your reply I will give this points to you

rajmahesh
0
 
RajmaheshAuthor Commented:
And one more
can u just tell me which api does give the screen resolution
thanx
rajmahesh
0
 
osmodeanCommented:
Ofcourse, here it is:

'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Insert this code to the module :

Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1

'Insert this code to your form:

Private Sub Form_Load()
Dim Tmp As String
Tmp = GetSystemMetrics(SM_CXSCREEN) & _
"x" & GetSystemMetrics(SM_CYSCREEN)
MsgBox (Tmp)
End Sub
0
 
RajmaheshAuthor Commented:
But this looks more like VB code

If it is TCL then where do i find
                  Project -> Add Module
in that


thanx
rajmahesh
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now