Ender7584
27th December 2005 20:30 UTC
Changing pictures due to color mode
Hey,
Basically I have this bit of code in my .oninit function:
System::Call 'user32::GetWindowDC(i $HWNDPARENT) i .r0'
System::Call 'gdi32::GetDeviceCaps(i $0, i 12) i .r1'
to tell what the color mode running is. Is there a way to get my images that are displayed in the installer to change based on this information? I'm using Modern UI. I don't think there is, since it seems like the images are added on compile, but if there is a way, it would be great to know it :)
Thanks
Comm@nder21
27th December 2005 20:49 UTC
there is, by api functions.
LoadPicture and maybe some other functions should do it.
browse the msdn :)
there are also some threads in the forums where ppl discussed about setting pictures dynamically i think.
the search button is your friend :)
Ender7584
3rd January 2006 22:01 UTC
I've been searching on the forums (and always try to before posting) but am still coming up blank. Unfortinatly I don't know how to use APIs well enough to write the line of code. The MSDN does have lots of code examples, but again me not being able to write an API I'm stuck :(
Comm@nder21
4th January 2006 13:08 UTC
you need to do this:
- load a picture using its filename, get the handle
- get the handle of the control you want to change ("GetDlgItem" NSIS function)
- assign the picture to your control, using both handles
you just need to find the right functions at msdn :)
then if you don't know how to implement them, have a look at the system plugin readme, you need the command System.dll::Call ....