Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Issue with Simulating SplashImage

$
0
0
Hello everyone,

I'm trying to simulate a SplashImage functionality, and here's what I've come up with so far:

CODE:

#Requires Autohotkey v2.0
#SingleInstance Force


SG := Gui()
SG.Add("Picture", "w150 h150 xm", "ICO\Pic1.jpg").OnEvent("Click", OpenPic)
SG.Add("Picture", "w150 h150 xm", "ICO\Pic2.jpg").OnEvent("Click", OpenPic)
SG.Show("w800 h600")
Return


OpenPic(GuiCtrlObj, *){
SplashImage := Gui('+AlwaysOnTop +ToolWindow -Caption')
SplashImage.Add("Picture", "w800 h-1 +Center", GuiCtrlObj.Text)
SplashImage.Show("NA xCenter yCenter")
SetTimer((*) => SplashImage.Destroy(), -3000)
OnMessage(WM_LBUTTONDBLCLK := 0x0203, SplashImageDblClick.Bind(SplashImage, GuiCtrlObj.Text))

}



SplashImageDblClick(SplashImage, Link, *){
SplashImage.Destroy()
Run(A_ScriptDir "\" Link)
}

Upon clicking once on the image, my SplashImage should appear. However, if I double-click on the displayed image, it should open in an external program.

Initially, everything works as intended. However, when I double-click on the "SplashImage" and then double-click again on any image, both images appear. The same happens if I double-click on the second image and then again on any image - all previously opened images appear.

How can I ensure that only the double-clicked image opens each time, without accumulating previously opened images?

Thank you for your assistance.

Statistics: Posted by Loop — Today, 16:51



Viewing all articles
Browse latest Browse all 579

Trending Articles