Hi ,

I hope someone can help. I am writing a tool for myself that modifies some windows how i want it to so that my environment suits me.

I want to know how to convert a string to represent a constant in a function.

Let me explain:

I have a form on which I have two combo boxes, one has the actions i want to perform and the other has the window handles.

ie combo1 has SW_HIDE and combo2 has the window ID on which to call it

I already know how to get window/child handles.

this is the api function I need help with:
<code>
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Private Const SW_HIDE = 0

Call ShowWindow(combo2, combo1.text)
</code>

The show code works fine with:
call Showwindow(handle,SW_HIDE)
but fails as invalid with combo1.text as its a text string and not the actual constant i want it to be.

What I am asking is how to get the choice with minimal code from the combo box to represent the constant?? Ie select SW_HIDE in the combo box for it to be valid in the call showindow function.

This works:
<code>
if combo1.text="SW_HIDE" then
call showwindow(combo2,SW_HIDE)
end if
</code>

but its heavy code when there are lots of choices in the combo box. Therefore the desire to replace the SW_HIDE with a changeable variable.

I hope someone can help, its probably something simple staring me in the face, but has got me stumped!

Thanks