Old 20th September 2012, 03:08   #1
scubanarc
Junior Member
 
Join Date: Aug 2009
Posts: 7
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 is offline   Reply With Quote
Old 20th September 2012, 04:51   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You need to call GetWindowRect using the system plugin.
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

Example: http://forums.winamp.com/showthread....75#post2688175
MSG is offline   Reply With Quote
Old 20th September 2012, 15:46   #3
scubanarc
Junior Member
 
Join Date: Aug 2009
Posts: 7
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.

Quote:
Originally Posted by MSG View Post
PHP Code:
        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 
$$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:

PHP Code:
        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
scubanarc is offline   Reply With Quote
Old 20th September 2012, 18:54   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
* 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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th September 2012, 21:04   #5
scubanarc
Junior Member
 
Join Date: Aug 2009
Posts: 7
Thank you very much for your help. I was able to get the values and use them with this example.

- jason
scubanarc is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump