1 extern "C" DllExport void ufusr(char *param, int *retcod, int param_len)
2 {
3
4 if (UF_initialize())
5 {
6 /* Failed to initialize */
7 return;
8 }
9 // The following method shows the dialog immediately
10
11 AFX_MANAGE_STATE(AfxGetStaticModuleState());
12
13 HWND UGHwnd = (HWND)UF_UI_get_default_parent();//获取UG窗口句柄
14 CWnd *ugwindow = CWnd::FromHandle(UGHwnd);
15
16 CRect rect;
17 ugwindow->GetWindowRect(&rect);//获取UG矩形窗口的左上角坐标点和右下角坐标点
18
19 CFirstMFCDialog *dlg = new CFirstMFCDialog(ugwindow);
20 if (dlg != NULL)
21 {
22 BOOL ret = dlg->Create(IDD_DIALOG1, ugwindow);//创建对话框
23 dlg->ShowWindow(SW_SHOW);//显示对话框
24 dlg->SetWindowPos(ugwindow, rect.left, rect.bottom-265, 200, 200, SWP_NOSIZE);//设置对话框固定位置
25 //rect.bottom-265为减去对话框的高度
26 }
27
28 UF_terminate();
29 }
30
31 Caesar卢尚宇
32 2019年7月15日
