當前位置: 首頁>>代碼示例>>C++>>正文


C++ CreateDialogParam函數代碼示例

本文整理匯總了C++中CreateDialogParam函數的典型用法代碼示例。如果您正苦於以下問題:C++ CreateDialogParam函數的具體用法?C++ CreateDialogParam怎麽用?C++ CreateDialogParam使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CreateDialogParam函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: RestoreUnreadMessageAlerts

static void RestoreUnreadMessageAlerts(void)
{
	OBJLIST<MSavedEvent> arEvents(10, NumericKeySortT);

	for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
		for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
			DBEVENTINFO dbei = { sizeof(dbei) };
			dbei.cbBlob = 0;
			db_event_get(hDbEvent, &dbei);
			if ((dbei.flags & (DBEF_SENT | DBEF_READ)) || !DbEventIsMessageOrCustom(&dbei))
				continue;

			int windowAlreadyExists = WindowList_Find(g_dat.hMessageWindowList, hContact) != NULL;
			if (windowAlreadyExists)
				continue;

			if (IsAutoPopup(hContact) && !windowAlreadyExists) {
				NewMessageWindowLParam newData = { 0 };
				newData.hContact = hContact;
				newData.flags = NMWLP_INCOMING;
				HWND hParent = GetParentWindow(newData.hContact, FALSE);
				CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData);
			}
			else arEvents.insert(new MSavedEvent(hContact, hDbEvent));
		}
	}

	TCHAR toolTip[256];

	CLISTEVENT cle = {};
	cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
	cle.pszService = "SRMsg/ReadMessage";
	cle.flags = CLEF_TCHAR;
	cle.ptszTooltip = toolTip;

	for (int i = 0; i < arEvents.getCount(); i++) {
		MSavedEvent &e = arEvents[i];
		mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
		cle.hContact = e.hContact;
		cle.hDbEvent = e.hEvent;
		pcli->pfnAddEvent(&cle);
	}
}
開發者ID:kxepal,項目名稱:miranda-ng,代碼行數:43,代碼來源:msgs.cpp

示例2: CreateDialogParam

void COptionsShortCutsPage::InputGetKeys(void)
{
	HWND hKeyDlg = CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Key_Prompt), m_hWnd, (DLGPROC)KeyPromptDlgProc, (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY));
	::EnableWindow(GetParent(), false);
	MSG msg;

	for (bool fDone = false; !fDone; MsgWaitForMultipleObjects(0, NULL, false, 45, QS_ALLINPUT)) {
		while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
			if (msg.message == WM_QUIT) {
				fDone = true;
				::PostMessage(NULL, WM_QUIT, 0, 0);
				break;
			}
			if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) {
				int nVirtKey = (int)msg.wParam;
				if (nVirtKey == VK_SHIFT) { continue; }
				if (nVirtKey == VK_CONTROL) { continue; }
				if (nVirtKey == VK_MENU) { continue; }
				SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, (WPARAM)-1, 0);
				for (int count = 0; count < SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETCOUNT, 0, 0); count++) {
					int Data = (int)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, count, 0);
					if (Data != nVirtKey) { continue; }
					SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, count, 0);
					SendDlgItemMessage(IDC_CTL, BM_SETCHECK, (GetKeyState(VK_CONTROL) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0);
					SendDlgItemMessage(IDC_ALT, BM_SETCHECK, (GetKeyState(VK_MENU) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0);
					SendDlgItemMessage(IDC_SHIFT, BM_SETCHECK, (GetKeyState(VK_SHIFT) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0);
					SendMessage(WM_COMMAND, MAKELPARAM(IDC_VIRTUALKEY, LBN_SELCHANGE), (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY));
					SetForegroundWindow(GetParent());
					::DestroyWindow(hKeyDlg);
				}
				continue;
			}
			if (!::IsDialogMessage(hKeyDlg, &msg)) {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}

		if (!::IsWindow(hKeyDlg)) { fDone = true; }
	}
	::SetFocus(GetParent());
	::EnableWindow(GetParent(), true);
}
開發者ID:MoochMcGee,項目名稱:project64-x,代碼行數:43,代碼來源:Settings+Page+-+Keyboard+Shortcuts.cpp

示例3: ShowMissed

