I have modal dialog, what adds entity. This changes show, when the modal dialog hides and Autocad gets focus.
I want to show this changes, without change focus to Autocad Window. How to do it?
Solved! Go to Solution.
Solved by tbrammer. Go to Solution.
Thanks, but it doesnot work:
I try only:
acedGetAcadDwgView()->PostMessage(WM_MOUSEMOVE, 0L, 0L);
and also (part of method of my own modal window):
//----
ShowWindow(SW_HIDE);
EnableWindow(FALSE);
CWnd::FromHandle(adsw_acadMainWnd())->EnableWindow(TRUE);
CWnd::FromHandle(adsw_acadMainWnd())->ShowWindow(SW_SHOW);
CWnd::FromHandle(adsw_acadMainWnd())->SetFocus();
//-----
acedGetAcadDwgView()->PostMessage(WM_MOUSEMOVE, 0L, 0L);
acedUpdateDisplay();
CWnd::FromHandle(adsw_acadMainWnd())->RedrawWindow();
//----
acedRedraw(NULL, 1);
CWnd::FromHandle(adsw_acadMainWnd())->RedrawWindow();
CWnd::FromHandle(adsw_acadMainWnd())->EnableWindow(FALSE);
ShowWindow(SW_SHOW);
EnableWindow(TRUE);
and nothing....
I don't think that you need to give the focus to AutoCAD to update the graphic system. You will need the focus if you need any user input in the AutoCAD editor.
How does your modeless dialog interact with AutoCAD? Do you call ARX API functions directry from message handlers? It is safer to define a command and call it by
acDocManager->sendStringToExecute(acDocManager->curDocument(), _T("MyCommand"),false, true);
See <ARXSDK>\samples\editor\mfcsamps\modeless.
If you don't make changes in a normal command context you must make sure to lock your document. The easiest way is to use an AcAxDocLock simply by adding the line:
AcAxDocLock lock;
You can try this to force an update of the graphic system:
if (actrTransactionManager->numActiveTransactions() <= 0)
{
actrTransactionManager->queueForGraphicsFlush();
actrTransactionManager->flushGraphics();
}
acedUpdateDisplay();
or try these:
acedRedraw(NULL,1);
acedCommandS(RTSTR, _T("_REGEN"), RTNONE);
int acdbQueueForRegen(const AcDbObjectId *pIdArray, int nNumIds);
void ads_regen(); // Undocumented feature. No header available. Use at own Risk.
ads_regen();
I asked for modeless or modal dialog. I tested it on modal dialog.
I call standard command:
acedRegCmds->addCommand(_T("MAJCUT"), _T("MC"), _T("MC"), ACRX_CMD_MODAL, ZobrazMainCutDialog);
My idea is to work with modeless dialog only if user have more monitors (displays)...
It seems to be more difficult problem, that I have imagined :-).
And yes, I call API functions from my dialog message handlers. Eg. for adding entity, etc...
Can't find what you're looking for? Ask the community or share your knowledge.