Jump to content
Sign in to follow this  
=sinister=

C++ GUI Question

Recommended Posts

=sinister=

Ok, I know like .01% of C++. So I have a really stupid question =P.

Here is the script for a GUI:

AUT_RESULT AutoIt_Script::F_GUICreate(VectorVariant &vParams, Variant &vResult)
{
    uint    iNumParams = vParams.size();

    int     nStyle      = -1;
    int     nExStyle    = -1;
    int     nW          = -1;
    int     nH          = -1;
    int     nX          = -1;
    int     nY          = -1;
    HWND hParent        = NULL;

    if (iNumParams > 7) hParent = vParams[7].hWnd();
    if (iNumParams > 6) nExStyle = vParams[6].nValue();
    if (iNumParams > 5) nStyle = vParams[5].nValue();
    if (iNumParams > 4) nY = vParams[4].nValue();
    if (iNumParams > 3) nX = vParams[3].nValue();
    if (iNumParams > 2) nH = vParams[2].nValue();
    if (iNumParams > 1) nW = vParams[1].nValue();

    HWND hWnd= g_oGUI.CreateGUI(vParams[0].szValue(), nX, nY,nW, nH, nStyle, nExStyle, hParent);

    if (hWnd == NULL)
    {
        SetFuncErrorCode(1);
        vResult = (HWND)NULL;                   // window can not be created
    }
    else
        vResult = hWnd;

    return AUT_OK;

} // GUICreate()

So is this a function in C++? And if it is, then would this be to create a GUI?:

uint    iNumParams = vParams.size();

    int     nStyle      = -1;
    int     nExStyle    = -1;
    int     nW          = -1;
    int     nH          = -1;
    int     nX          = -1;
    int     nY          = -1;
    HWND hParent        = NULL;

    if (iNumParams > 7) hParent = vParams[7].hWnd();
    if (iNumParams > 6) nExStyle = vParams[6].nValue();
    if (iNumParams > 5) nStyle = vParams[5].nValue();
    if (iNumParams > 4) nY = vParams[4].nValue();
    if (iNumParams > 3) nX = vParams[3].nValue();
    if (iNumParams > 2) nH = vParams[2].nValue();
    if (iNumParams > 1) nW = vParams[1].nValue();

    HWND hWnd= g_oGUI.CreateGUI(vParams[0].szValue(), nX, nY,nW, nH, nStyle, nExStyle, hParent);

    if (hWnd == NULL)
    {
        SetFuncErrorCode(1);
        vResult = (HWND)NULL;                   // window can not be created
    }
    else
        vResult = hWnd;

    return AUT_OK;

If someone could explain this to me, it would be very appreciated, thanks.

Share this post


Link to post
Share on other sites
=sinister=

Yes it is Autoit Source code, and what do you mean by its GUI closed part of sources?

Share this post


Link to post
Share on other sites
Zedna

Yes it is Autoit Source code, and what do you mean by its GUI closed part of sources?

Look here

The public version of the source code will be similar to the private/binary version but with some functionality removed. The source code is intended for those who wish to learn how AutoIt works and to contribute to its development. Please read the license that accompanies the source for more details and feel free to PM me or any member of the dev team with any questions.

all GUI section is not in public sources.

Share this post


Link to post
Share on other sites
=sinister=

oh ok, shall I remove it then?

Share this post


Link to post
Share on other sites
The Kandie Man

Nope, what he has is in the distributed source code and it is not used to create a GUI, it is used to interpret the GUICreate() function in a script. The GUI is actually created by using the g_oGUI object which represents a library that is not present in the distribution of the AutoIt source code. Using autoit source code to create a GUI is pointless and a waste of time.

You are better off creating your own GUI in c++.

- The Kandie Man ;-)


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
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
Sign in to follow this  

×