int ShowMissed(void)
{
	if (!mcs.count)
		return 0;

	TCHAR sztemp[1024], szcount[7];
	for (int loop=0; loop < mcs.count; loop++) {
		_tcsncat(sztemp, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, mcs.wpcontact[loop], GCDNF_TCHAR), SIZEOF(sztemp));
		if ( db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
			mir_sntprintf(szcount, SIZEOF(szcount), _T(" [%i]"), mcs.times[loop]);
			_tcscat(sztemp, szcount);
		}

		_tcscat(sztemp, _T("\n"));
	}

	CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), NULL, MissedDlgProc, (LPARAM)sztemp);
	return 0;
}
開發者ID:0xmono,項目名稱:miranda-ng,代碼行數:19,代碼來源:missed.cpp

示例4: ShowRoom

void ShowRoom(SESSION_INFO * si, WPARAM wp, BOOL bSetForeground)
{
	HWND hParent = NULL;
	if (!si)
		return;

	//Do we need to create a window?
	if (si->hWnd == NULL)
	{
	    hParent = GetParentWindow(NULL, TRUE);
	    si->hWnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), hParent, RoomWndProc, (LPARAM)si);
	}
	SendMessage(si->hWnd, DM_UPDATETABCONTROL, -1, (LPARAM)si);
	SendMessage(GetParent(si->hWnd), CM_ACTIVATECHILD, 0, (LPARAM) si->hWnd);
	if ( hParent != NULL )
		ShowWindow(hParent, SW_NORMAL);
	SendMessage(si->hWnd, WM_MOUSEACTIVATE, 0, 0);
	SetFocus(GetDlgItem(si->hWnd, IDC_CHAT_MESSAGE));
}
開發者ID:BackupTheBerlios,項目名稱:mgoodies-svn,代碼行數:19,代碼來源:services.c

示例5: MyGetDialogSize

BOOL WINAPI MyGetDialogSize(int iResourceID, DLGPROC pDlgProc, LPARAM lParam, SIZE* pResult)
{
    HWND hwnd = CreateDialogParam(AfxGetResourceHandle(),
                                  MAKEINTRESOURCE(iResourceID),
                                  GetDesktopWindow(),
                                  pDlgProc,
                                  lParam);

    if(hwnd == NULL) return FALSE;

    RECT rc;
    GetWindowRect(hwnd, &rc);
    pResult->cx = rc.right - rc.left;
    pResult->cy = rc.bottom - rc.top;

    DestroyWindow(hwnd);

    return TRUE;
}
開發者ID:Tsuki,項目名稱:VapourSynth-VSFilterMod,代碼行數:19,代碼來源:DirectVobSubPropPage.cpp

示例6: WinMain

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hprevInstance,
	LPSTR lspszCmdParam, int nCmdShow)
{
	MSG Msg;
	hInstance = hInst;

	hwndMain = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_MENU), 0, WndProc, 0);
	ShowWindow(hwndMain, nCmdShow);
	initHwnd(hwndMain);

	
	while (GetMessage(&Msg, NULL, 0, 0))
	{
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}

	return Msg.wParam;
}
開發者ID:imoongom,項目名稱:FileTransfer,代碼行數:19,代碼來源:winmain.cpp

示例7: RestoreUnreadMessageAlerts

static void RestoreUnreadMessageAlerts(void)
{
	TCHAR toolTip[256];

	CLISTEVENT cle = { sizeof(cle) };
	cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
	cle.pszService = "SRMsg/ReadMessage";
	cle.flags = CLEF_TCHAR;
	cle.ptszTooltip = toolTip;

	DBEVENTINFO dbei = { sizeof(dbei) };

	for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
		for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
			bool autoPopup = false;
			dbei.cbBlob = 0;
			db_event_get(hDbEvent, &dbei);
			if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
				int windowAlreadyExists = WindowList_Find(g_dat.hMessageWindowList, hContact) != NULL;
				if (windowAlreadyExists)
					continue;

				char *szProto = GetContactProto(hContact);
				if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
					autoPopup = true;

				if (autoPopup && !windowAlreadyExists) {
					NewMessageWindowLParam newData = { 0 };
					newData.hContact = hContact;
					newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS);
					CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM)& newData);
				}
				else {
					cle.hContact = hContact;
					cle.hDbEvent = hDbEvent;
					mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
					CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
				}
			}
		}
	}
}
開發者ID:truefriend-cz,項目名稱:miranda-ng,代碼行數:42,代碼來源:msgs.cpp

