Missing windows function ?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Bsoft
Newbie
Posts: 3
Joined: Tue Jul 03, 2007 7:29 am

Missing windows function ?

Post by Bsoft » Tue Jul 03, 2007 7:56 am

None of the function available in macroScheduler own language refers to a static, not fluctuating name. They are all subject to change depending on whatever.

There is however a string that is unique to the windows: ahk_class but we have no means to get it or activate a windows with it.

Am i missing it ? do you have a work around ?


PS:FindWindowWithText is not good enough in many case

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 03, 2007 8:20 am

ahk_class is not a Windows name. I think you are referring to a name used by another scripting language to refer to the Windows class name. Class names may be static but they are not unique. For this reason you will still need to use the object's title/caption.

If you want to find a window based on its class name then you can use the FindWindow API function, but this is usually unnecessary.

You can also get the handle once you've found the window you want and the handle will not change. You can then use the handle to access the window subsequently. Handles ARE unique.

FindWindowWithText does something completely different.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Bsoft
Newbie
Posts: 3
Joined: Tue Jul 03, 2007 7:29 am

Post by Bsoft » Tue Jul 03, 2007 9:39 am

Yes, my mistake. Thx for the quick reply

Unfortunately the windows handle will not do.

I have a script that automatically fills in User and Id in web page based on the URL. It takes the User-PW from the password manager program and paste it in the correct fields in form.

To make it work now without even fetching the mouse (that works already OK) I need to re-focus on the specific browser (i uses several) once macroscheduler is started. Finding the right Handle at that point is my problem, but i know wich program it is.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 03, 2007 9:43 am

Once you've started the browser window you can then get the handle with the GetActiveWindow command.

But the best way to automate web forms is to use VBScript or WebRecorder. See:
http://www.mjtnet.com/forum/viewtopic.php?t=1461
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Bsoft
Newbie
Posts: 3
Joined: Tue Jul 03, 2007 7:29 am

Post by Bsoft » Tue Jul 03, 2007 9:59 am

Once you've started the browser window you can then get the handle with the GetActiveWindow command
At that time it's too late cause the browser is not started from the script it's only now that the script is started (hmmmm... is that clear, maybe not). Lets say it the other way around. Typing "pw" anywhere in the browser will start the whole process and log me in the current page. Right now i have to click with the mouse to do it (works well).

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts