Sign in to follow this  
Followers 0
laidback01

Clicking a properties menu

9 posts in this topic

If you try to use the autoit Window Info piece to tell you what's going on:

left click on the desktop, you get info in the Window Info app.

move the mouse around, you at least get Control Click coords.

right click on the desktop and mouse over the subsequent menu, and you get NOTHING. no name, no coords, not anything.

why is this? I have an app that uses menus like these constantly and it's hard to get autoit to do what I want.

Does anyone know how to work with these kinds of windows / menus (Class #32768)

.... frustrating as hell.

Share this post


Link to post
Share on other sites



I found a way using COM objects at the "Scripting Guy" website, using VBScript, to "invoke" a call to certain context menu items. And I just converted the code to AutoIt, which is pretty easy to do by hand for just a little snippet.

There are DOS commands you can use to bring up the Display Properties applet, and even get it to open in a given tab, like the "Screen Saver" tab, or the "Appearance" tab. I will go find them on my machine and post them if that is what you are trying to do.

What more exhaustively and precisely are you trying to do?


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

I found a way using COM objects at the "Scripting Guy" website, using VBScript, to "invoke" a call to certain context menu items. And I just converted the code to AutoIt, which is pretty easy to do by hand for just a little snippet.

There are DOS commands you can use to bring up the Display Properties applet, and even get it to open in a given tab, like the "Screen Saver" tab, or the "Appearance" tab. I will go find them on my machine and post them if that is what you are trying to do.

What more exhaustively and precisely are you trying to do?

okay, I was just using the Desktop properties screen as an example because I thought everyone would be familiar.

I have an app - Meditech Client Server that makes extensive use of this type of menu, and as such it makes it hard to click on the menus with an automated script. So, I'm looking for advice. I want to know how to "look" at a menu like that with autoit. It doesn't ahve to be the Desktop properties menu, but should be a menu of class #32768. I'm not at all concerned about alternate ways to get the properties stuff, etc, I need to know how to use the menu from inside a script.

Not sure if this helps or not.

Jack

Share this post


Link to post
Share on other sites

Here - AutoIt Help file > AutoIt > Function Reference > Window Management > Controls

you can find out the basics of actuating controls and opening menus.

There are some types of menus that Autoit cannot interact with in one way, the experts say, but a lot of applications have shortcut keys such that you could use the AutoIt function called Send to send keystrokes to an active windowed application. If you go to

Control Panel > Display Properties > Appearance tab > Effects

and uncheck the "Hide underlined letters..." checkbox, maybe those shortcut keys will subsequently be discovered in your application's menus.


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Okay, so lets try this instead.

I'd like to make a function Verify($classID, $Process) and have the function verify if 1) classID is Active or exists, and then 2) if it's parent process is $process. Now, I see that WinSpector can do this - as it tells me this info in it's information window.

You see, my problem is not exactly in how to manipulate the menu - I first have to determine that the menu has shown up. Meditech is a network dependent program, and I can't have my autoit scripts dependent on time - they need to be able to tell if the menu showed up or not.

Thankfully, there can only be on menu at a time, submenus sure, but only one. So it's not going to be an issue of having multiple #classIDs tied to the same process and then having to determine what's what from that.. it, in fact, should be somewhat easier.

So.. can anyone lead me into the right direction. I'm reading the process.udf now, it's quite simple, etc, so the area I need help on is the capturing of a specifiv ClassID. Does autoit have a function that sniffs out classIDs at all?

again, thanks,

Jack

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

fornow, I found a way todo do this.... so, this'll have to work till I get a better idea or better way. anyway, this proves the existance of this class of menu - that at least, is useful.

Func Verify($class)
    Local $handle = 0
    $handle = WinGetHandle($class)
    if $handle Then ; just has to be non-zero to activate this IF.
        return 1
    Else
        Return 0
    EndIf
EndFunc
Edited by laidback01

Share this post


Link to post
Share on other sites

AutoIt is a language that is a work in progress and the closest thing we have that is native to the language, even though there are lots of ways to call non-native routines, is the function "IsHWnd".

I see you are making progress. :D This is from the help file:

Run("notepad.exe")
Local $hWnd = WinGetHandle("Untitled - Notepad")
If IsHWnd($hWnd) Then
    MsgBox(4096, "", "It's a valid HWND")
Else
    MsgBox(4096, "", "It's not an HWND")
EndIf

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

thanks for the reply. That's better than what I had, so good. I'll look into what C++ can do.. know only a little about that lang, but it it's more suited to what I need to do - for certain functions, I'll use it.

again thanks for both the tips and knowledge.

Jack

Share this post


Link to post
Share on other sites

I found a way using COM objects at the "Scripting Guy" website, using VBScript, to "invoke" a call to certain context menu items. And I just converted the code to AutoIt, which is pretty easy to do by hand for just a little snippet.

There are DOS commands you can use to bring up the Display Properties applet, and even get it to open in a given tab, like the "Screen Saver" tab, or the "Appearance" tab. I will go find them on my machine and post them if that is what you are trying to do.

What more exhaustively and precisely are you trying to do?

Can you post a link to the code at Scripting Guy or a sample of your converted code. Thanks in advance

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0