Issue with Simulating SplashImage Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Loop
Posts: 171
Joined: 07 Jan 2019, 14:51

Issue with Simulating SplashImage

Post by Loop » 10 Apr 2024, 16:51

Hello everyone,

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

Code: Select all

#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.

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Issue with Simulating SplashImage  Topic is solved

Post by mikeyww » 10 Apr 2024, 19:07

Have you tried the :arrow: DoubleClick event?

Loop
Posts: 171
Joined: 07 Jan 2019, 14:51

Re: Issue with Simulating SplashImage

Post by Loop » 11 Apr 2024, 04:45

Thanks!

Post Reply

Return to “Ask for Help (v2)”