|
You last visited: Today at 08:48
Advertisement
Quiz.
Discussion on Quiz. within the CO2 Programming forum part of the Conquer Online 2 category.
01/03/2009, 12:18
|
#1
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
Quiz.
Hello.... i got an question. Is there any way that C# can use "right click" or press a key , like "F1" or any others...?
|
|
|
01/03/2009, 12:28
|
#2
|
elite*gold: 0
Join Date: Sep 2008
Posts: 490
Received Thanks: 595
|
Quote:
Originally Posted by alexbigfoot
Hello.... i got an question. Is there any way that C# can use "right click" or press a key , like "F1" or any others...?
|
Send/PostMessage API can do that but as you're in CO Programming section that wont suit your needs, because that gets you send to clickjail.
Heres a quiek google find:
Code:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class Form1 : Form
{
[DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
private const int MOUSEEVENTF_RIGHTUP = 0x10;
public Form1()
{
}
public void DoMouseClick()
{
//Call the imported function with the cursor's current position
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
//...other code needed for the application
}
That'll click on current position.
Google some more ^_~
|
|
|
01/03/2009, 19:43
|
#3
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
searched...nothing found...any other ideas?
|
|
|
01/04/2009, 19:01
|
#4
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
no one knows?
|
|
|
01/05/2009, 06:14
|
#5
|
elite*gold: 0
Join Date: Apr 2006
Posts: 23
Received Thanks: 29
|
Quote:
Originally Posted by _fobos_
Send/PostMessage API can do that but as you're in CO Programming section that wont suit your needs, because that gets you send to clickjail.
|
I thought it was only click jail if u sent to a background window? If im wrong, bummer, if im not, then C# has the SendKeys package as well, which can be used for sending keyboard presses.
|
|
|
01/05/2009, 18:30
|
#6
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
ok...thx a lot but...how can i make the application to get what buttons are pressed in that moment...?
|
|
|
01/06/2009, 19:15
|
#7
|
elite*gold: 0
Join Date: Sep 2008
Posts: 490
Received Thanks: 595
|
Quote:
Originally Posted by Origonal
I thought it was only click jail if u sent to a background window? If im wrong, bummer, if im not, then C# has the SendKeys package as well, which can be used for sending keyboard presses. 
|
I've tried Send/Postmessage with client on top and got me clickjailed, tried on top and in background both same result
|
|
|
01/07/2009, 07:12
|
#8
|
elite*gold: 0
Join Date: Apr 2006
Posts: 23
Received Thanks: 29
|
interesting, ive made a simple program to let me pot with shift key awhile ago, it may have been before clickjail was implemented (less than 2-3 months?) as i had no problems with it.
|
|
|
01/08/2009, 14:16
|
#9
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
how can i send mouse clicks like right click? i got all about sendkeys.
|
|
|
01/08/2009, 22:05
|
#10
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
nayway..nvm i`ll just use AHK.
|
|
|
01/08/2009, 22:33
|
#11
|
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
|
If you want mouse clicks in C# one second...
Code:
public class Mouse
{
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetCursorPos(int X, int Y);
[DllImport("user32.dll")]
public static extern void mouse_event(uint dwFlags, long dx, long dy,
uint dwData, IntPtr dwExtraInfo);
public static void Move(ushort xpos, ushort ypos)
{
SetCursorPos((int)xpos, (int)ypos);
}
public static void LeftClick()
{
mouse_event(0x02, 0, 0, 0, IntPtr.Zero);
mouse_event(0x04, 0, 0, 0, IntPtr.Zero);
}
public static void LeftClick(ushort xpos, ushort ypos)
{
Move(xpos, ypos);
LeftClick();
}
public static void LeftDrag(ushort to_x, ushort to_y)
{
mouse_event(0x02, 0, 0, 0, IntPtr.Zero);
Move(to_x, to_y);
mouse_event(0x04, 0, 0, 0, IntPtr.Zero);
}
public static void RightClick()
{
mouse_event(0x08, 0, 0, 0, IntPtr.Zero);
mouse_event(0x10, 0, 0, 0, IntPtr.Zero);
}
public static void RightClick(ushort xpos, ushort ypos)
{
Move(xpos, ypos);
RightClick();
}
public static void RightDrag(ushort to_x, ushort to_y)
{
mouse_event(0x08, 0, 0, 0, IntPtr.Zero);
Move(to_x, to_y);
mouse_event(0x10, 0, 0, 0, IntPtr.Zero);
}
public static void LeftHold(TimeSpan wait)
{
mouse_event(0x02, 0, 0,0, IntPtr.Zero);
System.Threading.Thread.Sleep(wait);
mouse_event(0x04, 0, 0, 0, IntPtr.Zero);
}
public static void LeftHold(int millisecondwait)
{
LeftHold(new TimeSpan(0, 0, 0, 0, millisecondwait));
}
}
I made this off a ton of examples from google a while ago.
|
|
|
 |
Similar Threads
|
GM quiz bot
02/14/2010 - General Gaming Discussion - 1 Replies
i use ac tools for my macros in hero online.
but i need a gm quiz bot.
Help me please.
Other all in one bots doesnt for me (in turkish server)
thanks...
|
Warrock Quiz V2.0
12/11/2009 - WarRock - 8 Replies
Hallo ich stelle euch heute V2.0 des ganzen vor
Extras:
+Mehr Fragen
ICh eröffne ein neuen Thread weil der alte geschlossen wurde wegen wrong section
Download:http://uploaded.to/file/9n74dm
|
[Fun]Warrock Quiz
12/05/2009 - WarRock - 3 Replies
Heute möchte ich euch meine Selbst erstellten Quiz vorstellen indem ihr euer wissen testen könnt
V1.0
V1.0 ist nur die sogenannte "Beta version des ganzen sie besitzt nur 3 Frage
Version 1.0 Download:MEGAUPLOAD - The leading online storage and file delivery service
|
WAR Quiz
11/27/2009 - General Gaming Discussion - 21 Replies
Um hier mal ein bisschen Stimmung in den Laden zu bringen starte ich hier jetzt mal ein Quiz. Sollte eigentlich jeder kennen ;)
Der ERSTE der die Frage bewantwortet stellt die nächste Frage. Schwierigkeit und Thema wählt ihr aus, einzige Bedingung ist natürlich, das eure Frage was mit Warhammer zu tun haben muss. (Man kann also genauso eine Frage zu einem Klassenmeisterschafts-Talent stellen wie eine Lore-Frage).
Ich fang dann einfach mal mit was leichtem an:
Nenne die 5 Götter des...
|
Quiz Thread
01/02/2007 - Off Topic - 153 Replies
Hi!
Nachdem mir im Nachtdienst ab und zu ziemlich langweilig ist, ich mich aber nicht an den niveaulosen Threads wie dem Längsten oder 'Wörtergeschichte' beteiligen will, dachte ich mir das so ein Thread ganz nett wäre.
In meinem alten Forum hat er zumindest ziemlich großen Andrang gefunden.
3 Regeln.
1. Jeder Post MUSS eine Frage oder eine Antwort enthalten!
|
All times are GMT +1. The time now is 08:49.
|
|