Jump to content

WinActivate


AC130
 Share

Recommended Posts

AU3_API void WINAPI AU3_WinActivate(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);

I converted it to VB.NET, but it won't work. Here are my parameters:

(ByVal Title As String, Optional ByVal Text As String = "") As IntPtr

MouseMove and Sleep work fine. Any reason why WinActivate isn't working?

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I don't claim to know everything about it. In fact, I haven't even touched it in a very long time.

Get rid of As IntPtr and declare it as a sub instead. It doesn't return anything.

I was really hoping that would work, but it didn't. :( I PM'ed you the whole declaration, if you don't mind.

Link to comment
Share on other sites

Grade? We're not here to do your homework.

I just need help with one declaration... After that, I'll be able to look at why my declarations didn't work and fix the others. C'mon, help! You know you want to. :D

Link to comment
Share on other sites

I tried. I haven't touched VB.Net in years so honestly I was guessing.

I see. Owell, I got it working. Now I'm only having problems with AU3_Error. I used:

(ByVal Value As Integer) As Integer

I call it like this:

(AU3_Error(0))

I receive error:

Unable to find an entry point named 'AU3_Error' in DLL 'AutoItX3'.

My guess is the declaration is incorrect. I tried removing the ByVal, but that resulted in the same error. Any tips?

Link to comment
Share on other sites

Err.. well no parameters. It returns int.

I don't entirely understand.

AU3_Error As Integer... (No paramaters)

Results in error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Link to comment
Share on other sites

You may need to change the calling convention to match the dll. I don't remember what convention you need though because I don't have AutoIt installed.

Why should I have to do that? All the other functions work fine, thus far. The paramter in c++ is (void), that means "nothing" in VB.NET. I should only have to change the parameters, but none work.

Link to comment
Share on other sites

Ok, let's scrap that question for now. Are these the correct paramters for WinGetHandle?

AU3_API void WINAPI AU3_WinGetHandle(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPWSTR szRetText, int nBufSize);

(ByVal Title As String, ByVal Text As String, ByVal szText As String, ByVal Buffer As Integer) As Integer

In the original AutoIt language, there are only two parameters; the last two don't exist, so I'm not sure on what to put for "szText". From google, I understand the buffer size, and 256 seems to be efficient.

What should I put for sztext?

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...