|
Hey,
Thanks for taking so much time to help, I just closed and reopened the application and the ID actually changed, this time it was 3738914.
Is there a way to search through, maybe I could use that to identify it?
Thanks for the help.
Properties for window 0x00390D22
Item Value
Class Name SWT_Window0
Text
Rectangle 2275, 506, 2332, 555
Size 57, 49
Client Rectangle 0, 0, 57, 49
Client Size 57, 49
Styles WS_CHILD
WS_VISIBLE
WS_CLIPSIBLINGS
WS_CLIPCHILDREN
WS_TABSTOP
StylesEx WS_EX_LEFT
WS_EX_LTRREADING
WS_EX_RIGHTSCROLLBAR
WS_EX_NOINHERITLAYOUT
ID 3738914
Properties Atom: #43288 0xFFFFFFFF (-1)
Class specific Window is Ansi
Owner EXE C:\Program Files\Peregrine Systems\ServiceCenter 6.2\Client\jre\bin\javaw.exe
|
|
|
|
|
If there is nothing unique about the window, then there is not much you can do. You need a bullet proof way to ID the window. What if they happened to move a "format hard drive" button there?
|
|
|
|
|
Haha, that'd be real bad
I was hoping I could recursively search through the buttons somehow?
Maybe I could use reflector on the exe and decompile it? I'm not real familiar with reflector but maybe I could figure it out?
I've always had the mindset that anything that can be done by a person, can be imitated with code?
|
|
|
|
|
Actually I'm not sure if the mouse click will work because we have 2 monitors here and the coordinates of the button will change if it is on the other monitor.
|
|
|
|
|
If you are planning on doing a considerable amount of interacting with *other* applications I would suggest looking into this:
http://www.autoitscript.com/site/[^]
I wrote and posted a .NET wrapper on their forums.
You can do all sorts of cool stuff like find and interact with any class (buttons, listviews, etc..)
Only native Win32 classes of course tho.
|
|
|
|
|
Hi Jason,
I actually learned to code on AutoIT, so I am very fond of it
Do you post under the same user name over there so I can search for your .net wrapper?
If you look at my original button identification code in this post, you'll notice I used AuInfo.exe to capture that information, I think AIT at least identifies a classNN name for it
Thanks!
|
|
|
|
|
|
In a small desktop app, I'd like to allow users to open a specific web search in their default browser. Easily done with FF, IE and Opera using Process.Start . But I have yet to find a command line switch for Chrome. No answers from any of the Chrome forums I've tried. I've looked at numerous lists of Chrome command line arguments and see nothing regarding a search argument. Seems amazing that Chrome would lack the functionality. Anyone have a suggestion?
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Process.Start("http://www.google.com/search?q=your+keywords+here");
uses whatever is your default browser.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: Process.Start("http://www.google.com/search?q=your+keywords+here");
This works of course, but I'd like to have the app open the user's default browser and their default search engine. And, if future changes at Google result in the search string being altered, then the process could fail.
I can launch IE or FF and search like this:
Process.Start("IExplore.exe", "? lizard")
Process.Start("firefox.exe", "-search lizard")
But Chrome apparently doesn't have a similar command line arg. At least I haven't been able to find it.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
I suggest you try:
Process.Start("chrome.exe", "lizard")
and see if you like the outcome.
[ADDED] and you could add some automation that clicks a button for you... [/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
modified on Thursday, March 3, 2011 9:42 AM
|
|
|
|
|
tried this and it doesn't work for me. Some reason it populates the URL with "lizard/" and complains it cannot find "lizard"
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
|
|
|
|
|
Same here.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Luc Pattyn wrote: Process.Start("chrome.exe", "lizard")
Tried that already. It causes Chrome to treat the search term as a url and I get a page with "Oops! Google Chrome could not find lizard".
If it works for you then perhaps there is an option in Chrome I haven't set properly. With IE/FF/Opera I'm able to imitate searching from the address bar using Process.Start . And in Chrome I can type "? search term" in the adrs bar and it works perfectly. It just doesn't work when called from my app.
Looked at a long list [^] of Chrome command line args and there doesn't appear to be one to open it with search results. That a browser created by a company that specializes in web searches would omit it surprises me.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
did all that, same results. however, some more experiments, and here it is:
Process.Start("chrome.exe", "\"? lizard\"");
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
In VB this throws an error - "The '?' cannot be used here". I'll see if I can change it to work.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
you're a joker. If you want VB, don't post in the C# forum, and escape the double quote the way VB does it!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
C# is easy to convert to VB, and more people/better answers in C# forum.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Alan Burkhart wrote: better answers in C# forum
I object. My answers in VB forum have the same quality level. I admit there may be fewer people realizing it over there.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
You always give good answers. I just know my odds are better in C#, even if I have to convert some code. If I had a brain, I'd switch. But I hate semicolons and curly braces.
And thanks again to you and musefan. I actually removed the search feature from a new project article [^] because I couldn't figure out how to make Chrome cooperate. Whenever I update it I'll add it back in. Now that I see it, I'm smacking myself on the head for not figuring it out before.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Alan Burkhart wrote: I'm smacking myself on the head
That algorithm seldom leads up to the intended result.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
so you want the very confusing code of...
Process.Start("chrome.exe", """? lizard""");
...oh and get out the damn C# forum
This will do for now
|
|
|
|
|
musefan wrote: Process.Start("chrome.exe", """? lizard""");
YES!!!
Many Thanks.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Am I to understand you first are asking in the wrong forum on purpose, and then have trouble translating a perfectly good one-line answer to your language?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: Am I to understand you first are asking in the wrong forum on purpose, and then have trouble translating a perfectly good one-line asnwer to your language?
I've experimented with so many (wrong) ways to get it done today that the "\" didn't register in my head at first. I was adding the quotes, but not removing the backslash. When I saw musefan's msg I just about beat my head on the wall. But - no one ever accused me of being a genius. I KNOW I'd have thought about the backslash in a minute or two. Or tomorrow.
Everybody SHUT UP until I finish my coffee...
|
|
|
|