c++ - Why does my dialog box appear like this? -
i have created simple dialog box in resource file. when try spawn using dialogbox(), dialog appears looks not have window. don't know why happens. advice?
it looks when running, can see there no window. check boxes, text , stuff don't have background, , there no title bar. nothing.
and should show this:
the code use spawn is:
bool mostrarventanaconfiguracion() { dialogbox(getmodulehandle(0), makeintresource(id_diag_config), null, (dlgproc)ventanaconfiguracion); return true; }
this .rc file code:
language lang_neutral, sublang_neutral id_diag_config dialog 260, 200, 339, 203 style ds_3dlook | ds_center | ds_modalframe | ds_shellfont | ws_caption | ws_popup | ws_sysmenu | ws_border | ws_visible caption "configuración" font 8, "ms shell dlg" { ltext "pulsar la combinación de teclas.", 0, 218, 18, 102, 9, ss_left, ws_ex_left control "", id_conf_macro, hotkey_class, ws_tabstop, 136, 16, 77, 12, ws_ex_left edittext id_conf_indicativo, 16, 16, 70, 12, es_autohscroll, ws_ex_left autocheckbox "check", id_a_reunion, 14, 67, 8, 8, 0, ws_ex_left ltext "... avisos de reuniones o 10-80 general.", 0, 28, 67, 125, 9, ss_left, ws_ex_left groupbox "configuración de los avisos", 0, 5, 36, 328, 142, 0, ws_ex_left pushbutton "cancelar", idcancel, 220, 184, 49, 14, 0, ws_ex_left defpushbutton "guardar\r\n", idok, 280, 184, 54, 14, 0, ws_ex_left autocheckbox "check", id_a_seisadam, 14, 80, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_codigocinco, 14, 92, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_centralita, 14, 105, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_rep_unidades, 14, 117, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_propio, 14, 129, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_pedidos, 14, 141, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_pedidos_swat, 14, 153, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_sin_asig, 14, 165, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_panico, 187, 67, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_apoyo, 187, 79, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_herido, 187, 91, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_robo_coche, 187, 103, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_robo_casa, 187, 115, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_robo_neg, 187, 127, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_papafox, 187, 139, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_robo_banco, 187, 151, 8, 8, 0, ws_ex_left autocheckbox "check", id_a_custodia, 187, 163, 8, 8, 0, ws_ex_left ltext "recibir notificaciones sonoras para...", 0, 14, 50, 117, 9, ss_left, ws_ex_left ltext "... avisos de cÓdigo 6-adam.", 0, 28, 79, 100, 9, ss_left, ws_ex_left ltext "... avisos de cÓdigo 5.", 0, 28, 91, 77, 9, ss_left, ws_ex_left ltext "... avisos de centralita roleados.", 0, 28, 103, 100, 9, ss_left, ws_ex_left ltext "... pedidos de reportes de unidades.", 0, 28, 115, 114, 9, ss_left, ws_ex_left ltext "... avisos mi propia unidad o nombre.", 0, 28, 127, 122, 9, ss_left, ws_ex_left ltext "... avisos de pedidos generales (10-32, 10-37...)", 0, 28, 139, 150, 9, ss_left, ws_ex_left ltext "... avisos de pedidos para swat", 0, 28, 151, 105, 9, ss_left, ws_ex_left ltext "... avisos de agentes sin asignación.", 0, 28, 163, 115, 9, ss_left, ws_ex_left ltext "... avisos de botón de pánico.", 0, 201, 67, 94, 9, ss_left, ws_ex_left ltext "... avisos de solicitud de apoyo (/ref)", 0, 201, 79, 115, 9, ss_left, ws_ex_left ltext "... avisos de herido.", 0, 201, 91, 62, 9, ss_left, ws_ex_left ltext "... avisos de robo de vehículo.", 0, 201, 103, 97, 9, ss_left, ws_ex_left ltext "... avisos de robo vivienda. ", 0, 201, 115, 94, 9, ss_left, ws_ex_left ltext "... avisos de robo negocio.", 0, 201, 127, 90, 9, ss_left, ws_ex_left ltext "... avisos de alarma de prisión federal.", 0, 201, 139, 119, 9, ss_left, ws_ex_left ltext "... avisos de robo banco.", 0, 201, 151, 85, 9, ss_left, ws_ex_left ltext "... avisos de sospechosos bajo custodia.", 0, 201, 163, 128, 9, ss_left, ws_ex_left groupbox "configuración del indicativo", 0, 7, 4, 114, 28, 0, ws_ex_left groupbox "macro para desactivar el programa temporalmente", 0, 127, 4, 206, 28, 0, ws_ex_left }
i fixed it. returning true in dialog procedure instead of false.
from msdn:
"typically, dialog box procedure should return true if processed message, , false if did not. if dialog box procedure returns false, dialog manager performs default dialog operation in response message."
Comments
Post a Comment