/************************************************************************* Display the dialog and wait for user *************************************************************************/ bool Win32CEGuiRendererSelector::invokeDialog() { // dialog template was not created so abort. if (!d_template) return false; int renderer_count = 0; CEGuiRendererType first_available = InvalidGuiRendererType; // Check number of renderer modules available for (int i = 0; i < RendererTypeCount; ++i) { if (d_rendererAvailability[i]) { ++renderer_count; if (first_available == InvalidGuiRendererType) first_available = static_cast<CEGuiRendererType>(i); } } // if there is only one renderer, select that one, but do not show dialog if (renderer_count == 1) { d_lastSelected = first_available; return true; } // multiple renderer modules available, so show dialog & return result return (1 == DialogBoxIndirectParam(GetModuleHandle(0), d_template, 0, Win32CEGuiRendererSelector::dialogProcedure, reinterpret_cast<LPARAM>(this))); }
static void InitMainDialogBox (HWND hDlg) { MainDlgInitProgress.controls = MainCtrlInitProgress; MainDlgInitProgress.controlnr=5; DialogBoxIndirectParam (&MainDlgInitProgress, hDlg, InitMainDialogBoxProc, 0L); }
// creates a dialog box that dynamically gets a right-to-left layout if needed static INT_PTR CreateDialogBox(int dlgId, HWND parent, DLGPROC DlgProc, LPARAM data) { if (!IsUIRightToLeft()) return DialogBoxParam(NULL, MAKEINTRESOURCE(dlgId), parent, DlgProc, data); ScopedMem<DLGTEMPLATE> rtlDlgTemplate(GetRtLDlgTemplate(dlgId)); return DialogBoxIndirectParam(NULL, rtlDlgTemplate, parent, DlgProc, data); }
void dialog::create(INT_PTR &out) { void *mem = calloc(0x1000, 1); LPCDLGTEMPLATE dlgTemplate = DlgTemplate(mem); out = DialogBoxIndirectParam(hInstance, dlgTemplate, hParent, (DLGPROC)DlgProcRouter, (LPARAM)this); free(mem); }
INT_PTR LocalizedDialogBoxParam(const UINT dialogId, DLGPROC dialogFunc, const LPARAM param) { LPCDLGTEMPLATE resInfo = LocalizedDialogResource(dialogId); if (resInfo == NULL) return -1; return DialogBoxIndirectParam(o.hInstance, resInfo, NULL, dialogFunc, param); }
INT_PTR ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) { HINSTANCE hInstFound; LPCDLGTEMPLATE pTemplate; if ((pTemplate = TaLocale_GetDialogResource (idd, &hInstFound)) == NULL) return NULL; return DialogBoxIndirectParam (hInstFound, pTemplate, hWndParent, lpDialogFunc, dwInitParam); }
bool W32StandaloneDialogPanel::runDialog(short width, short height) { if ((width > 0) && (height > 0)) { calculateSize(); W32Widget::Size size = minimumSize(); size.Width = std::max(size.Width, width); size.Height = std::max(size.Height, height); setSize(size); } return DialogBoxIndirectParam(GetModuleHandle(0), dialogTemplate(), myMainWindow, StaticCallback, (LPARAM)this); }
int TUnixDialogBox :: DoExecute ( void ) { DialogBoxIndirectParam ( * GetModule ( ), MemoryHandle, ( ParentWindow != NULL ) ? ParentWindow -> HWindow : NULL, ( DLGPROC ) ( FARPROC ) DialogProcInstance, Attr. Param ) ; // C'est bon return ( 0 ) ; }
int MiniGUIMain (int argc, const char* argv[]) { #ifdef _MGRM_PROCESSES JoinLayer(NAME_DEF_LAYER , "scrollview" , 0 , 0); #endif DlgBook.controls = CtrlBook; DialogBoxIndirectParam (&DlgBook, HWND_DESKTOP, BookProc, 0L); return 0; }
int MiniGUIMain (int argc, const char* argv[]) { #ifdef _MGRM_PROCESSES JoinLayer(NAME_DEF_LAYER , "propsheet" , 0 , 0); #endif DlgPropSheet.controls = CtrlPropSheet; DialogBoxIndirectParam (&DlgPropSheet, HWND_DESKTOP, PropSheetProc, 0L); return 0; }
INT_PTR OBSDialogBox(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) { if (!LocaleIsRTL()) return DialogBoxParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam); HRSRC dlg = FindResource(hInstance, lpTemplateName, RT_DIALOG); HGLOBAL rsc = LoadResource(hInstance, dlg); List<BYTE> tmpl; tmpl.InsertArray(0, (BYTE const*)LockResource(rsc), SizeofResource(hInstance, dlg)); *(DWORD*)&tmpl[sizeof WORD * 2 + sizeof DWORD] |= WS_EX_LAYOUTRTL; return DialogBoxIndirectParam(hInstance, (LPCDLGTEMPLATE)&tmpl[0], hWndParent, lpDialogFunc, dwInitParam); }
int MiniGUIMain (int argc, const char* argv[]) { #ifdef _MGRM_PROCESSES JoinLayer(NAME_DEF_LAYER , "spinbox" , 0 , 0); #endif DlgSpin.controls = CtrlSpin; DialogBoxIndirectParam (&DlgSpin, HWND_DESKTOP, SpinProc, 0L); return 0; }
int ShowWifiTip(HWND hParent, tipLabelData_t* info, int full_screen) { DLGTEMPLATE dlg; CDR_RECT rect; if(info == NULL) { db_error("invalid info\n"); return -1; } memset(&dlg, 0, sizeof(dlg)); rect = info->rect; info->full_screen = full_screen; //if(full_screen) { rect.x = 0; rect.y = 0; getScreenInfo(&rect.w,&rect.h); db_msg(" rect(%d %d %d %d)", rect.x, rect.y, rect.w, rect.h); } ctrlData1[0].x = 0; ctrlData1[0].y = 0; ctrlData1[0].w = rect.w; ctrlData1[0].h = info->titleHeight; ctrlData1[0].caption = info->title; //if (info->hasicon == true) { ctrlData1[1].x = 60; ctrlData1[1].w = rect.w - 60; ctrlData1[1].h = rect.h - 10 - ctrlData1[0].h; ctrlData1[1].y = ctrlData1[0].h +(ctrlData1[1].h/4); ctrlData1[1].caption = info->text; ctrlData1[1].dwStyle = WS_VISIBLE | SS_LEFT; } ResourceManager *rm = ResourceManager::getInstance(); dlg.dwStyle = WS_VISIBLE; dlg.dwExStyle = WS_EX_NONE; dlg.x = rect.x; dlg.y = rect.y; dlg.w = rect.w; dlg.h = rect.h; dlg.caption = ""; dlg.hIcon = 0; dlg.hMenu = 0; dlg.controlnr = 2; dlg.controls = ctrlData1; dlg.dwAddData = 0; return DialogBoxIndirectParam(&dlg, hParent, DialogProc, (LPARAM)info); }
MRPWindow::ModalResult MRPModalDialog::runModally() { m_is_modal = true; #ifdef WIN32 MyDLGTEMPLATE t; t.style = DS_SETFONT | DS_FIXEDSYS | WS_CAPTION | WS_SYSMENU; t.cx = 200; t.cy = 100; DialogBoxIndirectParam(g_hInst, &t, m_parent_hwnd, dlgproc, (LPARAM)this); #else DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EMPTYDIALOG), m_parent_hwnd, dlgproc, (LPARAM)this); #endif return m_modal_result; }
int CBaseWindow::CreateDialogBox( HWND hwnd, CBaseWindow *p_obj ) { uint8_t p_buffer[sizeof(DLGTEMPLATE) + sizeof(WORD) * 4]; DLGTEMPLATE *p_dlg_template = (DLGTEMPLATE *)p_buffer; memset( p_dlg_template, 0, sizeof(DLGTEMPLATE) + sizeof(WORD) * 4 ); // these values are arbitrary, they won't be used normally anyhow p_dlg_template->x = 0; p_dlg_template->y = 0; p_dlg_template->cx = 300; p_dlg_template->cy = 300; p_dlg_template->style = DS_MODALFRAME|WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX; return DialogBoxIndirectParam( GetModuleHandle(0), p_dlg_template, hwnd, (DLGPROC)p_obj->BaseWndProc, (LPARAM)p_obj); }
unsigned int MsgBox::doModal( HWND parent /* = NULL */, bool topmost /*= false*/, unsigned int timeOutTicks /*= INFINITE*/ ) { topmost_ = topmost; if( parent == NULL ) parent = getDefaultParent(); if( buttons_.empty() && timeOutTicks == INFINITE ) { result_ = TIME_OUT; return result_; } model_ = true; DLGTEMPLATE dlg[ 2 ] = { { 0 } }; dlg->style = DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_VISIBLE | WS_SYSMENU; dlg->dwExtendedStyle = 0; dlg->cdit = 0; dlg->x = 0; dlg->y = 0; dlg->cx = 100; dlg->cy = 100; timeOut_ = timeOutTicks; ShowCursorHelper scopedShowCursor( true ); result_ = (unsigned int) DialogBoxIndirectParam ( GetModuleHandle( NULL ), dlg, parent, dialogProc, (LPARAM)this ); return getResult(); }
INT_PTR FileInfViewDlgShow(HINSTANCE hInst, HWND hwndOwner, CFilesInf* pFilesInf) { HRSRC r = FindResource(hInst, MAKEINTRESOURCE(IDD_DLG_FILES_INF), RT_DIALOG); HGLOBAL g = LoadResource(hInst, r); IMalloc *pIMalloc; HRESULT hr = SHGetMalloc(&pIMalloc); if (FAILED(hr)) return 0; FilesInfDlgData* dlgData = (FilesInfDlgData*) pIMalloc->Alloc(sizeof(FilesInfDlgData)); dlgData->filesInf = pFilesInf; INT_PTR ret = DialogBoxIndirectParam(hInst, (LPDLGTEMPLATE)LockResource(g), hwndOwner, (DLGPROC)FileInfViewDlgProc, (LPARAM)dlgData); pIMalloc->Free(dlgData); pIMalloc->Release(); return ret; }
/** ** Higher-level interface: Windows Preview (-m pre or nothing) **/ int to_emw(const GEN_PAR * pg, const OUT_PAR * po) { PGPO par; PWORD p; LPDLGTEMPLATE templ; p = (PWORD) GlobalAlloc(GPTR, sizeof(DLGTEMPLATE) + 8); templ = (LPDLGTEMPLATE) p; // Memory is already zeroed so i dont set zeroes // Start to fill in the dlgtemplate information, addressing by WORDs. templ->style = WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME; templ->cx = 480; // size in "dialog units" templ->cy = 320; // since i allocated 8 extra bytes i have menu=0 class=0 title=0 // which means no menu standard dialog and no title // i fix title in WM_INIT and background by WM_ERASEBKGND par.pg = pg; par.po = po; DialogBoxIndirectParam(0, templ, 0, Preview, (LPARAM) & par); GlobalFree(GlobalHandle(p)); return 0; }
void testPropertySheet (HWND hWnd) { DlgPropertySheet.controls = CtrlPropertySheet; DialogBoxIndirectParam (&DlgPropertySheet, hWnd, PropSheetProc, 0L); }
static void inputPassword( HWND hParent, char * pw) { PopWinData.controls = CtrlInitProgress; DialogBoxIndirectParam (&PopWinData, hParent, inputBoxProc, (DWORD)pw); }
//------------------------------------------------------------------------------------------------------- bool checkEffectEditor (AEffect* effect) { if ((effect->flags & effFlagsHasEditor) == 0) { printf ("This plug does not have an editor!\n"); return false; } #if _WIN32 theEffect = effect; MyDLGTEMPLATE t; t.style = WS_POPUPWINDOW|WS_DLGFRAME|DS_MODALFRAME|DS_CENTER; t.cx = 100; t.cy = 100; DialogBoxIndirectParam (GetModuleHandle (0), &t, 0, (DLGPROC)EditorProc, (LPARAM)effect); theEffect = 0; #elif _LINUX Display *dpy; Window win; XEvent e; char effect_name[256]; // arbitrary, vst GetEffectName is max 32 chars Atom wmDeleteMessage, prop_atom, val_atom; // create the window dpy = XOpenDisplay(NULL); win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 300, 300, 0, 0, 0); // we want an event when the window is being closed wmDeleteMessage = XInternAtom(dpy, "WM_DELETE_WINDOW", false); XSetWMProtocols(dpy, win, &wmDeleteMessage, 1); // Make the window a Dialog, maybe the window manager will place it centered prop_atom = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); val_atom = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); XChangeProperty(dpy, win, prop_atom, XA_ATOM, 32, PropModeReplace, (unsigned char *)&val_atom, 1); // prepare the plugin name in the title bar effect->dispatcher(effect, effGetEffectName, 0, 0, effect_name, 0); strcat(effect_name, " [minihost]"); XStoreName(dpy, win, effect_name); // Get and prepare editor size ERect* eRect = 0; printf ("HOST> Get editor rect..\n"); effect->dispatcher (effect, effEditGetRect, 0, 0, &eRect, 0); if (eRect) { int width = eRect->right - eRect->left; int height = eRect->bottom - eRect->top; printf("GetRect -> %d, %d\n", width, height); XResizeWindow(dpy, win, width, height); } // ? Is it correct to effEditGetRect above, before effEditOpen ? // Display the window, let the plugin populate it printf ("HOST> Open editor...\n"); XMapWindow(dpy, win); XFlush(dpy); effect->dispatcher (effect, effEditOpen, 0, (VstIntPtr) dpy, (void*) win, 0); // Needs adjusting according to events we want to handle in the loop below XSelectInput(dpy, win, SubstructureNotifyMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | KeyPressMask); while (true) { XNextEvent(dpy, &e); // handle events as needed if (e.type == ClientMessage && e.xclient.data.l[0] == wmDeleteMessage) { break; } } printf ("HOST> Close editor..\n"); effect->dispatcher (effect, effEditClose, 0, 0, 0, 0); XCloseDisplay(dpy); #elif TARGET_API_MAC_CARBON WindowRef window; Rect mRect = {0, 0, 300, 300}; OSStatus err = CreateNewWindow (kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCompositingAttribute | kWindowAsyncDragAttribute | kWindowStandardHandlerAttribute, &mRect, &window); if (err != noErr) { printf ("HOST> Could not create mac window !\n"); return false; } static EventTypeSpec eventTypes[] = { { kEventClassWindow, kEventWindowClose } }; InstallWindowEventHandler (window, windowHandler, GetEventTypeCount (eventTypes), eventTypes, window, NULL); printf ("HOST> Open editor...\n"); effect->dispatcher (effect, effEditOpen, 0, 0, window, 0); ERect* eRect = 0; printf ("HOST> Get editor rect..\n"); effect->dispatcher (effect, effEditGetRect, 0, 0, &eRect, 0); if (eRect) { int width = eRect->right - eRect->left; int height = eRect->bottom - eRect->top; Rect bounds; GetWindowBounds (window, kWindowContentRgn, &bounds); bounds.right = bounds.left + width; bounds.bottom = bounds.top + height; SetWindowBounds (window, kWindowContentRgn, &bounds); } RepositionWindow (window, NULL, kWindowCenterOnMainScreen); ShowWindow (window); EventLoopTimerRef idleEventLoopTimer; InstallEventLoopTimer (GetCurrentEventLoop (), kEventDurationSecond / 25., kEventDurationSecond / 25., idleTimerProc, effect, &idleEventLoopTimer); RunAppModalLoopForWindow (window); RemoveEventLoopTimer (idleEventLoopTimer); printf ("HOST> Close editor..\n"); effect->dispatcher (effect, effEditClose, 0, 0, 0, 0); ReleaseWindow (window); #endif return true; }
/* 建立对话框 */ void CreateDlgIbp2(HWND hWnd) { DlgSet.controls = CtrlSet; DialogBoxIndirectParam(&DlgSet, hWnd, DlgProc, 0L); }
int DebugWinlogonInterface::WlxDialogBoxIndirectParam(HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam) { return (int) DialogBoxIndirectParam((HINSTANCE) hInst, hDialogTemplate, hwndOwner, dlgprc, dwInitParam); }
static void InitDialogBox (HWND hWnd) { DlgInitProgress.controls = CtrlInitProgress; DialogBoxIndirectParam (&DlgInitProgress, hWnd, InitDialogBoxProc, 0L); }
/*-------------------------------------------------------------------------- * Function: _tdb_DoAssertDlg * Expects: char FAR * lpszTest * char FAR * lpszReason * char FAR * lpszFilename * uLONG ulLineNo * uLONG ulCount * void FAR * lpvData * uLONG ulFormat * Returns: int iUserSelection * Purpose: Setup and run the Macintosh Assertion Dialog * History: 10/28/94 MGD - Initial Revision *-------------------------------------------------------------------------- */ TDBAPI( int ) _tdb_DoAssertDlg( LPSZ lpszTest, LPSZ lpszReason, LPSZ lpszFilename, uLONG ulLineNo, uLONG ulCount, LPVOID lpvData, uLONG ulFormat ) { int iUserSelection = ID_OK; // In order to prevent possible nesting of DoAssertDlg. Only enter this section // if we are not currently displaying an Assert. In a true pre-emptive multi-threaded app // there is a small chance that we may execute the test and be paged out before setting // the boolean, but it is a small enough change that I am not going to worry about it for now. if ( !fInDoAssertDialog ) { fInDoAssertDialog = TRUE; if (_hDlgTemplate) { // Hey, Dude! DLGVALS dlgVals; FARPROC lpDlgTest = MakeProcInstance( (FARPROC) _tdb_AssertDlgProc, g_tdb_hinstApp ); dlgVals.lpszTest = lpszTest? lpszTest : _szEmpty; dlgVals.lpszReason = lpszReason? lpszReason : _szEmpty; dlgVals.lpszFilename = lpszFilename? lpszFilename : _szUnknown; dlgVals.ulLineNo = ulLineNo; dlgVals.ulCount = ulCount; dlgVals.lpvData = lpvData; dlgVals.ulFormat = ulFormat; dlgVals.hStackData = g_tdb_hStackData; iUserSelection = DialogBoxIndirectParam( g_tdb_hinstApp, _hDlgTemplate, g_tdb_hwndApp, lpDlgTest, (LPARAM)&dlgVals); FreeProcInstance(lpDlgTest); } else { int iret; int iApproxMessageSize; // To count the potential size of the message to make sure I // don't overflow the szMessageBufferSize sBYTE FAR* szBuf; iApproxMessageSize = wsprintf( _szMessageBoxBuffer, "%s%s\n%s%ld\n\n", _szFile, lpszFilename, _szLineNo, ulLineNo ); szBuf = _szMessageBoxBuffer + iApproxMessageSize; iApproxMessageSize += _fstrlen( lpszReason ); iApproxMessageSize += 256; // 256 is an unofficial size for the amount of data that will // be visible in an Assert as extra data // If there is any data to add and a rough calculation implies that the data will fit // in the buffer, include it. Otherwise, don't include it if ((ulCount > 0) && (iApproxMessageSize<MESSAGE_BUFFER_SIZE)) { switch (ulFormat) { case 'b': case 'B': _FormatBytes((sBYTE FAR*)lpvData, ulCount, szBuf); break; case 'w': case 'W': _FormatWords((sBYTE FAR*)lpvData, ulCount, szBuf); break; case 'l': case 'L': _FormatLongs((sBYTE FAR*)lpvData, ulCount, szBuf); break; case 's': case 'S': _FormatCStr((sBYTE FAR*)lpvData, szBuf); break; case 'p': case 'P': _FormatPStr((sBYTE FAR*)lpvData, szBuf); break; } _fstrcat( _szMessageBoxBuffer, _szCRLF ); _fstrcat( _szMessageBoxBuffer, _szCRLF ); } // Add the Reason to the buffer _fstrcat( _szMessageBoxBuffer, lpszReason ); iret = MessageBox(NULL, _szMessageBoxBuffer, ((lpszTest)? lpszTest : _szAssertFailed), MB_YESNOCANCEL | MB_TASKMODAL); switch (iret) { case IDYES: iUserSelection = ID_OK; break; case IDNO: iUserSelection = ID_TERMINATE; break; default: iUserSelection = ID_DEBUGGER; break; } } fInDoAssertDialog = FALSE; } return iUserSelection; }
int ColorSelDialog (HWND hWnd, int x, int y, int w, int h, PCOLORDATA pClrData) { SCOLORDIA scldata; CTRLDATA ColorCtrl [] = { { "static", WS_CHILD | WS_VISIBLE | SS_GRAYFRAME, 10, 10, 240, 240, IDC_SPACE, "", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_GRAYFRAME, 255, 10, 30, 240, IDC_YSPACE, "", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_GRAYFRAME, 10, 255, 35, 40, IDC_COLOR, "", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 35, 255, 20, 15, IDC_STATIC , "Y :", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 35, 275, 20, 15, IDC_STATIC , "U :", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 35, 295, 20, 15, IDC_STATIC , "V :", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 105, 255, 20, 15, IDC_STATIC , "R :", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 105, 275, 20, 15, IDC_STATIC , "G :", 0}, { "static", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 105, 295, 20, 15, IDC_STATIC , "B :", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 95, 255, 25, 15, IDC_VALUE_Y , "180", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 95, 275, 25, 15, IDC_VALUE_U , "128", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 95, 295, 25, 15, IDC_VALUE_V , "128", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 165, 255, 25, 15, IDC_VALUE_R , "64", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 165, 275, 25, 15, IDC_VALUE_G , "128", 0}, { "sledit", WS_CHILD | WS_VISIBLE, 165, 295, 25, 15, IDC_VALUE_B , "128", 0}, { "button", WS_CHILD | WS_VISIBLE, 200, 255, 80, 30, IDC_OK, NULL, 0, WS_EX_TRANSPARENT}, { "button", WS_CHILD | WS_VISIBLE , 200, 290, 80, 30, IDC_CANCEL, NULL, 0 ,WS_EX_TRANSPARENT} }; DLGTEMPLATE ColorDlg = { #ifdef _FLAT_WINDOW_STYLE WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX, WS_EX_NONE, #else WS_BORDER | WS_CAPTION, WS_EX_NONE, #endif 0, 0, 0, 0, NULL, 0, 0, TABLESIZE(ColorCtrl), NULL }; ColorDlg.x = x; ColorDlg.y = y; ColorDlg.w = w; ColorDlg.h = h; scldata.pclr = pClrData; InitColorCtrl (ColorCtrl, x, y, w, h, &scldata); ColorCtrl [15].caption = GetSysText(IDS_MGST_OK); ColorCtrl [16].caption = GetSysText(IDS_MGST_CANCEL); ColorDlg.caption = GetSysText(IDS_MGST_COLORSEL); ColorDlg.controls = ColorCtrl; return DialogBoxIndirectParam (&ColorDlg, hWnd, ColorDlgProc, (LPARAM)(&scldata)); }
static void Missedcallwindow(HWND hwnd) { Missed.controls = Missedcalls; DialogBoxIndirectParam(&Missed, hwnd, MissedWinProc, 0L); }
static bbUINT uiDlgCreateModal(uiDlg* const pThis, uiWINH hParent, const bbCHAR* pName, bbU32 style, bbU32 styleEx, uiRect const* pRect, int const modal) { bbUINT ret = -1; HGLOBAL hgbl = NULL; LPDLGTEMPLATE lpdt = NULL; LPWORD lpw; int nchar; uiDlgCreate create; bbASSERT(hParent); create.pThis = pThis; if (!pRect) ::GetClientRect(hParent, (RECT*)&create.rect); else create.rect = *pRect; #define uiDLGTEMPLATESIZE 1024 nchar = 1 + bbStrLen(pName); if (nchar > ((uiDLGTEMPLATESIZE - sizeof(DLGTEMPLATE) - 2*sizeof(WORD) / sizeof(bbCHAR) - 8*2))) // adjust this if code changed below { bbErrSet(bbENOMEM); goto uiDlg_CreateModal_err; } if ( ((hgbl = GlobalAlloc(GMEM_ZEROINIT, uiDLGTEMPLATESIZE)) == NULL) || ((lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl)) == NULL)) { bbErrSet(bbENOMEM); goto uiDlg_CreateModal_err; } lpdt->style = style | WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION | DS_SETFONT; lpdt->dwExtendedStyle = styleEx; lpdt->cdit = 0; // number of controls lpdt->x = (short)create.rect.left; lpdt->y = (short)create.rect.top; lpdt->cx = (short)(create.rect.right - create.rect.left); lpdt->cy = (short)(create.rect.bottom - create.rect.top); lpw = (LPWORD) (lpdt + 1); *lpw++ = 0; // no menu *lpw++ = 0; // predefined dialog box class (by default) bbMemMove(lpw, pName, nchar*sizeof(bbCHAR)); // title lpw += nchar; *lpw++ = 8; // font bbStrCpy((bbCHAR*)lpw, bbT("Tahoma")); if (lpdt) GlobalUnlock(hgbl); if (modal) { ret = DialogBoxIndirectParam(uighInstance, (LPDLGTEMPLATE) hgbl, hParent, (DLGPROC) uiDialogProc, (LPARAM)&create); } else { HWND hWin = CreateDialogIndirectParam(uighInstance, (LPDLGTEMPLATE) hgbl, hParent, (DLGPROC) uiDialogProc, (LPARAM)&create); if (!hWin) bbErrSet(uiEWINCREATE); else ret = 0; bbASSERT(pThis->mhWin==hWin); } uiDlg_CreateModal_err: if (hgbl) GlobalFree(hgbl); return ret; }
void create_proxy_window(HWND hParent) { PopWinData.controls = CtrlInitProgress; initCtrlsStyle(); DialogBoxIndirectParam(&PopWinData, hParent, ProxyBoxProc, (DWORD)hParent); }
int far pascal zDialogBoxIndirectParam( HANDLE pp1, HANDLE pp2, HWND pp3, FARPROC pp4, long pp5 ) { int r; FARPROC fp ; SaveRegs(); fp = pp4 ; if (fp) { pp4 = (FARPROC)HookAdd( (void far *)DlgMesgProc, (void far *)fp ); } /* ** Log IN Parameters (No Create/Destroy Checking Yet!) */ LogIn( (LPSTR)"APICALL:DialogBoxIndirectParam HANDLE+HANDLE+HWND+FARPROC+long+", pp1, pp2, pp3, pp4, pp5 ); /* ** Call the API! */ RestoreRegs(); GrovelDS(); r = DialogBoxIndirectParam(pp1,pp2,pp3,pp4,pp5); UnGrovelDS(); SaveRegs(); /* ** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!) */ LogOut( (LPSTR)"APIRET:DialogBoxIndirectParam int++++++", r, (short)0, (short)0, (short)0, (short)0, (short)0 ); RestoreRegs(); return( r ); }