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

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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

RajmaheshAuthor Commented:
And one more
can u just tell me which api does give the screen resolution
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
RajmaheshAuthor Commented:
But this looks more like VB code

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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.