|
I'll burn that bridge after I've crossed it.
|
|
|
|
|
PIEBALDconsult wrote: I'll burn that bridge after I've crossed it
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hello,
This is my first post to a site ever, please be patient with me. If I am not following a normal rule of conduct also please tell me.
My question/problem is:
I am trying to control the input to a form from another program. For example ( and this is just an example not being specific to my problem)
-- for example if you wanted a program to click -- using the mouse -- on the calculator that comes with windows 543 / 234 =
-- or you wished to enter "543" into the text field portion of the calculator.
The specific project is actually geared to control a piece of stock trading software automatically. But there is no COM or NET library to interface with.
I was wondering if this is even possible. Can you move a mouse and click on a form and not actually change focus... and enter data into a text box field when you have no clue about its handle or name.
-----
I am really looking for a starting point and feasability issues. If someone could point me in the right direction.
|
|
|
|
|
Yes, so long as it's not a WPF program, it's possible. Every control is a window, you can get the handle to a window and then send it messages. It's a lot of work tho, and it can be flaky, esp if the program changes.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
One good starting point is getting WinSpy++ and inspecting the target application with it. Having done that, you can actually quite easy enumerate the windows/controls of any application (lookup EnumWindows() on MSDN) from there you get the handles of child controls until you find the control you want to interact with, from here its a piece of cake - use SendMessage() to have the control do whatever you want it to.
Sure its not THAT easy to keep track of the interaction and the related windows/controls but I guess it must be worth it.
|
|
|
|
|
|
How do i make to "snap" togheter 2 dialog boxes from same process. like in WinAMP
|
|
|
|
|
By working out when they are close, and moving them so they are right on top of each other. Then, when they are 'snapped', when one is moved, you move the other one in unison. There's a moved event you can use for this.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm adding some code to a project that requires the use of the app.config file. However I don't have access to this file. Can anyone think of a good way to start the application and have it "generate" an app.config file, or just ignore the file?
I'm trying to use Enterprise Library Caching without app.config, or perhaps add the config section to the app.config file.
Any ideas? Solutions?
Thanks,
Jason
|
|
|
|
|
What do you mean 'requires the use' and 'don't have access' ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
So we have an application which has an app.config file. However the code I'm working on is a secondary agent that runs within that application with the app.config file. I would like to run the Enterprise Library Caching without having to modify this app.config file.
Does that make any more sense?
Is there a way to use the EntLib.Caching without the use of the app.config. Or perhaps is there a way in code to handle the calls to the app.config file?
|
|
|
|
|
You can add it to the solution. Right click -> Add Item -> Application configuration file.
Insert funny quote here.
|
|
|
|
|
I'm not sure if that's what he means. As usual, they ask and then don't answer when you try to help.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Give me a break. I was away from my computer for a while.
|
|
|
|
|
Sorry, but it's just not uncommon for people to ask and then never reply when people answer by asking for more detail.
I still don't get what the conflict is - does John's answer help ? You can read the app.config as a normal XML file and parse it if you want to.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks, though that isn't what I'm needing. I've replied with a bit more info.
|
|
|
|
|
If you just want to read the file, that's possible because after all, it's just an xml file. You can actually force your program to read a different app.config file but once you do, it's a fairly convoluted coding process to un-do that. I think I have some code for you to use as an example, but it may be at home.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
All right, that sounds quite weird, but that's the way it works:
foreach(something in somethingelse)
{
add_a_job_to_the_threadpool(delegate { myFunction(something.Key, something.Value); } );
}
Right, so what obviously happens here is that ALL calls to myFunction() receive the same parameters since something is passed as reference. How do I get this done as values or at least as references to the value, not to the iterator. I already tried to use a struct (which would pass by value) but the something is actually a dictionary<string,> and even wrapping them in a struct doesnt change much.
There must be a better way then copying them before passing to the delegate.
Anyone?
|
|
|
|
|
I thought you'd need to create new string variables from the Key and Value, and then pass those.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
That's what I would like to avoid. Especially since the class parameter is quite expensive by means of processor resources.
|
|
|
|
|
Yeah, I can understand that, but I suspect that the combination of how anonymous methods are scoped, and the nature of the string class, will make it unavoidable. I do think the anonymous method scoping is part of the issue, have you tried using a non anonymous method ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Actually no, didn't try that yet (more because of the custom threadpool class I am using), but to fence the problem in its worth a try. Thanks for the idea.
|
|
|
|
|
np - I hope it helps.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Andreas Saurwein Franci Gonçalves wrote: How do I get this done
That depends, there are several options. The two most obvious choices are 1) Hire a software developer that know and understands how to do multi-threaded software development 2) Learn the subject of multi-threaded software development (NOTE: this is a fairly large and somewhat complex subject ), then using the new knowledge, develop the solution yourself.
led mike
|
|
|
|
|
Thanks a lot for this quite useless answer. After 25 years developing software, about half of that threaded server applications in C++, I do have a slight idea of accomplishing this task, but I do not have sufficient knowledge of C# yet to do it.
So if you can not contribute anything useful to the forum, don't contribute at all.
|
|
|
|