scubanarc
20th September 2012 04:08 UTC
Get X/Y coordinates of install screen
Hey Guys,
I've been searching for a couple of days on how to do this and have finally gave in and am asking for help.
I need to get the top-left or bottom-left x/y coordinates of the currently shown NSIS window. I'm supposed to pass these values through the registry to another application that is going to pop up at install-time and I want it to pop at the exact same location.
Any thoughts here?
- jason
scubanarc
20th September 2012 16:46 UTC
Hey MSG, thanks for the reply. This helps a lot. If you could help me understand the mechanics of this a little bit I'd appreciate it.
Originally posted by MSG
nxs
::getWindow /NOUNLOAD
Pop$1 ;(now contains the HWND of the nxs window)
System::Alloc 16
Pop$2
System::Call "user32::GetWindowRect(i r1, i r2)"
System::Call "*$2(i .r3, i .r4, i, i)"
System::Free $2
IntOp$4 $4 + 20
System::Call 'User32::SetWindowPos(i $1, i $1, i $3, i $4, i 0, i 0, i 5)'
I understand everything up to this line:
System
::Call "*$2(i .r3, i .r4, i, i)"
What does *$2 mean and what does that line accomplish?
Also, I get that the lpRECT structure contains the values I want, but I don't understand how to get those values out.
- jason
Anders
20th September 2012 19:54 UTC
* means struct syntax, *$2 means access struct at memory address stored in $2 and i.r# (type input output, . (dot) means no input) extracts the first two INT32 fields in the RECT struct...
scubanarc
20th September 2012 22:04 UTC
Thank you very much for your help. I was able to get the values and use them with this example.
- jason