示例8: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
	PSTR szCmdLine, int iCmdShow)
{
	// We're using a dialog as the main window for convenience in creating the UI
	HWND hDlg;
	hDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, ControlDlgProc, 0);
	ShowWindow(hDlg, iCmdShow);

	// Register the window class for windows which will contain images
	WNDCLASSEX imageWndClass;
	imageWndClass.style       = CS_HREDRAW | CS_VREDRAW;
	imageWndClass.lpfnWndProc = ImageWndProc;
	imageWndClass.cbClsExtra  = 0;
	imageWndClass.cbWndExtra = sizeof(OFFSCREENBUFFER);
	imageWndClass.cbSize = sizeof(WNDCLASSEX);
	imageWndClass.hInstance = hInstance;
	imageWndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	imageWndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
	imageWndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
	imageWndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	imageWndClass.lpszMenuName = NULL;
	imageWndClass.lpszClassName = szImgWindowClassName;

	if (!RegisterClassEx(&imageWndClass)) {
		DWORD dwError = GetLastError();
		MessageBox(NULL, TEXT("This program requires Windows NT!"), szImgWindowClassName, MB_ICONERROR);
		return 0;
	}

	BOOL ret;
	MSG msg;
	while ((ret = GetMessage(&msg, 0, 0, 0)) != 0) {
		if (ret == -1) /* error found */
			return -1;

		if (!IsDialogMessage(hDlg, &msg)) {
			TranslateMessage(&msg); /* translate virtual-key messages */
			DispatchMessage(&msg); /* send it to dialog procedure */
		}
	}
	return msg.wParam;
}
開發者ID:Shane-S,項目名稱:COMP8551-Assign4,代碼行數:42,代碼來源:Main.cpp

示例9: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow)
{
	MSG			msg;
	WNDCLASS	wc;

	// Store the instance handle
	g_hInst=hInstance;

	LoadString(g_hInst,IDS_APPTITLE,g_szAppTitle,sizeof(g_szAppTitle)/sizeof(g_szAppTitle[0]));

	// Dialog custom window class
	ZeroMemory(&wc,sizeof(wc));
	wc.style=CS_HREDRAW | CS_VREDRAW;
	wc.cbWndExtra=DLGWINDOWEXTRA;
	wc.hInstance=hInstance;
	wc.hCursor=LoadCursor(NULL,IDC_ARROW);
	wc.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_SKELETALVIEWER));
	wc.lpfnWndProc=DefDlgProc;
	wc.lpszClassName=SZ_APPDLG_WINDOW_CLASS;
	if(!RegisterClass(&wc))
		return (0);

	// Create main application window
	g_hWndApp=CreateDialogParam(g_hInst,MAKEINTRESOURCE(IDD_APP),NULL,(DLGPROC) CSkeletalViewerApp::WndProc,NULL);

	// Show window
	ShowWindow(g_hWndApp,nCmdShow);
	//UpdateWindow(g_hWndApp);

	// Main message loop:
	while(GetMessage(&msg,NULL,0,0)) 
	{
		// If a dialog message
		if(g_hWndApp!=NULL && IsDialogMessage(g_hWndApp,&msg))
			continue;

		// otherwise do default window processing
		TranslateMessage(&msg);
		DispatchMessage(&msg);
    }
	return (msg.wParam);
}
開發者ID:hcwiley,項目名稱:building-bridges-out-of-buildings,代碼行數:42,代碼來源:SkeletalViewer.cpp

示例10: PhNetworkOutputDialogThreadStart

static NTSTATUS PhNetworkOutputDialogThreadStart(
    _In_ PVOID Parameter
    )
{
    BOOL result;
    MSG message;
    HWND windowHandle;
    PH_AUTO_POOL autoPool;
    PNETWORK_OUTPUT_CONTEXT context = (PNETWORK_OUTPUT_CONTEXT)Parameter;

    PhInitializeAutoPool(&autoPool);

    windowHandle = CreateDialogParam(
        (HINSTANCE)PluginInstance->DllBase,
        MAKEINTRESOURCE(IDD_OUTPUT),
        PhMainWndHandle,
        NetworkOutputDlgProc,
        (LPARAM)Parameter
        );

    ShowWindow(windowHandle, SW_SHOW);
    SetForegroundWindow(windowHandle);

    while (result = GetMessage(&message, NULL, 0, 0))
    {
        if (result == -1)
            break;

        if (!IsDialogMessage(context->WindowHandle, &message))
        {
            TranslateMessage(&message);
            DispatchMessage(&message);
        }

        PhDrainAutoPool(&autoPool);
    }

    PhDeleteAutoPool(&autoPool);
    DestroyWindow(windowHandle);

    return STATUS_SUCCESS;
}
開發者ID:andyvand,項目名稱:ProcessHacker,代碼行數:42,代碼來源:output.c

