AndiG
2nd November 2001 09:50 UTC
FindWindowByTitle with 1.5x version
With the 1.44 FindWindowByTitle function I have build an installer that checks if the program is already running and then uses the Prompt parameter to offer an Abort/Rerty/Ignore choice.
With 1.5x this doesn't seem possible anymore? Even using MessageBox I can only test for 2 return values, but not for the Abort/Rerty/Ignore choice?
Is there a good work around, or am I doing something wrong?
Thanks, Andi
spanky
2nd November 2001 10:44 UTC
First, grab the latest version of NSIS.
http://firehose.net/free/nsis/version-history.html
;Example: (sends WM_CLOSE to $0)
FindWindow $0 "" "My apps title"
SendMessage $0 16 0 0
AndiG2
2nd November 2001 12:29 UTC
Thanks, but this doesn't let the user decide what to do as previously?
Thanks, Andi
locnar42
2nd November 2001 18:19 UTC
Versions of NSIS greater than 1.61 let you specify 2 tests on the MessageBox command. Prior to that, you could only specify one result. The 3rd result can be tested because the program won't jump if that's the case.
I had a very similar problem right before 1.6 was released because I was trying to offer Abort, Retry, Ignore but had no way to react to all three.
TryAgain:
... do something ...
MessageBox MB_ABORTRETRYIGNORE "What do you want to do?" IDABORT EndInstall IDRETRY TryAgain
... put code here if continue is selected ...
spanky
2nd November 2001 21:40 UTC
Originally posted by AndiG2
Thanks, but this doesn't let the user decide what to do as previously?
You are right. I was half asleep when I wrote it. :o
AndiG2
3rd November 2001 15:22 UTC
Thank you- I didn't even check for later NSIS versions yet :|
:D Andi:D