Jump to content

Converting .Net functions to AutoIt


James
 Share

Recommended Posts

Hey,

I was looking at creating a button on a title bar of a GUI. I found this but it is in .Net

http://www.dotnet247.com/247reference/msgs/41/207281.aspx

I tried starting, but only got to:

#include <GUIConstants.au3>

Global Const $WM_NCPAINT = 0x0085

$DLl = DllOpen("user32.dll")

$hwnd = GUICreate("Button Example")

GUISetState(@SW_SHOW)

_AddButton($hwnd)

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _AddButton(ByRef $io_winhandle)
    DllCall($dll, "int", "GetWindowDC", "int_ptr", $io_winhandle)
    DllCall($dll, "int", "GetDC", "int_ptr", $io_winhandle)
    DllCall($dll, "int", "ReleaseDC", "int_ptr", $io_winhandle)
    
EndFunc

Anyone help me convert this?

Thanks,

James

Edit: This is the first time I have tried something like this. So dont be too harsh on me :)

Edited by JamesB
Link to comment
Share on other sites

  • Moderators

Not sure about the title bar itself, but have a look at AnyGUI.au3 in the examples forum.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

OK, what is easier to convert? C++?

What are you talking about "convert"? You asked how to do it in AutoIt... I gave you something to study... to see how it could possibly done.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Yeah, I know, but I was wandering if it is possible to convert.

I'll let you answer that question with this question:

Do you know both languages?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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