Jump to content

C++ 2 autoit


sajgon
 Share

Recommended Posts

hi can someone help me with converting part of this code which is responsible for injection of hookdll.dll file. There is a program called minimizer. When you open exe file it shows up a window with 3 radiobuttons and two normal buttons. To inject dll you have to choose one of radios(choose res.) and then press begin button. After this operation it will minimize window whit pressing f11 button. What i need is to load this dll and call function of choosing one of radios and then press the begin button. Is this possible? Here is the part ofcode:

}

#endregion

private void mnuExit_Click(object sender, System.EventArgs e)

{

this.Close();

}

private void mnuAbout_Click(object sender, System.EventArgs e)

{

using(FrmAbout abt = new FrmAbout())

{

abt.ShowDialog();

}

}

private void mnuHowTo_Click(object sender, System.EventArgs e)

{

using(FrmHelp hlp = new FrmHelp())

{

hlp.ShowDialog();

}

}

private void btnStart_Click(object sender, System.EventArgs e)

{

try

{

int X,Y = X = 0;

if(rbRes1.Checked)

{

X = 640; Y = 480;

}

else if(rbRes2.Checked)

{

X = 800; Y = 600;

}

else if(rbRes3.Checked)

{

X = 1024; Y = 768;

}

else

{

X = 1280; Y = 1024;

}

Imports.SR(X,Y);

Imports.IH();

btnStart.Enabled = false;

btnStop.Enabled = true;

bStarted = true;

}

catch(Exception ex)

{

Debug.WriteLine(ex);

MessageBox.Show("There was an error with HookDLL.dll","Error");

}

}

private void btnStop_Click(object sender, System.EventArgs e)

{

try

{

Imports.UIH();

btnStart.Enabled = true;

btnStop.Enabled = false;

bStarted = false;

}

catch(Exception ex)

{

Debug.WriteLine(ex);

MessageBox.Show("There was an error with HookDLL.dll","Error");

}

}

private void mnuLicense_Click(object sender, System.EventArgs e)

{

using(GPL gpl = new GPL())

{

gpl.ShowDialog();

}

}

private void WinMuFrm_Load(object sender, System.EventArgs e)

{

if(!File.Exists("HookDLL.dll"))

MessageBox.Show("Can not find HookDLL.dll!","Warning");

}

}

}

And my attemp to do this:

DllCall("minimizer.dll","str","loadlibrary")

dllcall("minimizer.dll","int","HookDLL.SR", "Int", 1024, "Int", 768)

dllcall("minimizer.dll","none","HookDLL.IH")

but its not working:/ Is there any hope?

Link to comment
Share on other sites

hi can someone help me with converting part of this code which is responsible for injection of hookdll.dll file. There is a program called minimizer. When you open exe file it shows up a window with 3 radiobuttons and two normal buttons. To inject dll you have to choose one of radios(choose res.) and then press begin button. After this operation it will minimize window whit pressing f11 button. What i need is to load this dll and call function of choosing one of radios and then press the begin button. Is this possible? Here is the part ofcode:

}

#endregion

private void mnuExit_Click(object sender, System.EventArgs e)

{

this.Close();

}

private void mnuAbout_Click(object sender, System.EventArgs e)

{

using(FrmAbout abt = new FrmAbout())

{

abt.ShowDialog();

}

}

private void mnuHowTo_Click(object sender, System.EventArgs e)

{

using(FrmHelp hlp = new FrmHelp())

{

hlp.ShowDialog();

}

}

private void btnStart_Click(object sender, System.EventArgs e)

{

try

{

int X,Y = X = 0;

if(rbRes1.Checked)

{

X = 640; Y = 480;

}

else if(rbRes2.Checked)

{

X = 800; Y = 600;

}

else if(rbRes3.Checked)

{

X = 1024; Y = 768;

}

else

{

X = 1280; Y = 1024;

}

Imports.SR(X,Y);

Imports.IH();

btnStart.Enabled = false;

btnStop.Enabled = true;

bStarted = true;

}

catch(Exception ex)

{

Debug.WriteLine(ex);

MessageBox.Show("There was an error with HookDLL.dll","Error");

}

}

private void btnStop_Click(object sender, System.EventArgs e)

{

try

{

Imports.UIH();

btnStart.Enabled = true;

btnStop.Enabled = false;

bStarted = false;

}

catch(Exception ex)

{

Debug.WriteLine(ex);

MessageBox.Show("There was an error with HookDLL.dll","Error");

}

}

private void mnuLicense_Click(object sender, System.EventArgs e)

{

using(GPL gpl = new GPL())

{

gpl.ShowDialog();

}

}

private void WinMuFrm_Load(object sender, System.EventArgs e)

{

if(!File.Exists("HookDLL.dll"))

MessageBox.Show("Can not find HookDLL.dll!","Warning");

}

}

}

And my attemp to do this:

DllCall("minimizer.dll","str","loadlibrary")

dllcall("minimizer.dll","int","HookDLL.SR", "Int", 1024, "Int", 768)

dllcall("minimizer.dll","none","HookDLL.IH")

but its not working:/ Is there any hope?

From what you've shown I couldn't help.

Why not just use AutoIt to select the correct radio button and press the right buttons instead? Sounds a lot easier to me.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Of course it is easier but i prefer not to open an additional .exe file:)

Oh I see. Silly me, I thought that because you posted your question in the AutoIt General Help and Support forum you were asking for help with AutoIt.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...