|
hi guys
i want to switch between program run in windows such as alt+tab
but use c#
|
|
|
|
|
You want your application to simulate alt-tab? That will make for a very confusing user experience because you are hijacking system functionality in a way they won't be expecting.
|
|
|
|
|
i have a script in mql4 language in metatrader software that run this url:
http://aaaa.com/Default.asmx/methodname?S=+S+&d=+T;
i want to make a asp.net page(web service) and insert this parameters('s' and 'd')in database.
how can i make this url?
Regards
|
|
|
|
|
Hi,
You can make use of Request.QueryString to extract the values of the varaibles in the querystring.
Request.QueryString["S"] will give you the value of s
same way
Request.QueryString["d"] will give you the value of d.
|
|
|
|
|
but before using these parameters i want to create this url:
http:
these parameters have been sent from mql witn calling this url..
now i have to create this url to make connection between mql and web service.
how can i create this url in visual studio?
i hope to be clear my explain.
modified on Thursday, February 3, 2011 2:27 AM
|
|
|
|
|
The question could have been phrased better. Perhaps something like "Need help reading URL parameters"?
My first thought when I read it was a sarcastic response - "click on that text at the top of your screen, and start typing..."
|
|
|
|
|
But that would have been mean, and we try not to do that here, right???
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Mean? Me? Perish the thought. I would never, ever say anything "mean". Or sarcastic... Or negative. Nope, never, no-way, not me. Or indecisive, for that matter. Well, maybe...
|
|
|
|
|
I found the answer:
with Going to web.config and adding this code in system.web section:
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
good luck.
|
|
|
|
|
If there is a static class with some static data e.g. string in a separate assembly Library.Static and there are 2 application assemblies that use it App1 and App2 do they share that static data or each application has its own Library.Static copy loaded into its memory and global in its own environment?
Чесноков
|
|
|
|
|
When an application runs, it runs in its own process space. This means that any variables for the application runs in that process space, so each application gets its own version of the data. This is a good thing as it helps to prevent from side-effects such as one application changing the data and the other one relying on it being in the original state.
There are ways to share the data, but they need to be considered very carefully.
|
|
|
|
|
That means that 2 copies of the assembly with static data will be loaded to each application the same way as in native dlls and processes using them?
Чесноков
|
|
|
|
|
Yes. Apart from using the .NET runtime, conceptually there are no differences between managed and native dlls. Windows doesn't behave any differently because something happens to run as a .NET application.
|
|
|
|
|
can we create an application in C# so that we put a dll on some other machine and application on some other machine. when we run the application it uses dll of that machine and executes the application smoothly. please help i have no knowledge of the topic and provide some help url if any.
Thanks and regards
|
|
|
|
|
|
A better solution is to use a service, web or windows, this being the current flavour of remoting.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Whenever you run an application in Windows, it needs to be able to find all the libraries that it runs on the same machine. In .NET, these are either located in the local directory, or in the GAC. When you think about it, you should be able to see that it could be a major security hole in an application if it relied on components that weren't installed with it and were sourced from an external, potentially unsecured, server.
|
|
|
|
|
if say Data access layer of the application is on server of the organisation and every body is accessing it from his client machine will it work through remoting.
|
|
|
|
|
I think so, like a plug-in, but then it won't work if the network is down. Better to copy updates down when available. Provided you can do so securely.
|
|
|
|
|
Hi,
I am working on an application which doesn't have a UI excpet for system tray icon. It doesn't show up in taskbar and also in Alt + Tab menu. For this I have done the following in the constructor of the form,
this.Opacity = 0.0;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.ShowInTaskbar = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Show();
this.Visible = true;
I have a timer event handler whose job is to get the focus back to this form if it is doen't have the focus.For this I am doing the following,
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Visible = true;
this.Show();
this.Activate();
This should have worked fine but it's not It works sometime. Is there anything wrong in this?
What is that I am missing here which causes it to fail in getting the focus? Is there a better logic to get the focus? I have even tried using the Win32 API SetForegroundWindow but not successful.
Any help is appreciated.
|
|
|
|
|
HalliHaida wrote: I am working on an application which doesn't have a UI excpet for system tray icon.
..and a form
HalliHaida wrote: This should have worked fine but it's not
By design; it gets very frustrating if other applications "steal" the inputfocus. You're merrily typing away in Microsoft Word, and all of a sudden some popup comes along, asking whether to delete everything on "C:\". You're still typing merrily, and hit the "O" button, confirming the delete..
The best thing you can do is to show you application. If the user wants to work with that Window, they'll click it and give it focus. If they're still working in Word, they can move the focus whenever they're done there.
I are Troll
|
|
|
|
|
Well, let me give some more details. I am preparing a POC (proof of conecpt). To meet the actual requirement, the POC should have the following funtionalities,
1) System tray icon is the only UI of the application and it will have a option to exit the application.
2) The application should not appear in taskbar or Alt + Tab menu.
3) When an event is received from an external source, application should display a form, having a text box control and enter button, should appear and user should be able to type something and hit enter.
4) As soon as the user hits enter, the form should disappear.
5) Steps 3 and 4 could be repeated.
To achieve this, I have done the following,
1) Created a system tray icon with exit option in a window application
2) This main thread spawns a thread which will create a form having TextBox and button control and which will be hidden. To make it not appear in the Alt + Tab or taskbar have done the following,
this.Opacity = 0.0;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.ShowInTaskbar = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Visible = true;
3) This worker thread spawns another thread which will create a TCP listner to receive the events from external source.
4) When the event is received, I am doing the following to display the form so that user can enter some text.
this.WindowState = FormWindowState.Maximized;
this.Activate();
This is not working for me The form is not getting the focus so that user can enter the text. The Activate() method is not working fine.
I tried setting the form as topmost before activating ans resetting it after activating like below
thi.TopMost = true;
this.Activate();
this.TopMost = false;
But this worked once or twice, but most of the time it fails. When it worked, if we shift the focus to some other application, then on receiving the next event the form fails to get the focus back.
All I need here is to display the form and make sure that it has the focus so that user can type. I tried setting the focus to the control like below,
<textBox>.Focus();
Any help is really appreciated.
|
|
|
|
|
HalliHaida wrote: This is not working for me
Your application won't be in the Alt-Tab list if there's no form visible. If one is visible, it'll be in the list, just as it should. You can't change the z-order of a form without a form. Hence, only visible apps participate.
HalliHaida wrote: The form is not getting the focus so that user can enter the text. The Activate() method is not working fine.
There's something built into Windows that prevents you from stealing the focus from another application, for the reasons prior given.
HalliHaida wrote: then on receiving the next event the form fails to get the focus back.
Because it'd mess dearly with the user-experience. Imagine typing a post here and loosing the inputfocus every second.
I are Troll
|
|
|
|
|
Hi,
Thanks for the reply. Just for clarification, I am reducing my statement of problem to the scenario below.
I have created the following sample code/setup. The setup is, a form (receiver) will activate itself on receiving a event from the socket, another form (sender) which will send the event to the receiver form.
FormRecvr:
1) Create a simple form with textbox control
2) Have a TCP listner listning on some port to receive the event
3) On the reception of event, activate the form i.e bring it to front so that it has focus and user can type some text.
FormSender:
1) Create a simple form with two button controls, one to activate the rcvr form by sending an event through socket and the other to exit the application.
2) Create a TCP socket with the listner and send the event.
After executing this simple program, what I have noticed is the receiver form doesn't get the focus. The taskbar menu of that app keeps blinking. The window doesn't come as foreground.
I have tried the following to bring it to focus.
this.TopMost = true;
this.Activate();
this.TopMost = false;
So, you mean to say, that even the behavior of this sample set up is expected? There is no way to make this setup work in the expected way?
Please do the needful.
Thanks in advance.
|
|
|
|
|
HalliHaida wrote: So, you mean to say, that even the behavior of this sample set up is expected?
Yes. All kind of things go wrong when someone is working and something steals the focus without the user noticing. I expect the same thing to go wrong if it were a popping up based on polling a file.
HalliHaida wrote: There is no way to make this setup work in the expected way?
You'd have to search long and hard for a hack. The expected way is a bad idea, for the reasons prior given. The Old New Thing[^] has a good explanation on the subject, and more items that may be helpfull[^]
I are Troll
|
|
|
|