[proFit-list] want to cycle through all windows and perform an action on the data windows

Dave glasspusher at outofoptions.net
Fri Jan 6 10:00:01 CST 2023


Hi Kurt,
	Thanks, that looks like it does the job.

So the GetWindowObject call can query the same properties that are listed under the Pascal GetWindowProperty call? I think that’s where I didn’t look for answers.

Dave

> On Jan 5, 2023, at 9:23 PM, pro Fit Support <profit at quansoft.com> wrote:
> 
> Dear Dave
> 
> Happy new year to you, too.
> 
> Use the property “type” of the window object. The following script iterates through all document windows and flags the ones that are data windows:
> 
> w = pf.NextWindow(0)
> 
> while w != 0:
>     o = pf.GetWindowObject(window = w)
>     print ("found: ", o.name)
>     if o.type == pf.dataWindow:
>         print ("   -> is a data window with", o.nrRows, "rows and", o.nrCols, "columns")
>     w = pf.NextWindow(w)
>         
> 
> Hope this helps.
> 
> Best regards
> 
> Kurt
> QuantumSoft
> 
> 
>> On 5 Jan 2023, at 20:40, Dave <glasspusher at outofoptions.net> wrote:
>> 
>> Hi folks,
>> 	
>> Happy new year to all. 
>> 
>> I have a Python script that does some calculations on a data window, and would like to have it act on all data windows that are open. 
>> 
>> I was thinking of iterating through all windows (pf.NextWindow), checking if it was a data window, if so, running the script, but…
>> 
>> …I don’t see where I can query a window as to if it’s a data window or not
>> 
>> pf.FrontmostWindow(type) is as close as I see to finding out if a window is a data window, but how do I find out what types all windows are without moving them from the back?
>> 
>> Maybe I’m missing something. 
>> 
>> Any help is appreciated 
>> 
>> Dave
>> 
>> 
>> _______________________________________________
>> proFit-list mailing list
>> proFit-list at quantum-soft.com
>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
> 
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20230106/d2ef71fa/attachment.html>


More information about the proFit-list mailing list