本文整理汇总了C++中IsDialogMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ IsDialogMessage函数的具体用法?C++ IsDialogMessage怎么用?C++ IsDialogMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsDialogMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VTranslateDialogMessage
/** Global Function to translate dialog messages.*/
VBOOL VTranslateDialogMessage(MSG const& msg)
{
HWND hWndTop = msg.hwnd;
/* Obtain the top level window. All dialogs are typically defined
as top level popups.*/
while ( hWndTop )
{
if ( GetWindowLong(hWndTop, GWL_STYLE) & WS_CHILD )
hWndTop = GetParent(hWndTop);
else
break;
}
/* Obtain the associated window pointer (if a VWCL window).*/
VWindow* pWindow = VWindow::GetVWindowFromHandle(hWndTop);
if ( !pWindow )
return VFALSE;
VBOOL bResult = VFALSE;
/* Is it a dialog box?*/
if ( pWindow->IsVDialogType() )
{
bResult = IsDialogMessage(hWndTop, (MSG*)&msg);
/* Is it a modeless property sheet?*/
if ( !bResult &&
pWindow->GetRTTI() == VWindow::VWCL_RTTI_PROPERTY_SHEET &&
!((VDialog*)pWindow)->IsModal() )
bResult = PropSheet_IsDialogMessage(hWndTop, &msg);
}
/* Return result.*/
return bResult;
}
示例2: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// создание главного окна
HWND hwnd;
MSG msg;
WNDCLASS w;
memset(&w, 0, sizeof(WNDCLASS));
w.style = CS_HREDRAW | CS_VREDRAW;
w.lpfnWndProc = WndProc;
w.hInstance = hInstance;
w.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
w.lpszClassName = L"Основное окно";
//регистрируем класс окна
RegisterClass(&w);
hwnd = CreateWindow(w.lpszClassName, w.lpszClassName, WS_OVERLAPPEDWINDOW, 10, 10, 290, 100, NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
// добавление кнопки на главное окно
CreateWindow(L"Button", L"Создать модальный диалог!", WS_CHILD | WS_VISIBLE, 10, 10, 250, 30, hwnd, (HMENU)ID_BUTTON, hInstance, NULL);
//запускаем цикл обработки сообщений
while (GetMessage(&msg, NULL, 0, 0))
{
if (hDlgModal == 0 || !IsDialogMessage(hDlgModal, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
示例3: WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdParam, int nCmdShow)
{
MSG msg;
bstr *str;
product = GetProduct();
str = bstr_new();
bstr_assign(str, "Are you sure you want to uninstall ");
bstr_append(str, product);
bstr_append(str, " ?");
if (MessageBox(NULL, str->text, "Uninstall", MB_YESNO) == IDNO)
return (1);
bstr_free(str, TRUE);
hInst = hInstance;
if (!hPrevInstance)
RegisterSepClass(hInstance);
mainDlg = CreateDialog(hInstance, MAKEINTRESOURCE(1), NULL, MainDlgProc);
SetGuiFont(mainDlg);
EnableWindow(GetDlgItem(mainDlg, BT_DELOK), FALSE);
ShowWindow(mainDlg, SW_SHOW);
ShowWindow(GetDlgItem(mainDlg, ST_DELDONE), SW_HIDE);
while (GetMessage(&msg, NULL, 0, 0)) {
if (!IsDialogMessage(mainDlg, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return 0;
}
示例4: while
bool GWMain::processMessage()
{
while (PeekMessage(¤tMsg, NULL, 0, 0, PM_REMOVE)) {
// Check for exit.
if (currentMsg.message == WM_QUIT) {
exitCode = currentMsg.wParam;
return false;
}
// Dialog boxes need to have their messages
// translated differently.
GWWindow* win = GWMap::getWindow(currentMsg.hwnd);
if (win && dynamic_cast<GWDialog*>(win))
if (IsDialogMessage(currentMsg.hwnd,¤tMsg))
return true;
if (hAccel && TranslateAccelerator(currentMsg.hwnd,hAccel,¤tMsg))
return true;
// Normal translate/dispatch
TranslateMessage(¤tMsg);
DispatchMessage(¤tMsg);
}
return true;
}
示例5: _tWinMain
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow)
{
HWND hDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_DLG_MAIN), NULL , DlgProc, reinterpret_cast<LPARAM>(hInstance));
ShowWindow(hDlg, SW_SHOW);
// Main message loop:
BOOL ret;
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
if(!IsDialogMessage(hDlg, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例6: GetMsgProc
static LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
{
LPMSG lpMsg = (LPMSG) lParam;
if ( (nCode >= 0) && (wParam == PM_REMOVE) )
{
// Don't translate non-input events.
if ( (lpMsg->message >= WM_KEYFIRST) && (lpMsg->message <= WM_KEYLAST) )
{
if ( IsDialogMessage(s_hDlg, lpMsg) )
{
// The value returned from this hookproc is ignored,
// and it cannot be used to tell Windows the message has been handled.
// To avoid further processing, convert the message to WM_NULL
// before returning.
lpMsg->message = WM_NULL;
lpMsg->lParam = 0;
lpMsg->wParam = 0;
}
}
}
return CallNextHookEx(s_hMsgHook, nCode, wParam, lParam);
}
示例7: CallNextHookEx
/*
================
rvGETransformer::GetMsgProc
Ensures normal dialog functions work in the transformer dialog
================
*/
LRESULT FAR PASCAL rvGETransformer::GetMsgProc ( int nCode, WPARAM wParam, LPARAM lParam )
{
LPMSG lpMsg = (LPMSG) lParam;
if ( nCode >= 0 && PM_REMOVE == wParam )
{
// Don't translate non-input events.
if ( lpMsg->message != WM_SYSCHAR && (lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) )
{
if ( IsDialogMessage( gTransDlg, lpMsg) )
{
// The value returned from this hookproc is ignored,
// and it cannot be used to tell Windows the message has been handled.
// To avoid further processing, convert the message to WM_NULL
// before returning.
lpMsg->message = WM_NULL;
lpMsg->lParam = 0;
lpMsg->wParam = 0;
}
}
}
return CallNextHookEx(gTransHook, nCode, wParam, lParam);
}
示例8: IsDialogMessage
BOOL CSelectUserDlg::PreTranslateMessage(MSG* pMsg)
{
return IsDialogMessage(pMsg);
}
示例9: ShowUpdateDialogThreadStart
static NTSTATUS ShowUpdateDialogThreadStart(
__in PVOID Parameter
)
{
BOOL result;
MSG message;
PH_AUTO_POOL autoPool;
PhInitializeAutoPool(&autoPool);
UpdateDialogHandle = CreateDialog(
(HINSTANCE)PluginInstance->DllBase,
MAKEINTRESOURCE(IDD_UPDATE),
PhMainWndHandle,
UpdaterWndProc
);
PhSetEvent(&InitializedEvent);
while (result = GetMessage(&message, NULL, 0, 0))
{
if (result == -1)
break;
if (!IsDialogMessage(UpdateDialogHandle, &message))
{
TranslateMessage(&message);
DispatchMessage(&message);
}
PhDrainAutoPool(&autoPool);
}
PhDeleteAutoPool(&autoPool);
PhResetEvent(&InitializedEvent);
// Ensure global objects are disposed and reset when window closes.
if (SetupFilePath)
{
PhDereferenceObject(SetupFilePath);
SetupFilePath = NULL;
}
if (UpdateCheckThreadHandle)
{
NtClose(UpdateCheckThreadHandle);
UpdateCheckThreadHandle = NULL;
}
if (DownloadThreadHandle)
{
NtClose(DownloadThreadHandle);
DownloadThreadHandle = NULL;
}
if (UpdaterDialogThreadHandle)
{
NtClose(UpdaterDialogThreadHandle);
UpdaterDialogThreadHandle = NULL;
}
if (FontHandle)
{
DeleteObject(FontHandle);
FontHandle = NULL;
}
FreeXmlData();
if (UpdateDialogHandle)
{
DestroyWindow(UpdateDialogHandle);
UpdateDialogHandle = NULL;
}
return STATUS_SUCCESS;
}
示例10: PreTranslateMessage
BOOL PreTranslateMessage(MSG* pMsg)
{
return IsDialogMessage(pMsg);
}
示例11: IsDialogMessage
BOOL CRepositoryFilterView::PreTranslateMessage(MSG* pMsg)
{
BOOL retVal = IsDialogMessage(pMsg);
return retVal;
}
示例12: WinMain
//.........这里部分代码省略.........
memcpy(clock64, api.root, api.root_len+1);
add_title(clock64,"Clock" ARCH_SUFFIX_64 ".exe");
api.Exec(clock64,lpCmdLine,NULL);
}
return 0;
}
#endif // _WIN64
// Do Not Allow the Program to Execute Twice!
updated = 25; /**< wait up to 5 sec in 1/5th seconds for other instance */
do{
HANDLE processlock=CreateMutex(NULL,FALSE,g_szClassName); // we leak handle here, but Windows closes on process exit anyway (so why do it manually?)
if(processlock && GetLastError()==ERROR_ALREADY_EXISTS){
CloseHandle(processlock);
hwndMain = FindWindow(g_szClassName, NULL);
if(hwndMain) { // This One Sends Commands to the Instance
ProcessCommandLine(hwndMain,lpCmdLine); // That is Currently Running.
return 0;
}
Sleep(200);
continue;
}
break;
}while(updated--);
// Update settings if required and setup defaults
if((updated=CheckSettings())<0){
return 1;
}
CancelAllTimersOnStartUp();
// Message of the taskbar recreating - Special thanks to Mr.Inuya
g_WM_TaskbarCreated = RegisterWindowMessage("TaskbarCreated");
// register a window class
wndclass.style = 0;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = g_instance;
wndclass.hIcon = g_hIconTClock;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(intptr_t)(COLOR_WINDOW+1);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = g_szClassName;
g_atomTClock = RegisterClass(&wndclass);
if(api.OS >= TOS_VISTA) { // allow non elevated processes to send control messages (eg, App with admin rights, explorer without)
#define MSGFLT_ADD 1
#define MSGFLT_REMOVE 2
typedef BOOL (WINAPI* ChangeWindowMessageFilter_t)(UINT message,DWORD dwFlag);
ChangeWindowMessageFilter_t ChangeWindowMessageFilter=(ChangeWindowMessageFilter_t)GetProcAddress(GetModuleHandle("user32"), "ChangeWindowMessageFilter");
if(ChangeWindowMessageFilter){
int msgid;
ChangeWindowMessageFilter(g_WM_TaskbarCreated,MSGFLT_ADD);
ChangeWindowMessageFilter(WM_COMMAND,MSGFLT_ADD);
for(msgid=WM_MOUSEFIRST; msgid<=WM_MOUSELAST; ++msgid)
ChangeWindowMessageFilter(msgid,MSGFLT_ADD);
for(msgid=MAINMFIRST; msgid<=MAINMLAST; ++msgid)
ChangeWindowMessageFilter(msgid,MSGFLT_ADD);
}
}
// create a hidden window
g_hwndTClockMain = hwndMain = CreateWindowEx(WS_EX_NOACTIVATE, MAKEINTATOM(g_atomTClock),NULL, 0, 0,0,0,0, NULL,NULL,g_instance,NULL);
// This Checks for First Instance Startup Options
ProcessCommandLine(hwndMain,lpCmdLine);
GetHotKeyInfo(hwndMain);
if(api.OS > TOS_2000) {
if(api.GetInt("Desktop", "MonOffOnLock", 0))
RegisterSession(hwndMain);
}
if(updated==1){
PostMessage(hwndMain,WM_COMMAND,IDM_SHOWPROP,0);
}
while(GetMessage(&msg, NULL, 0, 0)) {
if(!(g_hwndSheet && IsWindow(g_hwndSheet) && PropSheet_IsDialogMessage(g_hwndSheet,&msg))
&& !(g_hDlgTimer && IsWindow(g_hDlgTimer) && IsDialogMessage(g_hDlgTimer,&msg))
&& !(g_hDlgTimerWatch && IsWindow(g_hDlgTimerWatch) && IsDialogMessage(g_hDlgTimerWatch,&msg))
&& !(g_hDlgStopWatch && IsWindow(g_hDlgStopWatch) && IsDialogStopWatchMessage(g_hDlgStopWatch,&msg))){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
UnregisterHotKey(hwndMain, HOT_TIMER);
UnregisterHotKey(hwndMain, HOT_WATCH);
UnregisterHotKey(hwndMain, HOT_STOPW);
UnregisterHotKey(hwndMain, HOT_PROPR);
UnregisterHotKey(hwndMain, HOT_CALEN);
UnregisterHotKey(hwndMain, HOT_TSYNC);
UnregisterSession(hwndMain);
EndNewAPI(NULL);
return (int)msg.wParam;
}
示例13: LoadAccelerators
WPARAM CFidgetApp::Run(void)
{
HACCEL hAccelTable = LoadAccelerators(m_hInstance, (LPCTSTR)IDC_FIDGET);
// Main message loop:
//
WPARAM iReturn = 0;
bool bFinished = false;
while (!bFinished)
{
CLinearTimeAbsolute ltaCurrent;
ltaCurrent.GetUTC();
// Execute background tasks at specifically scheduled times.
//
scheduler.RunTasks(ltaCurrent);
CLinearTimeAbsolute ltaWakeUp;
if (!scheduler.WhenNext(<aWakeUp))
{
ltaWakeUp = ltaCurrent + time_30m;
}
else if (ltaWakeUp < ltaCurrent)
{
// This is necessary to deal with computer time jumping backwards
// which can happen when someone sets or resets the computer clock.
//
ltaWakeUp = ltaCurrent;
}
CLinearTimeDelta ltdTimeOut = ltaWakeUp - ltaCurrent;
DWORD dwTimeout = ltdTimeOut.ReturnMilliseconds();
DWORD nHandles = 0;
DWORD dwObject = MsgWaitForMultipleObjectsEx(nHandles, NULL, dwTimeout, QS_ALLINPUT, 0);
if (WAIT_OBJECT_0 + nHandles == dwObject)
{
for (; !bFinished;)
{
// There is at least one new message waiting to be processed.
//
MSG msg;
BOOL bGM = GetMessage(&msg, NULL, 0, 0);
if (0 == bGM)
{
// WM_QUIT message was received. It is time to terminate
// ourselves.
//
iReturn = msg.wParam;
bFinished = true;
}
else if (-1 == bGM)
{
// An unexpected problem occured.
//
bFinished = true;
}
else
{
// Translate and dispatch message to Windows Procedure.
//
if ( ( NULL == m_hwndNewSession
|| !IsDialogMessage(m_hwndNewSession, &msg))
&& ( NULL == m_hwndAbout
|| !IsDialogMessage(m_hwndAbout, &msg))
&& !TranslateMDISysAccel(g_theApp.m_pMainFrame->m_pMDIControl->m_hwnd, &msg)
&& !TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// We must process all messages in the queue before making
// another MsgWaitForMultipleObjectsEx() call.
//
if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE|PM_NOYIELD))
{
break;
}
}
}
else if (WAIT_TIMEOUT != dwObject)
{
// An unexpected event occured.
//
bFinished = true;
}
// It's time to perform some background task.
//
}
DestroyAcceleratorTable(hAccelTable);
return iReturn;
}
示例14: PhMainMessageLoop
LONG PhMainMessageLoop(
VOID
)
{
BOOL result;
MSG message;
HACCEL acceleratorTable;
acceleratorTable = LoadAccelerators(PhInstanceHandle, MAKEINTRESOURCE(IDR_MAINWND_ACCEL));
while (result = GetMessage(&message, NULL, 0, 0))
{
BOOLEAN processed = FALSE;
ULONG i;
if (result == -1)
return 1;
if (FilterList)
{
for (i = 0; i < FilterList->Count; i++)
{
PPH_MESSAGE_LOOP_FILTER_ENTRY entry = FilterList->Items[i];
if (entry->Filter(&message, entry->Context))
{
processed = TRUE;
break;
}
}
}
if (!processed)
{
if (
message.hwnd == PhMainWndHandle ||
IsChild(PhMainWndHandle, message.hwnd)
)
{
if (TranslateAccelerator(PhMainWndHandle, acceleratorTable, &message))
processed = TRUE;
}
if (DialogList)
{
for (i = 0; i < DialogList->Count; i++)
{
if (IsDialogMessage((HWND)DialogList->Items[i], &message))
{
processed = TRUE;
break;
}
}
}
}
if (!processed)
{
TranslateMessage(&message);
DispatchMessage(&message);
}
PhDrainAutoPool(&BaseAutoPool);
}
return (LONG)message.wParam;
}
示例15: startwin_idle
int32_t startwin_idle(void *v)
{
if (!startupdlg || !IsWindow(startupdlg)) return 0;
if (IsDialogMessage(startupdlg, (MSG*)v)) return 1;
return 0;
}