Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Input from dialogue
#2
Macro Macro2971
Code:
Copy      Help
int MOM=win("Multichannel Order Manager" "momwin9c000000")
DateTime t.FromComputerTime
str PipDate=t.ToStrFormat("{MM/dd/yy}")

str Order
str iDate
str User
str TrkInv
str Note

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 168 106 "EZ Main PO"
;10 Static 0x54000000 0x0 23 96 122 12 "Press Pause on keyboard if stuck."
;3 ComboBox 0x54230243 0x0 24 20 120 213 ""
;4 Static 0x54000000 0x0 36 56 20 12 "Date"
;5 Edit 0x54030080 0x200 56 56 56 12 "Date"
;6 Static 0x54000000 0x0 8 40 48 12 "Tracking\Inv#"
;7 Edit 0x54030080 0x200 56 40 88 12 "TrkInv"
;8 ComboBox 0x54230243 0x0 48 4 96 213 ""
;9 Static 0x54000000 0x0 24 4 24 13 "User:"
;11 Button 0x54032000 0x0 40 72 88 22 "Send to MOM"
;12 Button 0x54032000 0x0 136 72 24 22 "End"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "3 5 7 8"
str cb3 e5Dat e7Trk cb8
cb8=
;&NJB
;TAM
;PIP
;TJW
cb3=
;&Open Order Report Sent
;Received PO Confirmation
;Invoiced
;ETA Set
;Shipped
;Delivered
;Received
;Closing when
e5Dat=PipDate
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 11
,DT_GetControls hDlg
,EnableWindow lParam 0
,opt waitmsg 1
,int-- t_thread
,t_thread=mac("sub.Macro" "" cb3 e5Dat e7Trk cb8)
,wait 0 H t_thread
,t_thread=0
,EnableWindow lParam 1
,
,case 12
,if(t_thread) EndThread "" t_thread
ret 1


#sub Macro
function str'Order str'iDate str'TrkInv str'User

out
out Order
out iDate
out TrkInv
out User

spe -1
mes "macro"

Not the simplest version, but I would do it like this. The macro runs in other thread. Simpler would be to run in dialog's thread, with opt waitmsg 1.

I placed the macro in #sub Macro, but you can move the code to a separate macro and use its name instead of "sub.Macro". Then, if the dialog itself is macro, two macros cannot run simultaneously, need to change something in the Properties dialog -> Macro properties.


Messages In This Thread
User Input from dialogue - by sirpipthegreat - 03-08-2018, 03:55 PM
Example: run macro from dialog, keep dialog open - by Gintaras - 03-08-2018, 04:30 PM
RE: User Input from dialogue - by Gintaras - 03-08-2018, 04:49 PM
RE: User Input from dialogue - by sirpipthegreat - 03-08-2018, 04:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)