Jump to content

vb.net 2010 & DLL


 Share

Recommended Posts

Has anyone incorporated the AutoItX dll into a VB.net project? Specifically with Visual Studio 2010? I have poured over all manner of help files and tutorials and nothing seems to work, presumably due to changes in Studio 2010.

I got so far as to register the DLL with regsvr32. Thats about it. No code snippet seems to play nice. Anyone have or know where to find something like http://www.autoitscript.com/forum/index.php?showtopic=4486 but for VB.net 2010? Any help would be grealtly appreciated. I really hope autoit can do this, I got real fed up with autohotkey.

Link to comment
Share on other sites

I have been googling this subject for weeks now. I wanted to clarify my project in case anyone doesn't understand.

I have a DOS based Point of Sale at work. I wanted to make a visual basic overlay for it so my staff won't have to memorize every product number (SKU), and make tracking details of food orders a lot easier.

For example, if someone just ordered a drink, and you pushed the fountain drink button, it would send to the DOS POS (running in the background) "10002 [ENTER][ENTER][ENTER][ENTER]"

I get the feeling that my question goes unanswered everywhere due to the typically bad-sounding nature of people who want to send keystrokes to background applications. Anyone who can help, I would send you screen-shots of my work setup so you know my purpose is legitimate.

I can code the basic menus and procedures in VB easily, but the use of DLLs is beyond me. I am begging the community for some help in this! I know I am owed nothing but I would be eternally grateful.

Link to comment
Share on other sites

AU3_API long WINAPI AU3_ControlSend(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szSendText, /*[in,defaultvalue(0)]*/long nMode);
This is the function you need. To access it in VB.Net, you can use this.

Public Declare Function AU3_ControlSend lib "autoitx.dll" (ByVal szTitle As String, ByVal szText As String, ByVal szSendText As String, Optional ByVal nMode As int = 0)

To send your text, you'd use something to the effect of

AU3_ControlSend("DOS POS window title", "", "10002 {ENTER}{ENTER}{ENTER}{ENTER}")

Forgive me if the code doesn't work first time. I don't use VB.Net.

Link to comment
Share on other sites

AU3_API long WINAPI AU3_MouseClick(/*[in,defaultvalue("LEFT")]*/LPCWSTR szButton, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nX, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nY, /*[in,defaultvalue(1)]*/long nClicks, /*[in,defaultvalue(-1)]*/long nSpeed);

Becomes

Public Declare Function AU3_MouseClick lib "autoitx.dll" (Optional ByVal szButton As String = "LEFT", Optional ByVal nX As Integer = -2147483647, Optional ByVal nY As Integer = -2147483647, Optional ByVal nClicks As Integer = 1, Optional ByVal nSpeed As Integer = -1)

Used like

AU3_MouseClick("Left")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...