Hallo,
wenn ich immer diese Datei öffne (Edit Script) stürzt Scite bei mir immer ab. Ist das bei euch auch so?
Hallo,
wenn ich immer diese Datei öffne (Edit Script) stürzt Scite bei mir immer ab. Ist das bei euch auch so?
Nope, da haste das Script~
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: Burak Keskin
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]#include-once
#include <GuiConstants.au3>
#Include <WinAPI.au3>
$hWndMain = GUICreate("My Own Created Button", 300, 200)
GUISetBkColor(0x000000)
; 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))
#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
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
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)
Local $aResult
$aResult = DllCall('user32.dll', 'int', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iIndex)
; _ArrayDisplay($aResult)
GetLastError()
Return $aResult[0]
[/autoit] [autoit][/autoit] [autoit]EndFunc
Func GetLastError()
Local $aResult
$aResult = DllCall('Kernel32.dll', 'int', 'GetLastError')
; _ArrayDisplay($aResult)
Return $aResult[0]
EndFunc
[/autoit]Also ich bekomme da folgendes wenn ich F5 drücke:
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)