* Windows MessageBox sample code; * Richard A. DeVenezia; * http://www.devenezia.com; filename msgbox catalog 'work.winapi.msgbox.source'; data _null_; file msgbox; input; put _infile_; cards4; routine MessageBoxA module=USER32 minarg=4 maxarg=4 stackpop=called returns=short ; arg 1 input num format=pib4. byvalue; * Window parent, always use 0; arg 2 input char format=$cstr200.; * Message ; arg 3 input char format=$cstr200.; * Title; arg 4 input num format=pib4. byvalue; * Style; * arg4 - style; * 0 OK button only * 1 OK and Cancel buttons * 2 Abort, Retry and Ignore buttons * 3 Yes, No, Cancel buttons * 4 Yes, No buttons * 5 Retry , cancel buttons * 16 Icon=Stop sign (hand) * 32 Icon=Question mark * 48 Icon=Exclamation mark * 64 Icon=i (info) symbol * 0 Button 1 is default * 256 Button 2 is default * 512 Button 3 is default * 0 Application modal * 4096 System modal (all windows apps are inaccesible until user responds) ; * return codes * 0 Out of memory * 1 OK pressed * 2 Cancel pressed * 3 Abort pressed * 4 Retry pressed * 5 Ignore pressed * 6 Yes pressed * 7 No pressed ; ;;;; run; filename sascbtbl catalog 'work.winapi.msgbox.source' ; ******************************************************************************; * show message box while in data step; data _null_; YNC = 3; CRLF = byte (13) || byte (10); rc = modulen ( 'MessageBoxA', 0 , 'This is message line 1.' || CRLF || 'This is message line 2.' , 'This is the Title' , bOr (YNC, 512)); run; ******************************************************************************; * show message box from macro system; %let rc = %sysfunc (modulen( MessageBoxA, 0, Message from macro., You have been warned, 0)));