Skip to content
⌘ NSIS Forum Archive

${SYMBOL} and FindWindow strangeness

7 posts

o_cee#

${SYMBOL} and FindWindow strangeness

The following code:
FindWindow ${MIRANDA_HWND} Miranda
gives me this error:
FindWindow expects 2-3 parameters, got 1.

$0 works. Why can't I do like this?

o_cee
Joost Verburg#
You should use the variables $0-$9 and $R0-$R9, you cannot use your own variable names.
Joost Verburg#
$0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $R0, $R1, $R2, $R3, $R4, $R5, $R6, $R7, $R8, $R9 are user variables, you should use them for the output of instructions such as FindWindow.

You can use ${SYMBOL} to globally define something, for example:
#define TEST 123
now ${TEST} will be replaced by 123
o_cee#
okay... imo it'd be possible to write cleaner more easily understandable code.. but maybe that's just me
Joost Verburg#
Originally posted by o_cee
okay... imo it'd be possible to write cleaner more easily understandable code.. but maybe that's just me
That's right, but it's very diffucult to write such a system for NSIS.
Joost Verburg#
You can define such a global value for nicer names.

For example:
!define HWND $0

Now ${HWND} will be replaced by $0 in the compiler.