|
before (or should I say after) I try that, maybe you could try reading this[^]
specifically, the 7th line (excluding empty lines)
Life goes very fast. Tomorrow, today is already yesterday.
modified on Friday, June 26, 2009 8:18 AM
|
|
|
|
|
Hi everyone,
Let me ask about some problem.
Is there any way to determine the key press/mouse click is human action or simulation?
If yes, please guide me to the article/links.
Thanks and Regards,
alien
!alien!
|
|
|
|
|
Well, you could perhaps check if the keypresses happen faster than a human could do them, or if the mouse always hits an exact position, but overall, I'd say no.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Some way is there in the Treeview. Suppose if you would like to check whether the operation is perfromed by Mouse/ keyBoard / Unknown, you can do the following
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if (e.Action == TreeViewAction.Unknown)
{
}
else if (e.Action == TreeViewAction.ByKeyboard)
{
}
else if (e.Action == TreeViewAction.ByMouse)
{
}
}
|
|
|
|
|
mutpan wrote: else if (e.Action == TreeViewAction.ByKeyboard)
{
}
else if (e.Action == TreeViewAction.ByMouse)
{...
The query was to know if the key press and the mouse clicks were automated or done by a human.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I cannot think of any way to do this. I'm just curious though, why do you need to know if the events were simulated or normal?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
This is something that comes up in my area of work (games) particularly for MMOs where the "real money traders" put a lot of effort into finding ways to beat the system and generate resources they can sell.
I don't know if you're looking at similar problems, but the only way to really tell is by analysing the mouse movements and clicks, and looking for patterns and other signs.
For example, a very simple hack might click repeatedly on the same points at very regular times, which is easy enough to detect. Of course the gold farmers soon realised this and started adding randomness to positions and times. This is harder to detect, but still possible.
It's also possible to look for patterns, such as the same player doing the same actions for days at a time, or players who never actually play the game, and spend all their time in resource generation. IP address tracking can also be used, since the majority of these operations are in China, and a few other locations in the far east.
It is a big problem, and there isn't a lot of information out there on how best to deal with it. Most companies are developing their own strategies, and there's minimal sharing of knowledge on this. (Unfortunately, I can't say too much on what my own company is doing, as we're releasing our first online game next year...)
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Anyway, Thank all for reply.
My problem is exactly as molesworth said.
I will try to find the strategies.
!alien!
|
|
|
|
|
Win32 sends identical messages for human and software generated input on the normal desktop. While this makes things simpler for software automation (eg automated UI testing), it also makes simply detecting gaming cheats, or preventing malware from clicking through warnings for you, next to impossible. Preventing that is the reason behind the secure desktop in Vista.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I'm making an application in C# and would like it to run on devices of different resolutions/dpi's. However, the default scaling leaves the images looking blocky and unclear.
Is there a method to scale images that gives nice results?
|
|
|
|
|
I would like to change the border color of Text Box in C#. I subclassed the TextBox control and override the WndProc function to catch the PAINT Messages to draw the border with my color.
But the border color hasn't changed, still i am getting the default border color of text box that is Black color. The same code works fine with .NET 1.0 but not working in .NET 2.0 and the latest versions.
Can anyone tell what is the difference between .NET 1.0 painting and .NET 2.0 painting for TextBox?
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;
class MyTextBox : TextBox {
private const int WM_NCPAINT = 0x85;
private const int WM_ERASEBKGND = 0x14;
private const int WM_PAINT = 0xF;
[DllImport("user32.dll")]
static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, int flags);
[DllImport("user32.dll")]
static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
protected override void WndProc(ref Message message) {
base.WndProc(ref message);
if (message.Msg == WM_PAINT)
{
IntPtr hdc = GetDCEx(message.HWnd, (IntPtr)1, 1 | 0x0020);
if (hdc != IntPtr.Zero) {
Graphics graphics = Graphics.FromHdc(hdc);
Rectangle rectangle = new Rectangle(0, 0, Width, Height);
ControlPaint.DrawBorder(graphics, rectangle, Color.White, ButtonBorderStyle.Solid);
message.Result = (IntPtr)1;
ReleaseDC(message.HWnd, hdc);
}
}
}
}
Thanks in advance
|
|
|
|
|
I just tried your code with .NET 3.5 using VS 2008 and it worked ok, except that when I mouse over the textbox the border reverts to its original color
If its just the border style/color you want to change whats wrong with setting the BorderStyle and BorderColor properties?
|
|
|
|
|
There is no border color property for TextBox. The code which i shown in my initial post works fine if i put my textbox in the windows form. But it is not working with the custom form which i derived it from System.Windows.Form.
|
|
|
|
|
mutpan wrote: There is no border color property for TextBox
My bad.
Have you considered writing your own implementation of Textbox, or looking what else is around other than the native one.
|
|
|
|
|
J4amieC wrote: when I mouse over the textbox the border reverts
The textbox has all sorts of wierd behaviour when it comes to painting. In the past I've tried overriding OnPaint for a few things and it never behaved as expected. IIRC I gave up - always a good policy!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Textbox behaves diffewrently because the .NET implementation is just a wrapper around the native draw code. For starters, to even get OnPaint to be called you have to SetStyle(ControlStyle.UserPain,true) but it still behaves weirdly.
In actual fact, online advice is to override WndProc as the OP has already done.
|
|
|
|
|
J4amieC wrote: is just a wrapper around the native draw code
Yeah, I figured that out way back when I was doing battle with it. It's about time they gave us a shiny new .net one . I did start creating one from scratch but I found quickly that it's far from trivial and wasn't worth the effort at the time.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hello
I'm building a windows application for our company, which checks the state of a list with web links. The proxy settings in our company are setted by an automatic configuration script. Is it possible to use these settings to st up WebRequests?
WebProxy proxy = WebProxy.GetDefaultProxy(); <- doesnt work.
Thanks for your help!
Best regards
succo
|
|
|
|
|
hi i m new in C#, and i have a dll, in dll some function are just like
public void hndRecordSave(project.frmMain f)
Member of BusinessLayer.Business
in which record save as data from textbox or combo box of a form, i just wana to know how this dll created, what the functioning behide that.
-----------------------------
i thinks u all don't understand my prob, so i m again trying..
i hav a project in which someone uses a dll, and suppose in this project a form (frmmain) contain some textboxes, combobox and some button also as save, delete..
and clicking on save- programmer just call
objDLL.hndRecordSave(this); //// as form name is same frmMain
and record saved
i just wana to know at ceating dll how he manage all form in function.
thanks again. hope u all understand what i want to say.
modified on Friday, June 26, 2009 5:54 AM
|
|
|
|
|
A dll can be created in C# by creating a Class Library project if that's what your asking.
Whoever wrote that dll is not the person to learn from though, passing a Form as a parameter is bad enough, but into a BusinessLayer
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
thanks for replying, but how can i create same dll and implement it again.
thanks
|
|
|
|
|
Use Reflector and hope the assembly is not obfuscated.
|
|
|
|
|
If it's a .net assembly, you may be able to disassemble it using Reflector[^]. To create your own, just choose Class Library when selecting the project type when creating a new project.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
With one of my customers I have this really weird problem. I just describe it in a bunch of facts, to keep it short.
* It's an application that communicates with a weighbridge and visualises the current weight of the brigde (serial communication RS232) --> the scale sends over the weight continuessly
* The customer can make a ticket containing information about the transporter and the kind of product that's been transported
* When the ticket is saved, it is also printed on the connected USB HP LaserJet (P1006) printer
* pc/dev configuration: Windows XP SP3, VS2008 (C#)
The problem is that sometimes for an unknown reason, the printer does not print. The ready-LED keeps blinking but nothing happens. The application continues to work normal. When this happens, the customer opens the print cartridge cover and closes it again and then the printer starts the print job.
It's a problem that I've seen happening but I can not reproduce it.
it's not related to the data (if you print the ticket afterwards, no problem)
It's not related to hardware (did replace PC, Printer (from other brand), USB Cable without success)
I did rewrite my app so that the serial communication happens in a backgroundworker and generates an event only if the current weight is different from the previous value (this delegate for this event updates the GUI)
I did create also another backgroundworker to create and print out the document (System.Drawing is used to do this; did use Crystal Reports in the past but same problem there)
The data is stored in XML files
What I also did was unchecked the flag 'allow the computer to turn off this device to save power' for all USB Root Hubs. --> I don't have any results of that yet, since I did this just yesterday.
At this moment, I don't know where to search anymore. I can not reproduce it, I can not find any kind of pattern in the occurence of this problem, I can not tell what might cause the problem.
In summary: is there anybody with some suggestions
modified on Friday, June 26, 2009 3:56 AM
|
|
|
|
|
Sounds like an issue with the printer itself - possibly there's a bug in its software that you're hitting.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|