Jump to content

AdlibEnable func dont work


Recommended Posts

hi

this code worked

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\1.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\2.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\3.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\4.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\5.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\6.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\7.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\8.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\9.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\10.ico

#include <GuiConstants.au3>

$gui = GUICreate("GUI", 400, 400 -1, -1)

GUISetState(@SW_SHOW)

Do

uu()

Until GUIGetMsg() = -3

func uu()

for $icoo = 5 to 14

$ico = $icoo * (-1)

GUISetIcon(@ScriptFullPath, $ico)

TraySetIcon(@ScriptFullPath, $ico)

sleep(150)

next

endfunc

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

but this code dont work why?

line 80 error why?

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\1.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\2.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\3.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\4.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\5.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\6.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\7.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\8.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\9.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\10.ico

#include <GuiConstants.au3>

$ico = 5

$icoo = 4

$gui = GUICreate("GUI", 400, 400, -1, -1)

GUISetState(@SW_SHOW)

AdlibEnable("aniFunc", 150)

While 1

$iMsg = GUIGetMsg()

Switch $iMsg

Case $GUI_EVENT_CLOSE

DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 1000, "long", 0x00050010 )

Exit

EndSwitch

Wend

Func aniFunc()

$icoo = $icoo + 1

$ico = $icoo * (-1)

If $icoo > 14 Then

$icoo = 5

$ico = 5

$ico = $icoo * (-1)

EndIf

GUISetIcon(@ScriptFullPath, $ico)

TraySetIcon(@ScriptFullPath, $ico)

EndFunc

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

this code

line 80 error why?

thank you for help me

Edited by mesale0077
Link to comment
Share on other sites

  • What AutoIt version do you use? As of 3.3.4.0 AdlibEnable/AdlibDisable were replaced with AdlibRegister/AdlibUnRegister
  • What error do you get exactly? Please post the error message
  • Did you post the full code? Because the posted code snippet has less then 80 lines
BTW: Could you please post your code with [autoit] code tags? Makes reading much easier.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

thank you ,this code worked

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\4.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\5.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\6.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\7.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\8.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\9.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\10.ico
#include <GuiConstants.au3>

$ico = 5
$icoo = 4
$gui = GUICreate("GUI", 400, 400, -1, -1)


GUISetState(@SW_SHOW)

AdlibRegister("aniFunc", 150) ;changed ok
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE


DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 1000, "long", 0x00050010 )
Exit
EndSwitch
Wend
Func aniFunc()
$icoo = $icoo + 1
$ico = $icoo * (-1)
If $icoo > 14 Then
$icoo = 5

$ico = 5
$ico = $icoo * (-1)
EndIf

GUISetIcon(@ScriptFullPath, $ico)
TraySetIcon(@ScriptFullPath, $ico)

EndFunc
Edited by Jos
added CODE tags... please use those when posting code.
Link to comment
Share on other sites

ok but ;GUISetIcon(@ScriptFullPath, $ico) $forum11 change or all forum change icon how is ?

3 forum

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\4.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\5.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\6.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\7.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\8.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\9.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\ee\10.ico
#include <GuiConstants.au3>

$ico = 5
$icoo = 4

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form11 = GUICreate("Form1", 633, 447, 192, 124)
$Button11 = GUICtrlCreateButton("Button11", 120, 312, 185, 65, $WS_GROUP)
$Button21 = GUICtrlCreateButton("Button21", 352, 320, 177, 57, $WS_GROUP)
$Input11 = GUICtrlCreateInput("Input11", 64, 64, 329, 21)
$Input21 = GUICtrlCreateInput("Input21", 64, 96, 321, 21)
GUISetState(@SW_SHOW)
$Form22 = GUICreate("Form2", 633, 447, 192, 124)
$Button22 = GUICtrlCreateButton("Button21", 80, 232, 185, 81, $WS_GROUP)
$Button23 = GUICtrlCreateButton("Button22", 296, 240, 177, 73, $WS_GROUP)
$Input1 = GUICtrlCreateInput("Input1", 32, 24, 233, 21)
$Input2 = GUICtrlCreateInput("Input2", 328, 24, 233, 21)
GUISetState(@SW_HIDE)

