本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}