|
hello,
please help me,
actually I have 3 questions:
1. how can I know programatically when a click has occured on the desktop? (or another application, other than mine).
2. how can I perform a click or move the mouse programatically or perform keyboard clicks etc.
3. how do programs like team viewer send the image of the desktop so efficiently?
I know they somehow capture only the changes in the client's screen. do they read the changes made in every pixel and send only those?
or is there something else?
if this is the case, how can I read the information in each pixel on the screen?
Thanks alot in advanced!
-Ben
|
|
|
|
|
asizo wrote: how can I know programatically when a click has occured on the desktop? (or another application, other than mine).
This might help in Getting mouse click outside your application:
Processing Global Mouse and Keyboard Hooks in C#[^]
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Hiii,
I have a form which contains two dynamic rows in which 1st row contains 2 lebels , 2 text boxes and 2 Buttons namely ADD & REMOVE . now i want to add and delete the dynamicaly created rows Onclicking the perticular ADD and DELETE button that dynamic row shuld b created or deleted .
|
|
|
|
|
Sounds easy enough. What have you tried ? This is not a web project, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have tried the following code....
private void GenerateTable1()
{
Table table = new Table();
table.ID = "Table1";
Page.Form.Controls.Add(table);
const int colsCount = 6;
TableRow row = new TableRow();
for (int j = 0; j < colsCount; j++)
{
TableCell cell = new TableCell();
if (j == 0 || j == 2)
{
Label lbl = new Label();
//lbl.ID = "LabelRow_" + 0 + "Col_" + j;
if (j == 0)
{
lbl.Text = "Acc No";
}
else
{
lbl.Text = "Vol";
}
cell.Controls.Add(lbl);
row.Cells.Add(cell);
}
else if (j == 1 || j == 3)
{
TextBox tb = new TextBox();
//tb.ID = "TextBoxRow_" + i + "Col_" + j;
cell.Controls.Add(tb);
row.Cells.Add(cell);
}
else if (j == 4)
{
Button btn = new Button();
btn.Text = "Add";
//btn.Attributes.Add("onclick", "MyFunction()");
cell.Controls.Add(btn);
row.Cells.Add(cell);
//btn.Attributes.Add("onclick", "this.visible = 'false'");
//btn.Click += new EventHandler(this.Button1_Click1);
}
else
{
Button btn = new Button();
//btn.ID = "ButtonRow_" + i + "Col_" + j;
btn.Text = "Remov";
cell.Controls.Add(btn);
row.Cells.Add(cell);
}
}
table.Rows.Add(row);
}
=====================================================================
now I want that the dynamicaly created button ADD should add next row of same kind and dynamicaly created button REMOV should delete perticular row..
plz help me...
|
|
|
|
|
Hi,
I am unfortunately not familiar with single bits and have now the problem that I have to write single bit values in an integer value.
The bit masks look like:
Value# Bit Mask
1 2-0 00000007H
2 5-3 00000038H
3 8-6 000001C0H
4 15-9 0000FE00H
5 22-16 007F0000H
6 29-23 3F800000H
Bit 30-32 are unused.
Does anyone know how can I set these six values - maybe as short example?
Many thanks! Daniel.
|
|
|
|
|
You mean like this?
int x = 0;
x |= 7;
x |= 0x3F800000;
x ^= 0x38;
x &= ~7;
|
|
|
|
|
thank u harold!
but sorry, i can not understand your solution because you use always 'x' as variable and overwrites therefore all previous values.
can you give me more details?
so far, i can read the values i.e.:
int[] fieldvalue = new int[6];
fieldvalue(0) = (67637321 & 0x7) >> 0;
fieldvalue(1) = (67637321 & 0x38) >> 3;
fieldvalue(2) = (67637321 & 0x1c0) >> 6;
fieldvalue(3) = (67637321 & 0xfe00) >> 9;
fieldvalue(4) = (67637321 & 0x7f0000) >> 16;
fieldvalue(5) = (67637321 & 0x3f800000) >> 23;
so the first three values are set to 1 and the last three to 8.
how can i now set the second value i.e. to 2? or in other words: how do i get the int value 67637321 if i have as first three value 1 and as last three 8?
many thanks!
|
|
|
|
|
int value = fieldvalue[0] | (fieldvalue[1] << 3) | (fieldvalue[2] << 6) etc
Just shift the bits back to their original position, and OR them together.
|
|
|
|
|
thanks a lot! thats exactly what i need!
i looked for it so long and its great to get so quick an answer here.
modified on Sunday, September 6, 2009 6:34 PM
|
|
|
|
|
Hi,
here are some elementary operations:
1.
bitnumber to bitmask: mask=1<<number;
inverse mask:="" inversemask="~mask;
2.
bitnumbers" to="" bitsmask:="" mask="(1<<(numberHi+1))-(1<<numberLo);" example:="" 2="" and="" 0="" yield="" 7
3.
hex="" output:="" string="" s="number.ToString("X8");
4.
extract" bit="" from="" number:
bool="" bitisset="(value" &="" mask)!="0;
5.
extract" bitfield="" number:
int="" fieldvalue="(value" mask)="">>bitnumLo;
6.
replace bit in number:
mask=1<<bitnum;
notmask=~mask;
value=value¬mask;
if (newbitset)="" value|="mask;
7.
replace" bit="" field="" in="" number:
mask="(1<<(bitnumHi+1))-(1<<bitnumLo);
notmask=~mask;
value=(value¬mask)" |="" (newfieldvalue<<bitnumlo);
btw:="" using="" more="" parentheses="" than="" strictly="" necessary="" to="" keep="" expressions="" unambiguous="" for="" human="" reading.
=""
<div="" class="ForumSig">Luc Pattyn
|
|
|
|
|
i have create rdlc report in c#
---------
For example
my report contains textbox like and it's value is
=First(Fields!FirstName.Value)
data source have more then 100 student's(First Name) records.......but reportviewer display only one student's "FirstName"
modified on Sunday, September 6, 2009 12:38 PM
|
|
|
|
|
You paste the control into RDLC and hope it will replicate automatically.
Place the textbox inside a List or Table . And also make its value as Field!FirstName.Value(just leavethe First() out of the value)
You are done.,. .
|
|
|
|
|
Hi Abhishek Sur
Thankz
now it is working
|
|
|
|
|
Hi All,
I have a c# winforms application.
I want to give the relogin feature with a full logout and
relogin again.
so I need to start a process after I close the current process.
Today I implement this code:
<br />
Process process = Process.GetCurrentProcess();<br />
<br />
process.Close();<br />
<br />
Process reloginProcess = new Process();<br />
<br />
reloginProcess.StartInfo.Arguments = string.Format("{0} {1}", _userName, _password);<br />
<br />
reloginProcess.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + @"g2gg2.exe";<br />
<br />
reloginProcess.Start();<br />
<br />
In some stations(all win xp) I get exception, I think its because the first process fail to close.
Do you have a better way to start the second process (File + Arguments )
Thanks!!!
Ronen
|
|
|
|
|
I think it would be a good idea if you read up on what a process is. And then changed your plan somewhat.
Member 3722261 wrote: Process process = Process.GetCurrentProcess();
process.Close();
Process reloginProcess = new Process();
Doesn't this strike you as at all unlikely to work?
What happens when you stop the current process?
What should execute any further instruction when the process which is executing the instructions is no longer running?
Please, do not go near any buttons marked "Do not, under any circumstances, and I mean any circumstances, press this button. I mean it. The world will end if this button is pressed. So don't press this button." - you strike me as the kind of person who views that as a challenge...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks! or something...
So what is the best implementation to start a new process at the
end of the current one?
Thanks again.
Ronen
|
|
|
|
|
Member 3722261 wrote: what is the best implementation to start a new process at the end of the current one?
Did you find out what a process is?
What happens when you stop the current process?
I'll give you a hint: In the previous question, replace "stop" with "saw off" and "current process" with "branch you are sitting on".
Re-think what you are trying to do. Stopping a process (particularly the current one) is not a solution to your problem, it is a whole new world of pain all of it's own. Think about what you are trying to achieve, and how you would do it in the real world - ignore computers. If you want to read a different book, you don't start by burning down the library to get rid of the previous one, do you?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I guess I dont know much about process as you... but still!!!!!
Thanks for your help!
|
|
|
|
|
OriginalGriff,
I'm using close not Kill.
Close - Frees all the resources that are associated with this component.
so what is so wrong by opening a new process as the last action of current process. I dont think its like your library folk tale .
Thanks!
|
|
|
|
|
Kill is intended for non-gui processes, and for abnormal termination. See documentation[^]
Close[^] does much the same thing (normally after CloseMainWindow) but does not loose resources.
You still cannot close or kill your own process! You can restart it, but if you close or kill it it stops existing.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
You can restart it, but if you close or kill it it stops existing. <br />
You will be amazed by the things you can do after calling currentProcess.close().
Check it out...
Thanks!
|
|
|
|
|
Hi,
I think System.Windows.Forms.Application.Restart() is what you are looking for. The docs explain the intended usage.
Alan.
|
|
|
|
|
Hi,
but I think that Application.Restart wont help me because my process has alot of static "junk" that I want to clear. that the reason I need to start a new process.
Am I right?
Thnaks!
|
|
|
|
|
Hi,
I've no idea what you mean by static junk. Please clarify.
Alan.
|
|
|
|