$Form33 = GUICreate("Form3", 633, 447, 192, 124)
$Edit31 = GUICtrlCreateEdit("", 56, 24, 497, 273)
GUICtrlSetData(-1, "Edit1")
$Button31 = GUICtrlCreateButton("Button1", 112, 344, 385, 57, $WS_GROUP)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
AdlibRegister("aniFunc", 150)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE

        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00050010);implode
        GUISetState(@SW_SHOW, $Form1)
         GUIDelete()
            Exit
 Case $Button11 

$rr = GUICtrlRead($Input11)
$zz = GUICtrlRead($Input21)

GUISetState(@SW_HIDE, $Form11)
GUISetState(@SW_SHOW,$Form33)
    EndSwitch
WEnd
Func aniFunc()
$icoo = $icoo + 1
$ico = $icoo * (-1)
If $icoo > 14 Then
$icoo = 5

$ico = 5
$ico = $icoo * (-1)
EndIf

GUISetIcon(@ScriptFullPath, $ico)  <= ;$forum11 change or all forum change icon how is ?
TraySetIcon(@ScriptFullPath, $ico)

EndFunc

thank you help me

Edited by mesale0077
wrapped code in tags - user should start doing that - 2 different mods have now done it
Link to comment
Share on other sites

hi

this code worked 3 forum

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\1.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\2.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\3.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\4.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\5.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\6.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\7.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\8.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\9.ico

#AutoIt3Wrapper_Res_Icon_Add=D:\ee\10.ico

#include <GUIConstantsEx.au3>

#include <GuiConstants.au3>

#include <WindowsConstants.au3>

#include <GuiConstantsEx.au3>

#include <GDIPlus.au3>

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <StaticConstants.au3>

#include <ProgressConstants.au3>

#include <EditConstants.au3>

$ico = 5

$icoo = 4

AdlibRegister("aniFunc", 150)

$Form22 = GUICreate("Form2", 633, 447, 192, 124)

$Button22 = GUICtrlCreateButton("Button21", 80, 232, 185, 81, $WS_GROUP)

$Button23 = GUICtrlCreateButton("Button22", 296, 240, 177, 73, $WS_GROUP)

$Input1 = GUICtrlCreateInput("Input1", 32, 24, 233, 21)

$Input2 = GUICtrlCreateInput("Input2", 328, 24, 233, 21)

GUISetState(@SW_HIDE)

$Form33 = GUICreate("Form3", 633, 447, 192, 124)

$Edit31 = GUICtrlCreateEdit("", 56, 24, 497, 273)

GUICtrlSetData(-1, "Edit1")

$Button31 = GUICtrlCreateButton("Button1", 112, 344, 385, 57, $WS_GROUP)

GUISetState(@SW_HIDE)

$Form11 = GUICreate("Form1", 633, 447, 192, 124)

$Button11 = GUICtrlCreateButton("Button11", 120, 312, 185, 65, $WS_GROUP)

$Button21 = GUICtrlCreateButton("Button21", 352, 320, 177, 57, $WS_GROUP)

$Input11 = GUICtrlCreateInput("Input11", 64, 64, 329, 21)

$Input21 = GUICtrlCreateInput("Input21", 64, 96, 321, 21)

GUISetState(@SW_SHOW, $Form11)

; will display an empty dialog box

$gui = $Form11

; Run the GUI until the dialog is closed

While 1

$iMsg = GUIGetMsg()

Switch $iMsg

Case $GUI_EVENT_CLOSE,$Button11

DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 1000, "long", 0x00050010 )

Exit

Case $Button21

$rr = GUICtrlRead($Input11)

$zz = GUICtrlRead($Input21)

GUISetState(@SW_HIDE, $Form11)

GUISetState(@SW_SHOW,$Form22)

$gui = $Form22

Case $Button31

GUISetState(@SW_HIDE, $Form33)

GUISetState(@SW_SHOW, $Form11)

$gui = $Form11

Case $Button22

GUISetState(@SW_HIDE, $Form22)

GUISetState(@SW_SHOW, $Form33)

$gui = $Form33

EndSwitch

Wend

Func aniFunc()

$icoo = $icoo + 1

$ico = $icoo * (-1)

If $icoo > 14 Then

$icoo = 5

$ico = 5

$ico = $icoo * (-1)

EndIf

uu()

EndFunc

func uu()

GUISetIcon(@ScriptFullPath, $ico)

TraySetIcon(@ScriptFullPath, $ico)

EndFunc

Edited by mesale0077
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...