|
Ok I have an application that I want to have the user click a button and then have the program take control of the mouse.
So for instance you could click a button and then the program would move the mouse to your start menu -> programs -> applications -> notepad
I have the
[DLLImport("user32.dll", EntryPoint = "SendMessage")]
static extern IntPtr SendMessage(IntPtr hWnd, unit Msg, UintPtr wParam, IntPtr lParam);
but I don't know if i'm forming my message correctly or even if this is the way to go
i'm trying lines of code such as:
WM_LBUTTONDOWN is 0x0201 by the way
SendMessage(0, 0x0201, new UintPtr(0x0201), new IntPtr(5 * 0x10000 + 5));
This should cause the restore/minimize/close window to pop up in the top left corner of the screen, if
1.) the IntPtr hWnd can be set to 0, I was kinda hoping this would make the message global
2.) I didn't screw up anything else, the Msg and wParam seem wrong to me...
the crazieness with the lParam is because it's two 16 bit variables in one, the first is the Y value the second is the X value.
i've also tried the form's handle with the x,y cords set to "this.Location.X + 7, this.Location.X + 7" so that I could hit my program's own menu.... help?
-Ian McCloy
|
|
|
|
|
Hi all,
I need some help from you about the idea that I want to implement it.
I need to do some sort of looping, this looping will go like day by day
once it reach the final day which set from the start it will stop.
The range of days will be determined by the user by using two dateTimePickers.
And by the beginning of range I want ot go inside the loop like check somthing
and go to the next day ... and so on.
Thanks in advance.
|
|
|
|
|
So you want two calendar controls and a timer ? What is your question ?
|
|
|
|
|
hi
i want to pass my parameters to CrystalReports in VC# 2005,but how to do?
please give me an tested example for this topic.
very thanks
|
|
|
|
|
Hello Again,
I have been succsseful in get my previous error working thanks to you you all.
Now I have another query that is baffling me.
I have the pop up window coming up now, so what I need is the window to be centered.
I need two variables that I have in Javascript to be added to the script that loads the windw to centre the window.
This is Java script - not sure how to incorporate into C#.
var left_var = (window.screen.width-1000)/2;
var top_var = (window.screen.height-700)/2;
This is then added to the window.open() as an argument.
window.open(left='+left_var+', top='+top_var)
I just need the left_var and top_var varibles in C#
Thanks in advance.
|
|
|
|
|
If you want to popup a window in center screen,C# allows it right at the begining.You can set the property of the form "StartPosition" as ScreenCenter.
If You want to use the code try to get the cordinates of the parent form and give corresponding cordinates to the child form
My small attempt...
|
|
|
|
|
Hello Every one,
I am tryin to write a pop up report for a call logging web site, I have gotten to the stage where I cannot get the code I have written to work, no complie errors just no output.
The code I am using is below.
protected void open_popup_click(object sender, EventArgs e)
{
string Call = Request.QueryString["Call"];
string popurl = "http://localhost/CrystalReportsWebSite/Popup_report.aspx?call=" + Call;
string popupScript = "window.open('" + popurl + "', 'CustomPopUp', 'width=1000, height=700, menubar=yes, resizable=no')";
Page.RegisterStartupScript("PopupScript", popupScript);
}
This is associated to a button on a ASPX page, as I mentioned before the code runs but no output is produced.
|
|
|
|
|
window.open('" + popurl + "', 'CustomPopUp', 'width=1000, height=700, menubar=yes, resizable=no')
one bug is it does not have a semi-colon after window.open('');
|
|
|
|
|
Thank you!
All fixed now
|
|
|
|
|
indianet wrote: one bug is it does not have a semi-colon after window.open('');
That is not a bug. In Javascript semicolons are used to separate the statements, not end them. As there is only one statement, there is no need for anything to separate... ehm... it.
---
b { font-weight: normal; }
|
|
|
|
|
Do you have a server form on the page, where the method can add the script?
---
b { font-weight: normal; }
|
|
|
|
|
For some reason the Environment.GetEnvironmentVariable("PATH") isn't reflecting the changes I've made in the control panel. If I restart, they return correctly. For example, if I add c:\testpath to my environment variables in window xp control panel, and then write a sample c# app to show the path (Console.WriteLine(Environment.GetEnvironmentVariable("PATH"));), the c:\testpath doesn't show up. anybody know how to fix this or if there is a way to update my environment variables?
|
|
|
|
|
First processes environment variables are derived from its parent process. Second, once the environment variables are changed outside the application it will not effect running processes.
If you change an environment variables while your application is running you won’t see it.
If you change an environment variables while the parent process of your application is running you won’t see the change when your application runs.
The later applies when you run your application in debug mode from the Visual Studio. If you run your application from the explorer (double click on it) it will get the correct environment variable.
I know that when an environment variable is changed, Windows send a broadcast Windows’ message that it happened.
Ami
|
|
|
|
|
Ami,
Thanks, that makes a lot of sense. The problem I was having is that my application stays open the entire time and won't register the new path until it's restarted. Is there any way to programatically update the enviornment variables?
|
|
|
|
|
If you have WinForm application you can override the WndProc method:
public class Form1 : Form
{
private const int WM_SETTINGCHANGE = 0x001A;
public Form1()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
if (WM_SETTINGCHANGE == m.Msg)
{
if (m.LParam != IntPtr.Zero)
{
string whatChanged = System.Runtime.InteropServices.Marshal.PtrToStringAuto(m.LParam);
if (null != whatChanged && "Environment" == whatChanged)
{
MessageBox.Show("Environment variable changed");
}
}
}
base.WndProc(ref m);
}
}
Ami
|
|
|
|
|
How to take a screen shot in C# and save it into some folder ??
|
|
|
|
|
|
I got this somewhere:
Rectangle rec = Screen.PrimaryScreen.Bounds;
Bitmap screenCap = new Bitmap(rec.Width, rec.Height, PixelFormat.Format64bppArgb);
Graphics myScreen = Graphics.FromImage(screenCap);
myScreen.CopyFromScreen(rec.X, rec.Y, 0, 0, rec.Size, CopyPixelOperation.SourceCopy);
screenCap.Save("D:\\Temp\\MyScreen.Jpeg", ImageFormat.Jpeg);
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
How to get the list of shared folders for a system with a particular IP address over a local area network.
Thanks.
Amit Dey
|
|
|
|
|
|
1. Try to write a subject line that is not totally useless. It surely is not urgent enough to mention in the subject line, and to say that you need help conveys no useful information at all.
2. You forgot to mention that it's homework that you need help with. This is very important for how people will regard your request for help.
gr8est_chic wrote: how do you get the list to subtract the 1st value from the 2nd and so on...
You can't get the list to do that, you have to do it yourself.
Furthermore you haven't supplied enough information for anyone to give you any useful help on how to loop the list. What does "and so on" mean? Do you want to subtract the third value from the result of the first subtraction, do you want to subtract the third value from the fourth and then add all the results, or what?
Are you really sure that you want to subtract the first value from the second? I would think that the opposite would be more logical.
---
b { font-weight: normal; }
|
|
|
|
|
You should have listened in class. It doesnt get much easier than that.
|
|
|
|
|
my dear student chic,
this is Professor Ulhas from university.
When I was told of your cheating on my homework assignment, I unplugged my bowels and let loose an unholy noise so loud, the whole school grounds shook with mighty force. I would have cried had I not already torn my eyes out of their sockets at the sad news that you have cheated on my homework assignment.
I have no choice but to give you a blackened charcoal song of hades for your university grade. Its now failure for you until shiva wreaks desstruction on your cheating soul eternal and ever.
Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas
|
|
|
|
|
1. Try to write a subject line that is not totally useless. It surely is not urgent enough to mention in the subject line, and to say that you need help conveys no useful information at all.
2. You forgot to mention that it's homework that you need help with. This is very important for how people will regard your request for help.
gr8est_chic wrote: Any tips on how to code it?
First determine the data flow in the application. Where does the coordinates for the persons come from? How are they stored / how will you handle them? Where will the output go?
---
b { font-weight: normal; }
|
|
|
|
|