08-25-2007, 12:41 PM
For me does not work too. But works if the window belongs to the same thread.
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("Dialog36" &Dialog36)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 0 121 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,int hwnd=hDlg
,
,POINT p;
,GetCursorPos(&p);
,int SysMenu=GetSystemMenu(hwnd 0)
,int intSelected = TrackPopupMenuEx(SysMenu TPM_RETURNCMD p.x p.y hwnd 0)
,
,SendMessage(hwnd WM_SYSCOMMAND intSelected 0)
,case IDOK
,case IDCANCEL
ret 1