/* undsms.cmd ... 「ですます」調のメッセージ・ボックスをマイルドに装飾:-) */ if IsMessageBox() then call MessageFilter exit 0 /* 現在のメイン・ウィンドウがメッセージボックスかどうかチェックする */ IsMessageBox: procedure if ArxQueryWindowInfo('CLIENT','dummy') then return 0 drop dummy. call ArxEnumWindowHandle 'MAIN','hwnd' if hwnd.0=0 then return 0 existcaption = 0 /* キャプションの有無 */ existmessage = 0 /* メッセージの有無 */ existsysicon = 0 /* システムアイコンの有無 */ existbutton = 0 /* ボタンの数 */ do li = 1 to hwnd.0 if \ArxQueryWindowInfo('HWND:'hwnd.li,'info') then leave id = X2D(SUBSTR(info.ID,2)) select when id=32771/*FID_TITLEBAR*/ then do if info.CLASS='#9'/*WC_TITLEBAR*/ then do existcaption = 1 end end when id=400 then do if info.CLASS='#5'/*WC_STATIC*/ then do if X2D(RIGHT(info.STYLE,1))=1/*SS_TEXT*/ then do existcaption = 1 end end end when id=300 then do if info.CLASS='#5'/*WC_STATIC*/ then do if X2D(RIGHT(info.STYLE,1))=11/*SS_SYSICON*/ then do existsysicon = 1 end end end when id=200 then do if info.CLASS='#5'/*WC_STATIC*/ then do if X2D(RIGHT(info.STYLE,1))=1/*SS_TEXT*/ then do existmessage = 1 end end end when (id>=1 & id<=9) | (id>=101 & id<=103) then do if info.CLASS='#3'/*WC_BUTTON*/ then do existbutton = existbutton + 1 end end when id=32770/*FID_SYSMENU*/ | id=32772/*FID_MINMAX*/ then do if info.CLASS='#4'/*WC_MENU*/ then do nop end else leave end otherwise leave end end if \existcaption | \existmessage | \existsysicon | existbutton\=4 then do return 0 end return 1 /* メッセージ文字列を変換する */ MessageFilter: procedure if \ArxQueryWindowString(200,'str') then return options exmode li = 1 do forever len = length(str) if len