15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Custom Icon For Modeless Di

Derek Bernhart -- derek_bernhart@affymetrix.com
Saturday, August 03, 1996

Environment: NT 4.0b2/Visual C++ 4.2

I'm having problems setting a custom icon for a modeless dialog.
I using the RegisterClass(WNDCLASS *) function to registry my dialog =3D
class only once per application instance. 
I'm setting the Class Name Identifier in the dialog template in the .RC =
=3D
file, but it doesn't seem to work.

Dialog template code from the .rc file:

STATUSDLG DIALOGEX 0, 0, 199, 159
STYLE WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU
CAPTION "Batch Tool Status"
CLASS "STATUSDLGCLASS"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
    GROUPBOX        "Status",IDC_PROCESSGROUP,17,15,165,116
    PUSHBUTTON      "Start",IDSTART,41,138,50,14
    EDITTEXT        IDC_PROGRESSSTATUS,27,30,145,69,ES_MULTILINE | 
                    ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
    PUSHBUTTON      "Cancel",IDCANCEL,107,138,50,14
    CONTROL         =3D
"Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,
                    44,107,109,14,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE
END

Thanks





Qing Zhao -- qzhao@syncro.com
Tuesday, August 06, 1996

[Mini-digest: 3 responses]

Please check Visual C++ Quick Reference

Dialog Properties: General
-----From: funduc@sprynet.com

Try SetIcon().  See MFC doco on parameters.

Mike Funduc
Funduc Software Inc.
Check out "Search and Replace" and other Share/Freeware at URLs below.
102372.2530@compuserve.com
funduc@sprynet.com
http://home.sprynet.com/sprynet/funduc
http://ourworld.compuserve.com/homepages/funduc

-----From: Mario Contestabile

Try 
SetIcon(AfxGetApp()->LoadIcon(ID_ICONX), TRUE);
in OnInitDialog().

mcontest@universal.com





| Вернуться в корень Архива |