Sign in to follow this  
Followers 0
Nanaki

abnormal program termination

6 posts in this topic

Hi,

I have a script that has a guictrlcreatepic and guictrlcreatelabel and does nothing else until the user presses escape. However, after leaving it on for hours it exits with a "abnormal program termination". Has anyone any idea why?

Thanks in advance,

Share this post


Link to post
Share on other sites

Hi,

I have a script that has a guictrlcreatepic and guictrlcreatelabel and does nothing else until the user presses escape. However, after leaving it on for hours it exits with a "abnormal program termination". Has anyone any idea why?

Thanks in advance,

*Szhlopp cannot see Nanaki's script. This script would be most helpful in helping Nanaki...*

Share this post


Link to post
Share on other sites

Hi,

I have a script that has a guictrlcreatepic and guictrlcreatelabel and does nothing else until the user presses escape. However, after leaving it on for hours it exits with a "abnormal program termination". Has anyone any idea why?

Thanks in advance,

force majeur?

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Whoops, sorry about that. :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

HotKeySet("{ESC}", "TerminateRun")



;create gui
GUICreate("Splash", 300, 300, -1, -1, $WS_POPUP+$WS_BORDER, $WS_EX_TOPMOST)

Dim $pic = GUICtrlCreatePic(@ScriptDir & "/bg.jpg", 0, 0, 300, 300)
Dim $label = GUICtrlCreateLabel("Press ESC to exit", 100, 100, 300, 300, $SS_CENTER+$SS_CENTERIMAGE)
GUICtrlSetBkColor($label, $GUI_BKCOLOR_TRANSPARENT)

GUISetState(@SW_SHOW)



;loop gui
While 1
      If GUIGetMsg() = $GUI_EVENT_CLOSE Then TerminateRun()
    Sleep(1000)
WEnd
TerminateRun()


;exit
Func TerminateRun()
Exit(1)
EndFunc

It doesn't really do much yet, next show a pic with a label on it. =)

Share this post


Link to post
Share on other sites

Whoops, sorry about that. >_<

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

HotKeySet("{ESC}", "TerminateRun")



;create gui
GUICreate("Splash", 300, 300, -1, -1, $WS_POPUP+$WS_BORDER, $WS_EX_TOPMOST)

Dim $pic = GUICtrlCreatePic(@ScriptDir & "/bg.jpg", 0, 0, 300, 300)
Dim $label = GUICtrlCreateLabel("Press ESC to exit", 100, 100, 300, 300, $SS_CENTER+$SS_CENTERIMAGE)
GUICtrlSetBkColor($label, $GUI_BKCOLOR_TRANSPARENT)

GUISetState(@SW_SHOW)



;loop gui
While 1
      If GUIGetMsg() = $GUI_EVENT_CLOSE Then TerminateRun()
    Sleep(1000)
WEnd
TerminateRun()


;exit
Func TerminateRun()
Exit(1)
EndFunc

It doesn't really do much yet, next show a pic with a label on it. =)

That doesn't have anything in it that would cause it to 'Terminate'. Sometimes an app will die for no known reason :)

I've accidently let scripts run for 4+ hours and they never died. Try running it again.

Share this post


Link to post
Share on other sites

But on an unrelated note: You should be BitOR'ing those styles together, not adding them.

Share this post


Link to post
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
Sign in to follow this  
Followers 0