|
Basically, the method I would try would work as follows: First, import the two methods I mentioned in my previous response, along with some way to get the window handle for the window you are trying to log in with (such as FindWindow[^] & FindWindowEx[^]; or EnumWindows[^]). Then, use the method GetWindowThreadProcessId to get the processId (int or uint) of that window. Finally, use that processId to create a hook to listen for the WM_PAINT message. Be sure to post a response to let everyone know if this does or does not work.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I have tried your solution, but it appears not to work for me.
I haven't done any DLL Injection or something equal before, and it appears to be impossible to it only by C#. I will have to use some VC++ code to make this happen, and I don't know this code...
So far Everything is very clear to me, I even made a little project that I will share with you for a while in which you are able to see my progres.
For now I'm only able to place global hook and I have implemented the mouse-version in this project. It works fine and how it should! But the message hooks aren't working and I don't know why!
Since this is too much code to share it in here, I'll share the code with you through a .zip-file. Please note that I have been using "Visual Studio Team System 2008" Version "9.0.21022.8 RTM" and ".NET 3.5 Framework" along only "C#". Atleast you should be able to open the .cs-files with the older version aswell notepad.
Here is the link to my project: http://www.osore-watashi.net/Files/Testing_Form.zip[^]
I hope that the idea is clear: I want to get the messages from notepad in this case. An example of such message is WM_PAINT, WM_NCPAINT, WM_SYNCPAINT, WM_CTLCOLOREDIT and WM_ERASEBKGND. If you know how, please let me know!
I thank those that take the time to look for a solution for this issue.
|
|
|
|
|
I have found something called Managed Windows API. I am currently checking this code to hopefully find an answer to my issue.
Here is a link to it: http://mwinapi.sourceforge.net/[^]
But at this very moment I don't have the solution, so I'm still open for any ideas.
|
|
|
|
|
For now, this framework seems to give me a solution. Though, I haven't had the time to fully check it out, but it seems it will work.
Here I find my solution to solve the problem I think I had: the pointer to the dll-file. Here is a dll-file loaded that does the needed work (I guess) and gets the pointer to it and gives it to the SetWindowsHookEx function.
I will work this out, and as soon as I have it ready, I will give you all the code to manage it. It seems to be pretty hard to do this and it costed me a few weeks already to only find a bit of valuable information...
Keep an eye open, because this week it (normally) will be ready and will solve all your problems!
|
|
|
|
|
Hi all,
I'm sending a large amount of data of TCP/IP, but this causes my GUI to suspend until the send is complete. So I though put it in a delegate, but the result is the same ?? What am I doing wrong??
delegate void sendLines();
...
sendLines updInstance = new sendLines(sendManyLines);
this.BeginInvoke(updInstance);
..
void sendManyLines()
{
...
}
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: but this causes my GUI to suspend until the send is complete
If this is causing the UI to freeze, why not just do the sending on another thread?
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Justin Perez wrote: why not just do the sending on another thread?
mmmm well that is what I'm trying to do, but I must update some of the controls on the form thus I require a delegate not so ??
Can you help me in this regard?
Thanks for the response
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
to keep your GUI alive while a lengthy operation is being processed, you need one or more extra threads (Thread, ThreadPool, BackgroundWorker). Each of those are not allowed to
touch a Control they did not create, to solve that you need to work with Control.InvokeRequired
and Control.Invoke(). You can Google these, or read one of several CP articles on the
subject. I have a smalle example at the end of my Sokoban article.
|
|
|
|
|
Hi,
Is there any way i can store hexadecimal value in a XML and process the document using XMLDocument class.
Code which has problem :
string msg912 = "3...32.076.987897.89012.3073";
msg912 = msg912.Replace('.', (char)28);
string xmlData = "<pre>";
xmlData += "<port>122</port>";
xmlData += "<financialmessage><![CDATA[" + msg912 + "]]></financialmessage>";
xmlData += "";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlData);
a exception is thrown on loading the XML using "xmlDoc.LoadXml". How can process the XML without replacing it.
Thanks in advance.
|
|
|
|
|
I'm guessing it has to do with the unclosed <pre> tag. I could be wrong, as I am not familiar with the CDATA tag you are using.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I would like to write a little helper app to identify pdf files in a shared folder that have been saved as version 1.5, as they should be 1.4 or earlier to be accessible to Acrobat Reader v5
I have been looking at using FileInfo - but I guess the metadata to identify the pdf version is hidden a little deeper?
Can anyone point me in the right direction?
|
|
|
|
|
Hi,
AFAIK PDF files start with an "eye catcher" string that contains the version number.
For 1.5 it is "25 50 44 46 2D 31 2E 35 0D" in hex byte values ("%PDF-1.5"+CR).
So you should open and read the first few bytes and compare.
|
|
|
|
|
//Works like a charm! Ta muchly!
//
Ignore my previous response! Having written and executed my little applet, I didn't get any results.
Which was odd, because I knew there were at least a few of these rogue files. On further investigation, it appears that the string says they are 1.4 - but are being reported on the properties-pdf tab as version 1.5. I'll dig a little deeper and get back to you.
modified on Friday, January 11, 2008 8:14:52 AM
|
|
|
|
|
Happy New Year Everyone!
Please help I am writing a code that searches the Active directory, it first get the list of properties, then use each property name to get its value. I filter the directory searcher by the cn. My problem is that for some people the search doesn't return the "mail" property, this is the property I need most. Please find my code snippet below.
DirectoryEntry de = new DirectoryEntry("LDAP://" + "AFLIFEDC04",
@"aflife\alsql", "perseus", AuthenticationTypes.FastBind);
string[] propertiesFound;
string Email = "";
DirectorySearcher ds = new DirectorySearcher(de);
//Use the users full name to get the email address from directory services
ds.Filter = "(cn=" + FullName + ")";
ds.SearchScope = SearchScope.Subtree;
try
{
SearchResultCollection results = ds.FindAll();
foreach (SearchResult result in results)
{
int a = 0;
ResultPropertyCollection propc = result.Properties;
DirectoryEntry dey = result.GetDirectoryEntry();
propertiesFound = new string[propc.Count];
// Loading all the properties return into the propertieFound array
foreach (string propertyName in propc.PropertyNames)
{
//This where the problem is, for some I get like 38 properties,
//for others I get 34. What is the cause of and what is the
//solution to it.
propertiesFound[a] = propertyName;
a++;
}
}
}
Thank you in advanced for your solutions.
Kind Regards
Mpumelelo Khuzwayo
khuzym
|
|
|
|
|
I ran into this problem a while back, but I don't remember what the problem was, and why you can't return the E-Mail property the way you do other properties. Anyway, here is the code I came up with the return the E-Mail property.
public static string getUserEMail(string fullname)
{
string email = string.Empty;
DirectorySearcher search = new DirectorySearcher();
search.Filter = "(cn=" + fullname + ")";
search.PropertiesToLoad.Add("mail");
try
{
SearchResult result = search.FindOne();
if (null != result)
{
email = (String)result.Properties["mail"][0];
return email;
}
else
{
return "Could not find Email address!";
}
}
catch (Exception ex)
{
return ex.Message;
}
}
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Good Morning Justin
Thank you for your reply, I have tried implementing it, the problem it returns the adspath property and not mail property. I don't know if you hav an idea what is the cause.
Thank you again.
I will keep on trying different things, I have a feeling the problem is very small!
khuzym
|
|
|
|
|
i want to use excel file values in my c# code,how can i get that??????
|
|
|
|
|
Member 4756709 wrote: i want to use excel file values in my c# code,how can i get that??????
Give a little more detail. What is it that you are wanting to do? What have you tried?
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hello,
How can i get IP addess of the computers connected with LAN?
Thank you
Dipak
|
|
|
|
|
and u're acting as a Client/Server
have u tried tcpcliecnt?
more inforamatio will help us to help u
Where there is a will
there is a way (yeh, right, hahaha)
|
|
|
|
|
Thank you for Reply
Yes i am as a client of that LAN. And i want to get all the IP Addresses and Names of the computers connected with the same LAN.
I have tried this way for test:
using System.Net;
String strHostName = Dns.GetHostName();
MessageBox.Show(strHostName.ToString());
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
MessageBox.Show(addr[i].ToString());
}
But it gets only My Computer's IP Address and another one IP address. I think it is mac address. I have put that IP Address on Run "\\121.245.75.159" but i opens my ShareDocs.
Please help me.
Dipak
|
|
|
|
|
Just an idea, but what if you get your own ip address (using the method you described), your own subnet mask[^], and then ping all the possible addresses within that subnet? The link (labeled "subnet mask" will also allow you to ping the other addresses as well). This will work assuming your subnet mask limits the number of possible ip's to a reasonable number (probably less than 2^8 is reasonable.) Hopefully someone else will offer a more efficient way to do this for you, but in the meantime this will work.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
You'll have to go through the entire range of IP addresses, PING each one to see if it responds, and if so, resolve that IP to its host name. There is no one function that you can call to give you the entire list.
|
|
|
|
|
hi
i want to add a eventhandler for a mshtml.ihtmlelement.could any one help me to do this please.
with regards
Balagurunathan.B
|
|
|
|
|