The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog return value
#1
If I have dialog in a function called "test_return_value", how can I return any value (negative, 0 or positive) upon pressing a button in that dialog?
For example the below dialog, see button text. (Preferably without using thread/global vairables.)

If want to use the function "test_return_value" function like this:
Code:
Copy      Help
if(test_return_value=-77) out "-77"

I can't do it with: DT_Ret(hDlg -77), DT_Ok(hDlg -77), DT_EndDialog(hDlg -77), ...
(if it is possible, then I am using in an incorrect way).

Function test_return_value
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 72 44 86 39 "upon pressing this button, close this dialog and return -77"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,,;; When this button is pressed
,,;; 1. Close this dialog
,,;; 2. Return: -77
,,;; ...
ret 1


Messages In This Thread
Dialog return value - by r0n - 07-09-2019, 04:35 PM
RE: Dialog return value - by Gintaras - 07-09-2019, 04:50 PM
RE: Dialog return value - by r0n - 07-09-2019, 05:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)