Jump to content

Recommended Posts

Posted

Hi There,

I recently converted my GUI-script to v3.0.103.128 because I read this was going to be the standard in Auto-It GUI-scripting.

But now after clicking the OK button on my form it takes a while for something happens. Is this a known "problem" with converted scripts or is there something else causing this? :D

I used the "GUI Conversion Script" from CyberSlug, which has done a great job !!! :lol::idiot:

Thanx, CyberSlug.

  • Administrators
Posted

Hi There,

I recently converted my GUI-script to v3.0.103.128 because I read this was going to be the standard in Auto-It GUI-scripting.

But now after clicking the OK button on my form it takes a while for something happens. Is this a known "problem" with converted scripts or is there something else causing this?  :D

I used the "GUI Conversion Script" from CyberSlug, which has done a great job !!!  :lol:  :idiot:

Thanx, CyberSlug.

Post the message loop code. Has it got Sleeps in it?


 

Posted

Here's a piece of my script which holds the GUI

Func GUI()
Global $WS_POPUP=0x80000000
Global $WS_BORDER=0x00800000
Global $style=$WS_POPUP+$WS_BORDER

SoundPlay("C:\WINNT\Media\Ding.wav")
ProgressSet(87,"Progress Meter CQR-invuller © by D.Lith","Bijzonderh. + Verw.actie invullen.")

;~ Opt("GUICoordMode",1)
;~ Opt("GUINotifyMode",1)
GuiCreate("CQR-Actie Invuller" & " v." & $Versie,392,370,(@DesktopWidth-410),10,$Style)

$tab_1=GUICtrlCreatetab(10,10,320,270)
$null=GUICtrlCreatetabitem("Bijzonderheden")
Dim $list_1=GUICtrlCreatelist("List 1",20,40,290,230)
GuiCtrlSetData(-1,"||Artikel manco|Defect ontvangen|Dubbel besteld|Dubbel ingevoerd|Goederen nog niet binnen|Manco|Niet alle pakketten binnen|Teveel besteld door klant|Teveel ingevoerd door verkoper|Transportschade|Verkeerd artikel besteld|Verkeerd artikel geleverd.Geleverd is:|Verkeerd artikel ingevoerd|Verkeerd geadviseerd|Verkeerde Klant geselecteerd|Nog niet ontvangen.|","Sample"); add the input area
$tabitem_2=GUICtrlCreatetabitem("Verwachte Actie")
Dim $list_2=GUICtrlCreatelist("List 2",20,40,290,230)
GuiCtrlSetData(-1,"||Crediteren|Foutieve ophalen,juiste leveren.|Herleveren|Naleveren|Ophalen en crediteren|Trace waar de rest is.|Trace waar goederen zijn.|","Sample"); add the input area
$tabitem_3=GUICtrlCreatetabitem("Eigen tekst")
Dim $list_3=GUICtrlCreateedit("",20,40,290,230)
$tab_close=GUICtrlCreatetabitem("")

$icon_1=GUICtrlCreateicon("cqr.ico",0,340,300,20,20)
$nOK=GUICtrlCreatebutton("OK",20,310,70,20)

$Name_1=GUICtrlCreatelabel("CQRinvuller ©" & " v." & $Versie & " by D.Lith",30,350,200,15)

GuiSetState(@SW_SHOW)

While 1
sleep(100)
$msg=GuiGetMsg()
Select
Case $msg=-3
Exit
Case $msg=2
;;;
Case $msg=$tab_1
;;;
Case $msg=$null
;;;
Case $msg=$list_2
;;;
Case $msg=$tabitem_2
;;;
Case $msg=$list_3
;;;
Case $msg=$tabitem_3
;;;
Case $msg=$list_1
;;;
Case $msg=$icon_1
;;;
Case $msg=$Name_1
;;;
Case $msg=$nOK

Global $Bijzh=GuiRead($list_1); get the type value
Global $VerwA=GuiRead($list_2); get the type value
Global $Eig=GuiRead($list_3); get the type value

If $Bijzh=""AND $Eig=""then
WinActivate("Microsoft Excel","CQR1")
Send('!e')
Send('g')
Send('cqr{!}B9')
Send("{enter}")
Send($VerwA)
Send("{enter}")
Ext()
;
ElseIf $Bijzh=""AND $Eig>""Then
WinActivate("Microsoft Excel","CQR1")
Send('!e')
Send('g')
Send('cqr{!}AB10')
Send("{enter}")
Send($Eig)
Send("{enter}")
Send('!e')
Send('g')
Send('cqr{!}B9')
Send("{enter}")
Send($VerwA)
Send("{enter}")
Ext()
;
ElseIf $Bijzh>""AND $Eig=""Then
WinActivate("Microsoft Excel","CQR1")
Send('!e')
Send('g')
Send('cqr{!}AB10')
Send("{enter}")
Send($Bijzh)
Send("{enter}")
Send('!e')
Send('g')
Send('cqr{!}B9')
Send("{enter}")
Send($VerwA)
Send("{enter}")
Ext()
;
Else
WinActivate("Microsoft Excel","CQR1")
Sleep(750)
Send('!e')
Send('g')
Send('cqr{!}AB10')
Send("{enter}")
Send($Bijzh)
Send("{enter}")
Send($Eig)
Send("{enter}")
Send('!e')
Send('g')
Send('cqr{!}B9')
Send("{enter}")
Send($VerwA)
Send("{enter}")
Ext()
;
EndIf
;
EndSelect
WEnd
Ext()
EndFunc

There is just 1 sleep, but it was always there......

  • Administrators
Posted

Lose the Sleep(100) before the GuiGetMsg() line. GuiGetMsg() does this automatically now if required.


 

Posted

Lose the Sleep(100) before the GuiGetMsg() line.  GuiGetMsg() does this automatically now if required.

<{POST_SNAPBACK}>

Tested it 3 times now and this seems to be the cure.... :idiot:

Have to test some more but I'm almost sure this is it.

Thanx Jon.

PS: Nice avatar picture !!! :D

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
×
×
  • Create New...