Jump to content

can i convert C++ code too autoit


name15
 Share

Recommended Posts

I don't think so... anyway not in an automatic way, you should re-write entirely the code in C++

Anyway if you have an autoit code you want to use in a C++ program you can either use the AutoItX functions OR more simply compile the script as a command line exe and call it from your script :)

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

here sample example code in C++ so how can convert it

#include "stdafx.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    char shellcode[] =


MessageBox (0,"Hello word",0,0);

return 0;
}
Link to comment
Share on other sites

here sample example code in C++ so how can convert it

#include "stdafx.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    char shellcode[] =


MessageBox (0,"Hello word",0,0);

return 0;
}

MsgBox(0, "", "Hello word")

Edit: I think you want to convert your dll calls into AutoIt dll calls.

Like this (SEe documentation on DllCall)

DllCall("user32.dll","long","MessageBox","long",0,"str", "Hello word","str", "","long", 0)
Edited by Manadar
Link to comment
Share on other sites

thank

but i try whit this code DenyAccess to protect you project when it running

#define _WIN32_WINNT 0x0500

#include <windows.h>
#include <sddl.h>
#include <accctrl.h>
#include <stdio.h>
#include <conio.h>
#include <aclapi.h>

BOOL ProtectProcess(HANDLE hProcess);

void main(void)
{
    HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId());

    ProtectProcess(hProc);

    printf("SetProcessDacl - Keep a process from being closed by other applications.\nDeveloped by ANUBIS");

    while(TRUE)
    {
        Sleep(100);
    }

}

BOOL ProtectProcess(HANDLE hProcess)
{
    SECURITY_ATTRIBUTES sa;

    sa.nLength = sizeof(SECURITY_ATTRIBUTES);
    sa.bInheritHandle = FALSE;

    if (!ConvertStringSecurityDescriptorToSecurityDescriptor("D:P", SDDL_REVISION_1, &(sa.lpSecurityDescriptor), NULL))
        return FALSE;

    if (!SetKernelObjectSecurity(hProcess, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor))
        return FALSE;

    return TRUE;

}
Link to comment
Share on other sites

  • Developers

i find this function LockFile in kernel32.dll but i didn't how can i use it

Ok, now first spent some time to explain what it is you want to accomplish here....

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

LockFile(hAppend, dwPos, 0, dwBytesRead, 0);

DllCall("Kernel32.dll","long","LockFile","long","C:\1.wav","str", 0,"str", 0,"str", 0)

not work

I understood that, but what are you trying to do with this script you are creating?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Locks the specified file adding more function to my script

Try to use a some more words to explain what it is you want to accomplish.

I understand your native language isn't English but you will have to try to make it clear what you want to do for us to be able top help you.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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