示例11: CreateDialogParam

void UnwrapMod::fnRegularMapStart(INode* node, BOOL bringUpUI)
{

	if (bringUpUI)
	{
		HWND hwnd = CreateDialogParam(	hInstance,
							MAKEINTRESOURCE(IDD_UNFOLDMAP_DIALOG),
							GetCOREInterface()->GetMAXHWnd(),
							UnwrapUnfoldMapFloaterDlgProc,
							(LPARAM)this );
		mRegularMap.SetPos();
		mRegularMap.FillOutUI();

		ShowWindow(hwnd ,SW_SHOW);
		
	}
	MeshTopoData *md = GetMeshTopoData(node);
	mRegularMap.Init(this,md);

}
開發者ID:artemeliy,項目名稱:inf4715,代碼行數:20,代碼來源:ToolRegularMapScriptCommands.cpp

示例12: GetTickCount

ProgressDialog::ProgressDialog(HWND hwndParent, const char *szTitle, const char *szCaption, long _maxval, bool _fAbortEnabled) 
	:lpszTitle(szTitle)
	,lpszCaption(szCaption)
	,lpszValueFormat(NULL)
	,maxval(_maxval)
	,curval(0)
	,newval(0)
	,mSparseCount(1)
	,mSparseInterval(1)
	,fAbortEnabled(_fAbortEnabled)
	,fAbort(false)
	,hwndProgressBar(NULL)
	,hwndValue(NULL)
	,hwndDialog(NULL)
	,mhwndParent(hwndParent)
{
	dwLastTime = GetTickCount();

	CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_PROGRESS), hwndParent, ProgressDlgProc, (LPARAM)this);
}
開發者ID:KGE-INC,項目名稱:VirtualDub,代碼行數:20,代碼來源:ProgressDialog.cpp

示例13: ResetInfo

bool CTaskProgressWnd::CreateProgressWnd(bool bHidden)
{
	// Если окно уже создано, и не закрыто, то заново создавать ничего не надо
	if (m_hWindow)
	{
		// но сбросим надписи в начальное положение
		ResetInfo();
	}
	else
	{
		// Создаём новое окно
		CreateDialogParam(Instance, MAKEINTRESOURCE(IDD_TASK_PROGRESS), 
			MainWindow, StaticDlgProc, (LPARAM) this);
	}

	if (!bHidden)
		ShowWindow(m_hWindow, SW_SHOW);

	return true;
}
開發者ID:demalexx,項目名稱:small-backup,代碼行數:20,代碼來源:Tasks.cpp

示例14: AFX_MANAGE_STATE

STDMETHODIMP CDVSBasePPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	CheckPointer(pRect,E_POINTER);
/*
    // Return failure if SetObject has not been called.
    if (m_bObjectSet == FALSE) {
        return E_UNEXPECTED;
    }
*/
    if(m_hwnd) return E_UNEXPECTED;

    m_hwnd = CreateDialogParam(AfxGetResourceHandle(), MAKEINTRESOURCE(m_DialogId), hwndParent, DialogProc, (LPARAM)this);
    if(m_hwnd == NULL) return E_OUTOFMEMORY;

    OnActivate();
    Move(pRect);
    return Show(SW_SHOWNORMAL);
}
開發者ID:Cyberbeing,項目名稱:xy-VSFilter,代碼行數:20,代碼來源:DirectVobSubPropPage.cpp

示例15: Quotes_OnContactDoubleClick

int Quotes_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/)
{
	MCONTACT hContact = MCONTACT(wp);
	if (CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact))
	{
		MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, true);
		assert(hWL);
		HWND hWnd = WindowList_Find(hWL, hContact);
		if (NULL != hWnd) {
			SetForegroundWindow(hWnd);
			SetFocus(hWnd);
		}
		else if (true == IsMyContact(hContact))
			CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG_QUOTE_INFO_1), NULL, QuoteInfoDlgProc1, LPARAM(hContact));

		return 1;
	}

	return 0;
}
開發者ID:Seldom,項目名稱:miranda-ng,代碼行數:20,代碼來源:QuoteInfoDlg.cpp


注:本文中的CreateDialogParam函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。