Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog without taskbar button, caption and frame
#1
To remove taskbar button, set WS_EX_TOOLWINDOW style (in the Dialog Editor). Other way - specify an owner window (5-th argument of ShowDialog). You, for example, can create a temporary hidden window.

To remove frame, you have to remove caption too. For normal windows it is easy - you simply set appropriate style when creating it. But for dialogs, caption and frame is always added, so you have to set style at run time.

Function dialog_with_toolwindow_style:
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dialog_with_toolwindow_style" &dialog_with_toolwindow_style 0)) ret

;BEGIN DIALOG
;0 "" 0x10C80A46 0x188 0 0 223 139 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "*" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,SetWinStyle hDlg WS_POPUP 8
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1


Function dialog_with_temp_owner:
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

int hh=CreateWindowEx(WS_EX_TOPMOST "#32770" 0 0 0 0 0 0 0 0 _hinst 0)
int r=ShowDialog("dialog_with_temp_owner" &dialog_with_temp_owner 0 hh)
DestroyWindow(hh)
if(!r) ret

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 134 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "*" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,SetWinStyle hDlg WS_POPUP 8
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1


Forum Jump:


Users browsing this thread: 1 Guest(s)