Jump to content

Possible bug? Extra temp file created by SplashImageOn and GUICtrlSetImage


Recommended Posts

Hello all!  I'm writing a program launcher that shows a bunch of icons at the mouse pointer to allow quick launching of programs, and I have been trying to create a quick splash screen intro for it (because it's a compact, almost TSR-like program that doesn't display any info about the program once it's running.)  I've been successful in doing so, but I noticed that no matter which method I try to actually display the image, any image display function I use is creating an extra .TMP file in the %TEMP% directory when I call it.

Here's a sample of the SplashScreen code:

#include <Misc.au3>
Const $hDLL = DllOpen("user32.dll")

FileInstall("GWM_GullLauncher_SplashScreen.jpg", @TempDir & "\GWM_GullLauncher_SplashScreen.jpg", 0)
SplashImageOn("GullLauncher", @TempDir & "\GWM_GullLauncher_SplashScreen.jpg", 610, 215, -1, -1, 1)

Sleep(2000)

While 1
    If _IsPressed("01", $hDLL) Then
        SplashOff()
        DllClose($hDLL)
        ExitLoop()
    EndIf

    Sleep(100)
WEnd

If FileExists(@TempDir & "\GWM_GullLauncher_SplashScreen.jpg") Then
    FileDelete(@TempDir & "\GWM_GullLauncher_SplashScreen.jpg")
EndIf

It runs the splash screen, waits 2 seconds, and then lets you dismiss it by clicking on the screen.  Everything runs the way it should, but when I monitor the temp directory, not only does it create the "GWM_GullLauncher_SplashScreen.jpg" file as it should, it also creates a separate (but similar sized) random temp file, something along the lines of "~DFC5F2EC22F8422D33.TMP".  When my FileDelete function runs, it does delete the original "GWM_GullLauncher_SplashScreen.jpg" file I FileInstalled into the temp directory, but it doesn't delete the "~DFC5F2EC22F8422D33.TMP" file until the program is finished executing completely.  Since my program is supposed to run constantly (to have instant access to the icon shortcuts whenever you want them), that extra file is taking up more space on the user's hard drive that it should be.  I have tried creating a new GUI to show the image (by adding a pic and calling GUICtrlSetImage instead of calling SplashImageOn), but as soon as I call either GUICtrlCreatePic and fill it with the file path directly, or GUICtrlSetImage, and fill that with the file path, that extra .TMP file is created in the same way SplashImageOn creates it, and it stays in the temp directory (and also locked and non-deletable) until the program quits.  Now it's not a huge file, it's only taking up like 20K on the hard drive, but I'd definitely like to avoid creating the extra file if I can avoid it.

I'm running AutoIt 3.3.12.0 and SciTE 3.14.801.2025.0, also Windows 7 64-bit (but compiling the program as 32-bit for more compatibility)  - thank you for any assistance!

~Zach

Edited by ZachG
added more details to system specs, added SplashOff to code
Link to comment
Share on other sites

I also just checked, even if I call SplashOff(), the result is the same.  In my program itself, I do call SplashOff(), as the splash screen is the first executable step in the program (after _Singleton), but even after getting rid of the splash screen (with SplashOff()) or the GUI I tried it with (using GUIDelete()), that extra .TMP file is still there until I quit the program.

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