Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Icon (static) in dialog not displaying in real size
#1
I have an icon resource in a dialog defined like this:
Code:
Copy      Help
str s3=
:100 d:\images\test.ico

The test.ico is 48x48 icon file.
When I run the dialog the icon has a small size.

I looked in the styles dialog in the dialog editor and experimented with:
SS_ICON:
- SS_REALSIZE CONTROL
- SS_CENTERIMAGE
- SS_REALSIZEIMAGE

But whatever I try, the icon is rendered in it's (smallest?) size. The control on which I want to render the icon is a Static "Icon".
Its container name is "si8"
I set the variable like this:
Code:
Copy      Help
si8=":100"

It works, but it's rendered to small.
#2
Function dialog_static_icon_48x48
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Static 0x54000003 0x0 0 0 16 16 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "3"
str si3
;si3="$system$\shell32.dll,3" ;;16x16
;si3="&$system$\shell32.dll,3" ;;32x32
;cannot set other icon size here
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,__Hicon- t_hi1=GetFileIcon("$system$\shell32.dll,3" 0 MakeInt(0 48))
,SendDlgItemMessage hDlg 3 STM_SETICON t_hi1 0
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
WOW! Thank you!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)