|
Hi,
I have a problem with my CTRL+C Keylogger.
It's an application which listens (hook) for CTRL+C and if it is triggered, it searches for the clipboard text (if it is text).
It works perfectly, but it is one step behind.
eg. if I have a text: abc def geh
and I first copy abc, nothing happends. If I then copy def, it has abc in the clipboard.
So, then I made this thread on tek-tips and a person there gave me a suggestion that maybe my application triggers too fast (eg. tries to use the clipboard, befire it's filled).
I then tried a thread.sleep(1000)..
This worked (on vista), but not on xp sp3.
Here is the code
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
{
int vkCode = Marshal.ReadInt32(lParam);
if (Keys.C == (Keys)vkCode && Keys.Control == Control.ModifierKeys)
{
Thread.Sleep(1000);
if (iData.GetDataPresent(DataFormats.Text, true))
{
frm2.setSearch(iData.GetData(DataFormats.Text, true).ToString());
}
}
}
Olav Alexander Mjelde
|
|
|
|
|
Olav Alexander Mjelde wrote:
So, then I made this thread on tek-tips and a person there gave me a suggestion that maybe my application triggers too fast (eg. tries to use the clipboard, befire it's filled).
That's correct
Olav Alexander Mjelde wrote:
I then tried a thread.sleep(1000)..
That's a very unreliable way.
Here's the proper way, register yourself as a clipboard viewer and get notified of changes in the clipboard:
http://www.radsoftware.com.au/articles/clipboardmonitor.aspx[^]
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi. I googled this but havent found anything usefull. Now, i turn to you. The CP community.
I'd like to convert some JPEG files to TIF and compress them with CCITT Fax 4.
For an example take IrFan View. You open a file in Irfan and then click "Save as...". Irfan has a plugin for this (i guess) in its app. folder\plugins... but dont know which one. Even if i'd know, i dont know how to use .dll files.
So, does anyone know how to convert, i mean, compress a file into CCITT Fax 4 (b&w)?
Thanks in advance!
Regards,
Matjaž
|
|
|
|
|
http://www.vbdotnetforums.com/graphics-gdi/19552-group-4-compression-tif.html
|
|
|
|
|
Wow. Thank you Mark! This was really helpful.
Thanks again!!
Regards,
Matjaž
|
|
|
|
|
Ah np, i remember seeing the option when I was messing around with TIFFs for some other reason.
|
|
|
|
|
Hi,
Is it possible to take backup of Device Drivers programatically ?
Regards......
|
|
|
|
|
Hi
I would like to read the content of XML in c#
I’ve main XML that contain several include to additional xml
I’m trying to read nodes from main XML but I always got zero,
In case I’m copy the sub XML content to main XML it work
I know I can do include in XML another XML and it should be the same as writing the text in the same XML
What could be the problem?
See code below
Main XML
<tests>
<num_of_tests>4</num_of_tests>
<include href="test_rx25ghz.xml" />
<include href="test_rx35ghz.xml" />
<include href="test_tx25ghz.xml" />
<include href="test_tx35ghz.xml" />
</tests>
SUB XML
<test>
<testname>RX</testname>
<description>RX test on 2.5Ghz</description>
<frequency>250475000</frequency>
</test>
C# code
private XmlDocument m_xDoc;
private XmlElement m_Root;
m_xDoc = new XmlDocument();
m_xDoc.Load(m_mainXMLTest);
m_Root = m_xDoc.DocumentElement;
m_nodeItems = m_Root.GetElementsByTagName("test");
the problem is
m_nodeItems.count = 0
Please advice
Ronen
|
|
|
|
|
If the performance is critical, what should I choose:
1. A comfortable and flexible solution: an array TSymbol[] , where Symbol is a struct {int a, int b} and access it via arr[n].a, arr[n].b
OR
2. Redesign everything and give up a generic class of type <TSymbol> : an array int[][] , and access it via arr[n][0], arr[n][1]
In fact I ask about a C# difference between
int[] arr = new int[2];
arr[0], arr[1] and
Symbol[] s = new Symbol;
s.a, s.b
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hi,
since both (int and structs) are value types, they are stored at the stack. So accessing an int or an struct is an access to the fast stack. So I would say it doesn't matter, but I really don't know it exactly.
Regards
Sebastian
|
|
|
|
|
SeMartens wrote: since both (int and structs) are value types, they are stored at the stack.
An array of some (value) types results in a reference type, though.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
So, let me guess writing [][] (Jagged array) refers to two "different" seperate arrays. Then using the struct would be faster because you are only one array reference instead of two?
Am I totally wrong?
|
|
|
|
|
SeMartens wrote: So, let me guess writing [][] (Jagged array) refers to two "different" seperate arrays.
Actually, a jagged array [n][m] will create n*m arrays.
SeMartens wrote: Then using the struct would be faster because you are only one array reference instead of two?
MSDN[^] writes a bit about performance of value and reference types. If value types have a lot of members, that it might be better to use a reference to this type using the ref keyword. Of course this is only applicable if you want to allow modification of the value type. Reference types have some GC overhead though.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Not 100% cetain, but with modern processors and compilers there should be negligible odds. Any given structure is of constant size, and the offset into the structure for any given member is also constant. The array indexing is therefore trivial, and the member offsetting calculable at compile-time. e.g. If iterating in a for loop, it might typically add the struct size onto the index each time, which was originally primed with the address of the member variable in the initial array element.
|
|
|
|
|
|
I have made changes to code with the help of another developer...
This code does not seem to be working fine when there are multiple <NODE> tags
Do you see what the problem is please?
The xml is below:
Thanks
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("XMLFile1.xml");
XmlNode bNode = xmlDoc.SelectSingleNode("BIBLE");
string strBibleClientID = xmlDoc.DocumentElement.GetAttribute("CLIENT_ID");
string strBibleMatterID = xmlDoc.DocumentElement.GetAttribute("MATTER_ID");
string strBibleDocNumber = xmlDoc.DocumentElement.GetAttribute("DOCNUMBER");
XmlNodeList nodes = xmlDoc.SelectNodes("/BIBLE/NODE");
foreach (XmlNode node in nodes)
{
XmlNodeList docs = node.SelectNodes("./DOC");
foreach (XmlNode doc in docs)
{
string clientID = doc.Attributes["CLIENT_ID"].Value;
string matterID = doc.Attributes["MATTER_ID"].Value;
string docName = doc.Attributes["DOCNAME"].Value;
string docNumber = doc.Attributes["DOCNUMBER"].Value;
}
}
<?xml version="1.0" encoding="utf-8" ?>
<BIBLE MATTER_ID="00123" CLIENT_ID="12345" DOCNUMBER="65476">
some text here
<DOC CLIENT_ID="12345" MATTER_ID="00123" DOCNAME="first Document name" DOCNUMBER="12346">
</DOC>
<NODE>
<![CDATA[some text:]]>
<DOC CLIENT_ID="12345" MATTER_ID="00123" DOCNAME="another name" DOCNUMBER="12346A">
</DOC>
</NODE>
<NODE>
<![CDATA[Authorisations:]]>
<NODE><![CDATA[something:]]>
<DOC CLIENT_ID="12345" MATTER_ID="00123" DOCNAME="second document name" DOCNUMBER="12347">
</DOC>
<DOC CLIENT_ID="12345" MATTER_ID="00123" DOCNAME="third document name" DOCNUMBER="12348">
</DOC>
</NODE>
</NODE>
<NODE>
<![CDATA[ok data:]]>
<DOC CLIENT_ID="12345" MATTER_ID="00123" DOCNAME="a name here" DOCNUMBER="12345">
</DOC>
</NODE>
</BIBLE>
|
|
|
|
|
Hi,
maybe you have to use "//DOC" instead of "./DOC"?
Regards
Sebastian
|
|
|
|
|
|
I'm in the process of learning C#/.NET & UML, having previously done many years of embedded C/C++, with a smidgen of UML and VS6/MFC. I'm doing a home project, and can now at least put *simple* windows apps together. I want to now do a good object oriented design for a C# project - I've got Visual Paradigm for UML to help me here.
The problem I have is this: How best to model in an OOD the windows infrastructure elements of the design:-
* GUI components. Forms, buttons, text windows, etc etc.
* Event handlers. Being event-drive they just "pop up from nowhere" and then disappear again.
* How the underlying infrastructure knits it all together.
I can imagine that if I have a "PressMeHere" button, then it would be an object having a "PressMeHere_ButtonClick" event handler as one of its public methods, but it would be nice to see what it is in the system that invokes this method, and how the major .NET components interact.
Can anyone point me to a UML modelling of a typical .NET Windows application? Something that clearly identifies the demarcation between .NET/Windows infrastructure, versus application. I'd be very grateful if anyone can.
modified on Wednesday, January 28, 2009 9:10 AM
|
|
|
|
|
Hello All,
Here I have a problem with downloading a file.
I have a file "Sample.dat" of 600Mb in my IIS root directory.
Now I have a client application to download file to local drive.
am using DownloadFileAsync(URI,file);
it takes 2 mins to download the complete file but while downloading the file if delete the source file in server it is still getting downloaded, how is it possible?
ashok
|
|
|
|
|
ashok_rgm wrote: it takes 2 mins to download the complete file
2 mins for 600 MB.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
It is in LAN..
ie,. I have configured my IIS to my IP, and downloading from different system in same network.
ashok
|
|
|
|
|
You are not giving a URL to user for download.
But you are pushing a download to user.
In this case, file content is buffered in system memory and the content is pushed from memory only(not from disk).
Now if you delete the Source there will be no issue to one downloading the file.
|
|
|
|
|
Hi alll
I have a windows application using c# in framework 3.5(VS 2008)..
My starting page is Form1...i have put one ShowImage button in that..now on click of that ShowImage button 2 things should happen:
1.form1 should get closed
2. ShowImageForm should get opened
if i give
this.close();
Form Main1;
Main1 = new ShowImage();
Main1.Show();
the entire application is getting closed..
how can i do this?
|
|
|
|
|
may be u can use this.hide();
rahul
|
|
|
|