Scite stürzt ab

  • Nope, da haste das Script~

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.0.0
    Author: Burak Keskin

    Script Function:
    Template AutoIt script.

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include-once
    #include <GuiConstants.au3>
    #Include <WinAPI.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $hWndMain = GUICreate("My Own Created Button", 300, 200)
    GUISetBkColor(0x000000)

    [/autoit] [autoit][/autoit] [autoit]

    ; this here doesn't work, why ?
    $hWndButton = CreateWindow('BUTTON', 'CheckBox', _
    BitOr($WS_CHILD, $WS_VISIBLE, $BS_AUTOCHECKBOX), _
    90, 50, 120, 30, _
    $hWndMain, 6, _
    GetWindowLong($hWndMain, $GWL_HINSTANCE))

    [/autoit] [autoit][/autoit] [autoit]

    #cs
    ; this works, so why doesn't CreateWindow work ?
    $hWndButton = _WinAPI_CreateWindowEx($WS_EX_DLGMODALFRAME , 'BUTTON', 'CheckBox', _
    BitOr($WS_CHILD, $WS_VISIBLE, $BS_AUTOCHECKBOX), _
    90, 50, 120, 30, _
    $hWndMain, 5, _
    GetWindowLong($hWndMain, $GWL_HINSTANCE))
    #ce

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While True

    [/autoit] [autoit][/autoit] [autoit]

    Switch GUIGetMsg()
    Case -3
    Exit
    Case 5
    MsgBox(4096, '', 'This function works fine ...')
    Case 6
    MsgBox(4096, '', "Why can't I be visible ...")
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;========================================================================================
    ;========================================================================================
    Func CreateWindow($sClassName, $sWindowName, $iStyle, $iX, $iY, $iWidth, $iHeight, $hWndParent = 0, $hMenu = 0, $hInstance = 0, $pParam = 0)
    Local $aResult

    If $hInstance = 0 Then $hInstance = _WinAPI_GetModuleHandle("")
    $aResult = DllCall("User32.dll", "hwnd", "CreateWindow", "str", $sClassName, _
    "str", $sWindowName, _
    "int", $iStyle, _
    "int", $iX, _
    "int", $iY, _
    "int", $iWidth, _
    "int", $iHeight, _
    "hwnd", $hWndParent, _
    "hwnd", $hMenu, _
    "hwnd", $hInstance, _
    "ptr", $pParam)
    _WinAPI_Check("CreateWindow", ($aResult[0] = 0), 0, True)
    Return $aResult[0]
    EndFunc
    ;========================================================================================
    ;========================================================================================
    Func GetWindowLong($hWnd, $iIndex)

    [/autoit] [autoit][/autoit] [autoit]

    Local $aResult
    $aResult = DllCall('user32.dll', 'int', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iIndex)
    ; _ArrayDisplay($aResult)
    GetLastError()

    [/autoit] [autoit][/autoit] [autoit]

    Return $aResult[0]

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc
    Func GetLastError()

    [/autoit] [autoit][/autoit] [autoit]

    Local $aResult
    $aResult = DllCall('Kernel32.dll', 'int', 'GetLastError')
    ; _ArrayDisplay($aResult)
    Return $aResult[0]

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit]
  • Also ich bekomme da folgendes wenn ich F5 drücke:

    Spoiler anzeigen
    [autoit]


    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3(26,40) : WARNING: $WS_CHILD: possibly used before declaration.
    BitOr($WS_CHILD,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3(26,53) : WARNING: $WS_VISIBLE: possibly used before declaration.
    BitOr($WS_CHILD, $WS_VISIBLE,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3(26,71) : WARNING: $BS_AUTOCHECKBOX: possibly used before declaration.
    BitOr($WS_CHILD, $WS_VISIBLE, $BS_AUTOCHECKBOX)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3(29,64) : WARNING: $GWL_HINSTANCE: possibly used before declaration.
    GetWindowLong($hWndMain, $GWL_HINSTANCE)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3(26,40) : ERROR: $WS_CHILD: undeclared global variable.
    BitOr($WS_CHILD,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    m:\test_miljø\AutoIt3\AutoIt_Spoiler\Spoiler\Post_94191_Beitrag_2_Skript_1.au3 - 1 error(s), 4 warning(s)

    [/autoit]

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr