Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog in "ExeOutputWindow"
#1
Photo 
I want to be able to see the function of "ExeOutputWindow" when selecting a specific page in the dialog.
I searched many ways but I could not find a way.

I wish you a lot of help.


Function _555
Code:
Copy      Help
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 264 160 "Dialog"
;3 ListBox 0x54230101 0x204 4 4 96 80 ""
;1001 Static 0x54020000 0x4 112 4 48 13 "Page0"
;1101 Static 0x54020000 0x4 112 4 48 13 "Page1"
;1201 Static 0x54020000 0x4 112 4 48 13 "Page2"
;1202 RichEdit20A 0x54233044 0x200 108 24 146 94 ""
;1 Button 0x54030001 0x4 136 140 48 14 "OK"
;2 Button 0x54030000 0x4 188 140 48 14 "Cancel"
;4 Button 0x54032000 0x4 240 140 18 14 "?"
;5 Static 0x54000010 0x20004 0 132 800 2 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040800 "*" "2" "" ""

str controls = "3 1202"
str lb3 re1202
lb3="&Page0[]Page1[]Page2"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,sub.SelectPage hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3
,sub.SelectPage hDlg
ret 1


#sub SelectPage
function hDlg
int page=LB_SelectedItem(id(3 hDlg))
DT_Page hDlg page


Attached Files Image(s)
   
#2
Function ExeOutputControl
Code:
Copy      Help
;/
function hwnd

;Converts a RichEdit20W control in your exe dialog to a simple output window.

;hwndOwner - handle of a control of class RichEdit20W. In the dialog definition can be like this: 3 RichEdit20W 0x50203844 0x0 0 0 322 124 ""

;REMARKS
;This function is used in exe. Call it under case WM_INITDIALOG in your dialog.
;Supports just basic output features. No tags/links, history, buffering.
;Uses <help>RedirectQmOutput</help> to capture all output text (<help>out</help>, errors, etc) of current process.
;Current process cannot have multiple output controls or windows (ExeOutputControl, ExeOutputWindow).

;See also: <ExeConsoleRedirectQmOutput>


SetWindowSubclass(hwnd &sub.WndProc_Subclass 1 0)
int- t_eoc_hwnd; t_eoc_hwnd=hwnd
RedirectQmOutput &sub.OutRedirProc


#sub WndProc_Subclass v
function# hwnd message wParam lParam uIdSubclass dwRefData
sel message
,case WM_DESTROY
,RedirectQmOutput 0
,
,case WM_CONTEXTMENU
,sel ShowMenu("1 Clear" hwnd)
,,case 1 out

int R=DefSubclassProc(hwnd message wParam lParam)
sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
ret R


#sub OutRedirProc
function# str&s reserved

int- t_eoc_hwnd
int h=t_eoc_hwnd

if !&s
,_s.setwintext(h)
,ret 1

s+"[10]"
SendMessageW h EM_SETSEL -1 -1
SendMessageW h EM_REPLACESEL 0 @s
SendMessageW h WM_VSCROLL SB_BOTTOM 0
ret 1

example
Macro Macro278
Code:
Copy      Help
;/exe

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 264 160 "Dialog"
;3 ListBox 0x54230101 0x204 4 4 96 80 ""
;1001 Static 0x54020000 0x4 112 4 48 13 "Page0"
;1101 Static 0x54020000 0x4 112 4 48 13 "Page1"
;1201 Static 0x54020000 0x4 112 4 48 13 "Page2"
;1202 RichEdit20A 0x50203844 0x200 108 24 146 94 ""
;6 Button 0x54032000 0x0 8 96 48 14 "test output"
;1 Button 0x54030001 0x4 136 140 48 14 "OK"
;2 Button 0x54030000 0x4 188 140 48 14 "Cancel"
;4 Button 0x54032000 0x4 240 140 18 14 "?"
;5 Static 0x54000010 0x20004 0 132 800 2 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040800 "*" "2" "" ""

str controls = "3 1202"
str lb3 re1202
lb3="&Page0[]Page1[]Page2"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,sub.SelectPage hDlg
,ExeOutputControl id(1202 hDlg)
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3
,sub.SelectPage hDlg
,
,case 6 out "test output"
ret 1


#sub SelectPage
function hDlg
int page=LB_SelectedItem(id(3 hDlg))
DT_Page hDlg page


Forum Jump:


Users browsing this thread: 1 Guest(s)