Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding a Dynamic Window Handle
#1
Hello Friends,

I have come upon a pretty perplexing problem that I can seem to solve myself with the help file. Basically, I am working with a custom illustration software for running quote for an insurance carrier. The problem I am having is that every time the illustration software is open it generates a new window handle. Some of the window handle stays the same and I have tried using wildcard and Rx but can't seem to get the win() function to recognize the window no matter what I have tried. Below is two example of code I get when I try to capture the window's information.

Example 1
Code:
Copy      Help
int w=win("JH LTC Illustrator" "HwndWrapper[LTC Illustrator.exe;;690ca6b4-28f9-470a-885d-4252b39adce8]")

Example 2 (After I close and reopen the illustration software)
Code:
Copy      Help
int w=win("JH LTC Illustrator" "HwndWrapper[LTC Illustrator.exe;;96a423d2-ba3a-44f2-962a-2a9eb6e1c97f]")

If these numbers and letters change every time I generate run time "window not found" errors. I would appreciate any help that you all can give me with this problem.

Thanks in Advance!

Paul Daugs
#2
int w=win("JH LTC Illustrator" "HwndWrapper[LTC Illustrator.exe;;*]")
or
int w=win("JH LTC Illustrator")
#3
Hello Gintaras,

Surprisingly that worked! However, now I am getting a different run time error of the following on the code below. Any thoughts?

Quote:Error (RT) in JH_PLTC: item not found. ?

Code
Code:
Copy      Help
int w=win("JH LTC Illustrator" "HwndWrapper[LTC Illustrator.exe;;*]")
Acc a1.Find(w "COMBOBOX" "" "xy=320 222" 0x1004)
a1.CbSelect("Couples/Partner")

Problem Code
Code:
Copy      Help
a1.CbSelect("Couples/Partner")

Thanks for the help!

Paul
#4
Try
a1.CbSelect("*Couples/Partner*")

Also try flags. For example, many combo boxes are populated on demand. Then flag 1 should work.
a1.CbSelect("Couples/Partner" 1)

CbSelect works not with all COMBOBOX objects.
#5
Hello Gintaras,

The flag worked great but I am guess that this software I am trying to interact with is the overarching problem. Is there a way to tell what language a program was compiled in? And would that help in programming a QM that can run it?

Thanks,

Paul
#6
Quote:Is there a way to tell what language a program was compiled in?
Sometimes I recognize it from window class names. In this case I can't.

Quote:And would that help in programming a QM that can run it?
In most cases not.
#7
Thanks for the help Grintaras.

Paul


Forum Jump:


Users browsing this thread: 1 Guest(s)