Window Handle and things inside

Hi, I created a button which will call a new instance of a window called Window with a title as a uniqueID

dim h as integer = RemoteControlMBS.WinFindWindow("","cstr(UniqueID)) if h > 0 then call RemoteControlMBS.WinBringWindowToTop h else dim NW as new Window NW.title=cstr(UniqueID) end if

but now I have a problem. In the window , it has a label and progress bar.
How do I call the new window instance that I have created and pass values into the things inside the new instance?

calling window.label.text=“soemthing” will not do cause window does not exist in this way.

I know window has a unique handle but how do i get to the label?

if window.handle=someuniqueid then
window.label.text="something"
end if

or is there a way? cause all the window are new instances

not sure what you do there.
But why not simply keep a reference to this window somewhere in your app?
And if you keep one, you don’t need the call to FindWindow as you have the handle in the window object.

Well the code above is just to create a new Window if its dont already exist, and if it exist it will put window in front, anyway the problem here is how do i call a specific window so i can pass values inside the window such as label and progressbars inside the window i just created.

As i could create as many instance of the same window and the only difference in each window is the Handle and the title.

I dragged a window into the project, called it w. Added to it a label Label1 and a progressbar ProgressBar1.

Now I can create as many instance of its subclass as I want and set the properties of controls inside through a button as :

Sub Action() dim NW as new w NW.title = "yada" NW.Progressbar1.value = 25 NW.Label1.Text = "yada yada" End Sub

Each time I click, the window comes in front if it exists already and the properties are set.

Well the thing is I want to put the values after I created the instances of the windows.

Let say i created 4 windows of the same W2 Class
then after pressing another button
i want the first W2 window with the label.text=“first”

and the 2nd W2 window . label.text=“2nd”

and so forth.

[quote=91558:@Theizu Chkdsk]Well the thing is I want to put the values after I created the instances of the windows.

Let say i created 4 windows of the same W2 Class
then after pressing another button
i want the first W2 window with the label.text=“first”

and the 2nd W2 window . label.text=“2nd”

and so forth.[/quote]

[code] dim nw(10) as W

dim i as integer = 1
nw(i) = new w
nw(i).Title = "Window "+str(i)
nw(i).Label1.Text = “One”
[/code]

You address each instance of the windows array by the index.