Skip to content
⌘ NSIS Forum Archive

Moving nsDialogs controls?

6 posts

bradharding#

Moving nsDialogs controls?

Hi!
I was wondering if someone could please provide me with some example code that will reposition a control created using nsDialogs? I've tried using SetWindowPos and MoveWindow using the System plugin without any luck.
Any ideas?

Thanks in advance.
Brad.
kichik#
Something like this should do the trick:

bradharding#
Thanks for your help, kichik.

I've actually come across this code before, and hadn't had much luck with it. I've had another go, but am still having problems. Here's some code I've tried:


  System::Call "*(i, i, i, i) i .r1"
  System::Call "User32::GetWindowRect(i, i) i (r0, r1) .r2"
  System::Call "*$1(i, i, i, i) i (.r2, .r3, .r4, .r5)"
  IntOp $2 $2 + 2
  IntOp $3 $3 + 3
  System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($0, 0, $2, $3, 0, 0, ${SWP_NOOWNERZORDER}|${SWP_NOSIZE})" 
$0 is the handle for the control. ${SWP_NOOWNERZORDER} and ${SWP_NOSIZE} are both defined correctly. I'm wanting the code to simply move the control 2 pixels/units to the right and 3 pixels/units down, but the control just disappears. What am I doing wrong? 😕

Regards,
Brad.
Anders#
are you sure you have the correct position, GetWindowRect is is screen coords, you probably want client coordinates, try calling ScreenToClient or MapWindowRect or whatever those api's are called