Archive: .ini page issue.....


.ini page issue.....
Hi,

In one of my (InstallOptions) .ini page, the last two fields (Label and DirRequest) are comming in different background color than the other fields.

I have not applied any new formatting to those two fields (Label and DirRequest).

Why those two fields are comming in different background color?

BTW, I am using the following code to make them similar with the other fields but the code is not working....

Page custom in_DirectoryListing_Pre in_DirectoryListing_show in_DirectoryListing_leave


Function in_DirectoryListing_show
;MessageBox MB_OK "In Show........."
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 0x50482 ;DirRequest Control Id
SetCtlColors $0 000000 3D66AB

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 0xB0448 ;DirRequest Control Id
SetCtlColors $0 000000 3D66AB
FunctionEnd

Am I missing something?


are you using a visual theme/skin in your windows installation that - for some reason - doesn't affect those controls, perhaps?
also, this seems suspect...


GetDlgItem $0 $0 0x50482 ;DirRequest Control Id
GetDlgItem $0 $0 0xB0448 ;DirRequest Control Id

The first has dialog item ID 328834, and the next is 721992? You have nearly 400,000 items in your dialog? o_O I think you might have been using the HWND values from a specific run?

If you are using installoptions, then the controls on your dialog start numbering their dialog item ID at 1200 for the first control, then move on to 1201 for the 2nd, 1202 = 3, etc.

Alternatively, you can get the HWND (which changes every time the dialog is created), from the INI file:
'ReadINIStr $R1 $PLUGINSDIR\test.ini "Field 1" "HWND"', and use that directly (no need for GetDlgItem) in your SetCtlColors call.

Hi,

No I am not using any external theme/skin. I am using the Ultra Modern UI.

BTW, Where can I use this code, pre function? or show function?

ReadINIStr $R1 $PLUGINSDIR\test.ini "Field 1" "HWND"

Is there a show function available for CustomPage like the inbuild pages of NSIS?


you would use that code -after- you initialize the dialog.

Can't say I have any experience with UMUI itself, but I suspect that's why the background color doesn't match.

Once you've got the correct HWNDs, try setting the background color to 'transparent' before specifying the color directly. If that works, then you don't have to worry about any background color changes in the future, should you choose to use a different UMUI background color.


You do realise that Page Custom doesn't have a pre function; only show and leave. You are showing your custom page in its leave function.

Stu