|
I don't want to use any external programs or interfaces, i just need a solution without any user actions to obtain an image.
Thanks.
|
|
|
|
|
Hi,
I need to send right mouse click from within my program (C#.NET) to windows, so it will look like the user has right/left clicked with the mouse somewere on the desktop.
Any help will be highly appreciated
roy
|
|
|
|
|
I didn't try this, but it should look like:
<br />
[DllImport("user32.dll")]<br />
public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam)<br />
...<br />
public const UInt32 WM_LBUTTONDOWN = 0x201;<br />
public const UInt32 WM_LBUTTONDOWN = 0x202;<br />
...<br />
private void FakeClick( Control TargetControl, Point MouseLocation )<br />
{<br />
SendMessage(TargetControl.Handle,WM_LBUTTONDOWN,0,(MouseLocation.Y * 0x10000) + MouseLocation.X);<br />
SendMessage(TargetControl.Handle,WM_LBUTTONUP,0,(MouseLocation.Y * 0x10000) + MouseLocation.X);<br />
}<br />
In case that you don't have target Control try:
<br />
...<br />
public const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;<br />
public const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;<br />
...<br />
[DllImport("user32.dll")]<br />
private static extern void mouse_event( UInt32 dwFlags,UInt32 dX,UInt32 dY,UInt32 dwData,IntPtr dwExtraInfo);<br />
...<br />
public static void FakeClick(Point MouseLocation )<br />
{<br />
Cursor.Position = MouseLocation;<br />
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, new System.IntPtr());<br />
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, new System.IntPtr());<br />
}<br />
|
|
|
|
|
tnx. works just fine
|
|
|
|
|
Hello!
All icons of my toolbox are corrupted now (they looked fine before). Most of them now display a black mouse cursor, a paper sheet or an empty, gray field.
Have a look at this screenshot: Toolbox Bug[^].
Any idea how to get the correct icons back again?
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
Hi,
i have a datatable and have added new records to it.
I'm then applying an update using an adapter to send the records to the database:
mySqlDataAdapter.Update(myDataTable)
I know this Update function returns an integer base on the number of records successfully updated.
But for the ones that werent, is there a way of tracing which ones they were?
Andy
|
|
|
|
|
you have to play a bit with the RowState
I means, as you know, a DataTable is a collection of DataRows, each DataRow has a property called DataRowState, this value can be, CurrentRows, Inserted, Deleted... and so on.
In the moment you call the AcceptChanges of the DataSet ( or DataTable ) the DataRowState will be Current Rows, so you have to play with this before calling the DataAdapter.Update or the dataTable.AcceptChanges().
I send you code I did as sample for a fellow.
I hope it works
<br />
dstExample dst = new dstExample();<br />
dstExample.MyTableRow rowExample ;<br />
<br />
rowExample = dst.MyTable.NewMyTableRow();<br />
rowExample.MyField = "Field";<br />
dst.MyTable.Rows.Add ( rowExample );<br />
<br />
string s = rowExample.RowState.ToString();
<br />
string t = dst.MyTable.Rows [ 0 ].RowState.ToString();
<br />
<br />
bool h = dst.HasChanges ( );
bool j = dst.HasChanges ( System.Data.DataRowState.Added );
bool a = dst.HasChanges ( System.Data.DataRowState.Modified );
<br />
<br />
dst.MyTable.Rows [ 0 ].AcceptChanges();
<br />
h = dst.HasChanges ( );
j = dst.HasChanges ( System.Data.DataRowState.Added );
<br />
t = dst.MyTable.Rows [ 0 ].RowState.ToString();
<br />
rowExample = dst.MyTable.NewMyTableRow();<br />
rowExample.MyField = "Field";<br />
dst.MyTable.Rows.Add ( rowExample );<br />
<br />
h = dst.HasChanges ( );
<br />
rowExample = dst.MyTable.NewMyTableRow();<br />
rowExample.MyField = "Field";<br />
dst.MyTable.Rows.Add ( rowExample );<br />
<br />
dst.MyTable.Rows [ 2 ].AcceptChanges();
dst.MyTable.Rows [ 2 ][ 0 ] = "Value2";
<br />
s = dst.MyTable.Rows [ 1 ].RowState.ToString();<br />
t = dst.MyTable.Rows [ 2 ].RowState.ToString();<br />
<br />
h = dst.HasChanges ( );
j = dst.HasChanges ( System.Data.DataRowState.Added );
a = dst.HasChanges ( System.Data.DataRowState.Modified );
<br />
<br />
Regards
Ricardo Casquete
|
|
|
|
|
Hello!
Just coming in from the side, from the java-side.
Did see how one could cast from a String to an int ...
But how do I do the reverse, cast an int to a string ?
regards, i
"But if thought corrupts language, language can also corrupt thought." -George Orwell
|
|
|
|
|
use the ToString method:
int i = 7;
string s = i.ToString();
string s2 = ((int)7).ToString();
|
|
|
|
|
int myValue = Convert.ToInt32(myString);
string myStringValue = Convert.ToString(myValue);
protected internal static readonly ... and I wish the list could continue ...
-- modified at 10:59 Monday 27th March, 2006
|
|
|
|
|
Hi,
I developed a .dll before on PC, but now I want to reuse this on PDA, how can I do?
Thanks,
Hung.
Hung
|
|
|
|
|
You'll need to compile your dll using the .NET compact framework.
|
|
|
|
|
string zipFileName=@"d:\sample.txt";
System.IO.FileInfo file = new System.IO.FileInfo(zipFileName);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
else
{
Response.Write("This file does not exist.");
}
The above code works pretty good for file download but if I click 'cancel' or 'open' button in the "download" dialog box it shouldn't insert the download time in to the database and if I click 'save' it should save in to database.Is it possible?
SreekanthJ
|
|
|
|
|
Please keep follow-ups in the same thread.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I have the folowing code for SAVE button''s event handler of my Window's form's binding navigator. Now, When I change any row, add or delete and after that when I save, it shows no error and for the whole time the application is alive, the data grid is reflecting my actions. Ok, but after that when I close the form and then Start that application again, I see no changes has been made to my database and datagridview is showing the old data. When I explore the physica database after that, I see no changes at all. I have tried a lot of ways to find out why !! I also experimented with both value (True and false ) of the Table Adapter property : GenerateDBdirectMethods.
try
{
this.Validate();
this.jobBoardsBindingSource.EndEdit();
this.job_BoardsTableAdapter.Update(myDataSet.job_Boards);
lblStatus.Text = "Job boards Updated Successfully : " + DateTime.Now.ToString();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message,"Update failed");
}
|
|
|
|
|
Hi,
I have many projects in my solution..
All have been localized ...
The problem which i am facing is in one project, i.e. when i change the language for the application at run time.. every thing works fine except that none of the form under this project gets localized...
ex: Solution
Localization Manager
Project 1
Project 2
Project 3
Project 4
Now forms of project 4 does'nt show up culture specific captions where as all other form does that fine!!!
What is the cause of the problem and how could this be solved????
Thanks in Advance
Aditya
|
|
|
|
|
I don't know if it can be, but we in a project have problems with the Resources files, because the data inside weren't refreshed. So we did changes but we didn't see the text.
The solution was to create a Pre-Build Event to Delete all the "bin" and "obj" of the projects that contained .rex and .resources files.
with this everytime we compile the files were deleted and then refreshed.
Regards
Ricardo Casquete
|
|
|
|
|
I have a textbox on my form and I want if you enter a certian thing, the for will do something. Here is what it is:
I have the textbox and a button. If you type the following data in textbox, the button will become enabled (its disabled from form load)
1)type Blackcomb into the textbox and this will display BlackcombForm when button is clicked
2) type in XP into the textbox and it will load XPForm when button is clicked
3) type in Chicago into the textbox and it will load ChicagoForm when button is clicked
how would you do this?
In the end we're all just the same
-- modified at 8:57 Monday 27th March, 2006
|
|
|
|
|
in click of button write this code
textBox1.Text += "Form";
in event of textbox TextChanged write this code
if (textBox1.Text == "")
{
button1.Enabled = false;
}
else
{
button1.Enabled = true;
}
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
assuming that all your forms have been declared in a namespace called "WindowsApplication" you could do something like this:
In the click event handler of the button:
((Form)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("WindowsApplication." + textBox1.Text + "Form")).ShowDialog();
In the TextChanged event handler of the textbox:
button1.enabled =
textBox1.Text == "Blackcomb" || textBox1.Text == "XP" || textBox1.Text == "Chicago";
|
|
|
|
|
I think a nice solution could be done using a bit of Reflection...
<br />
<br />
string inputFormName = this.textBox1.Text;<br />
string CurrentFormAssemblyQualifiedName = this.GetType().AssemblyQualifiedName;<br />
<br />
string TargetFormAssemblyQualifiedName = CurrentFormAssemblyQualifiedName.Replace ( this.Name, inputFormName );<br />
<br />
System.Type formType = System.Type.GetType ( TargetFormAssemblyQualifiedName );<br />
<br />
if ( formType != null )<br />
{<br />
System.Windows.Forms.Form frm = ( System.Windows.Forms.Form )Activator.CreateInstance ( formType );<br />
frm.Show (); <br />
}<br />
<br />
This Example is working in my PC, because I have tested... It is based in the fact that both forms are in the Same project and folder ( means Exactly Namespace, and the TextBox has exactly the name of the Form... so you'll have to play a bit with it... )
Good Luck
Ricardo Casquete
|
|
|
|
|
Hi,
I am working on a website, in which i need to call a stored procedure to
update some fields of the database at regular intervals, say after every 30 days.
I am using Timers to call the stored procedure after the specified interval.
But i am in a fix as to where to place this code, so that it automatically gets executed on the server.
Or is there any other procedure i can follow to accomplish this task?
Thanks
|
|
|
|
|
if you're using SQL Server, why not just set it up on the server as a recurring job that runs every 30 days? 30 days is a LONG time to wait for an app to run for testing purposes. And even though you could probably simulate it another way, it's still not the same as waiting for it to actually run unattended.
My Music | My Pics | My Articles
BlackDice
|
|
|
|
|
I tried to use job scheduling, but noticed that the time period needs to be set, whereas, in my website, i might need to change the time interval... its could change to 40days or any other time interval.
The main purpose is to implement caching.
The records in the database would expire after a certain time interval and new records would be inserted.
I need to execute a stored procedure that would update the database and set the records as expired after the specified time interval.
Is there any possiblity to set the time period through my C# code?
Is there any other alternative to timers ?
|
|
|
|