[python-win32] how to activate subwindow of the application ???

Tim Golden mail at timgolden.me.uk
Fri May 9 15:32:06 CEST 2008


[Copying back to python-win32 list]

Neha: please keep your posts on-list. This will help you
since I'm sure there are other people than me out there
who can help; it will help me, because I don't have time
or the competence to deal with every single query that 
comes up; and it helps anyone else who might be following 
the thread now or in the future to see what happens.

neha rai wrote:
> Hi Tim,
> Thanks for showing interest. due to some reasons i can't post 
> my code but I'll tell you in detail what i am doing.

OK. That's going to make it more difficult. It's remarkably hard
to describe accurately a programming issue with showing the code,
but we'll have a go.

> Tool details:
> 
> * My tool identifies the active window on the screen.
> * identifies all its text boxes.
> * populates a gui on which user can see the present text areas.
> * Asks user to push type of data(digits,alphabets, length of data ets) for
> each text box.
> 
> * creates file for set of input. i.e suppose if in window there are 3 text
> boxes it will create 3 file. and each file will contain 100s of set of input
> varying in length.
> * pushes user defined data in found text boxes by reading from file.
> * and then my tool clicks on the action button(to get the input
> accepted) i.e. in most of the cases is OK.

I hope you've got a good reason for doing things this way: it looks
awfully convoluted!

> Now what is happening, the window gets closed after clicking OK (as it
> should be). what i want to open the same window and push another set of data
> in it.
> So for this purpose i want some thing which can remeber what  window the
> user opened so that it can be opened again. In same window there can be many
> tabs. so something is needed which can open exactly the same page on which
> the user was working.

I'm still not 100%, but presumably whatever piece of code you're running
in the first place (which for various reasons you can't show us) to open
the window can persist whatever pieces of data it needs to open the same
window again. Maybe it's the window class or its hwnd or its name.
I don't understand why, if the program can do this once -- and you seem
to suggest that it can -- that it can't do it again.

I may be being obtuse but I can't really see where the problem lies.
Maybe someone else on the list has a better idea?

TJG


More information about the python-win32 mailing list