Google ๊ทธ๋ฃน์Šค๋Š” ๋” ์ด์ƒ ์ƒˆ๋กœ์šด ์œ ์ฆˆ๋„ท ๊ฒŒ์‹œ๋ฌผ ๋˜๋Š” ๊ตฌ๋…์„ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ณผ๊ฑฐ์˜ ์ฝ˜ํ…์ธ ๋Š” ๊ณ„์† ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ATL Dialog Accelerators

์กฐํšŒ์ˆ˜ 103ํšŒ
์ฝ์ง€ ์•Š์€ ์ฒซ ๋ฉ”์‹œ์ง€๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

Mathew

์ฝ์ง€ ์•Š์Œ,
2004. 3. 3. ์˜คํ›„ 10:34:1304. 3. 3.
๋ฐ›๋Š”์‚ฌ๋žŒ
Hi

Platform: Win32 / ATL 7.0

How should I get accelarators working in ATL dialogs? I know how to use
TranslateAccelerator for raw old fashioned WndProcs. What's the
easy/elegant way to setup dialog accelerators in ATL 7.0 / VS .NET 2003?

Regards
Mathew


์‹ ํ˜•์ฒ (Hyungchul Shin)[MVP]

์ฝ์ง€ ์•Š์Œ,
2004. 3. 4. ์˜คํ›„ 2:19:1804. 3. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ
Try calling IsDialogMessage() in the message loop.


-========================================-
HyungChul Shin
2004 Microsoft MVP - [ Visual C++ ]


"Mathew" <mat...@nospam.planet> wrote in message
news:upnpRmZA...@TK2MSFTNGP10.phx.gbl...

Igor Tandetnik

์ฝ์ง€ ์•Š์Œ,
2004. 3. 4. ์˜คํ›„ 4:34:3404. 3. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ
"Mathew" <mat...@nospam.planet> wrote in message
news:upnpRmZA...@TK2MSFTNGP10.phx.gbl...
> How should I get accelarators working in ATL dialogs? I know how to
use
> TranslateAccelerator for raw old fashioned WndProcs. What's the
> easy/elegant way to setup dialog accelerators in ATL 7.0 / VS .NET
2003?

If you mean a modal dialog, the only way I know of is with a hook - see
SetWindowsHookEx
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Mathew

์ฝ์ง€ ์•Š์Œ,
2004. 3. 4. ์˜คํ›„ 8:24:2404. 3. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ
Am I supposed to write my own message loop for ATL dialogs? I had imagined
there might be some appropriate pre-processing hook that I could use.

Regard
Mathew

"์‹ ํ˜•์ฒ (Hyungchul Shin)[MVP]" <kri...@unitel.co.kr> wrote in message
news:uUo6Z2hA...@TK2MSFTNGP09.phx.gbl...

Ed Dore [MSFT]

์ฝ์ง€ ์•Š์Œ,
2004. 3. 5. ์˜ค์ „ 12:25:1504. 3. 5.
๋ฐ›๋Š”์‚ฌ๋žŒ
Hi Mathew,

I'm guessing youre using modeless dialogs here. A modal dialog generally
already supports accelerators.

You'll need modify your ATL module's message loop to call IsDialogMessage()
on your dialog's HWND. A generic ATL7 EXE has it's message pump implemented
in the CAtlExeModuleT::RunMessageLoop in ATLBASE.H. The implemention is
below.

void RunMessageLoop() throw()
{
MSG msg;
while (GetMessage(&msg, 0, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

You'll want to reimplement this in your own module object that derived from
CAtlExeModuleT, and add a call to IsDialogMessage() when the msg.hwnd
belongs to your dialog, or is a child window belonging to your dialog. For
example:

void RunMessageLoop() throw()
{
MSG msg;
while (GetMessage(&msg, 0, 0, 0) > 0)
{
if (msg.hwnd==m_hWndDlg || IsChild(m_hWndDlg,msg.hwnd)
if (!::IsDialogMessage(m_hWndDlg,&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}

Sincerely,
Ed Dore [MSFT]

This post is "AS IS" with no warranties, and confers no rights.


Alexander Nickolov

์ฝ์ง€ ์•Š์Œ,
2004. 3. 5. ์˜คํ›„ 2:19:1804. 3. 5.
๋ฐ›๋Š”์‚ฌ๋žŒ
Well, this won't work for obvious reasons. Make it like this:

void CMyAtlExeModule::RunMessageLoop() throw()


{
MSG msg;
while (GetMessage(&msg, 0, 0, 0) > 0)
{

if ( !(::IsWindow(m_hWnd) &&
((msg.hwnd==m_hWndDlg) || ::IsChild(m_hWndDlg,msg.hwnd)) &&
(::IsDialogMessage(m_hWndDlg,&msg))) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}

m_hWndDlg should be a member of the derived class set when the
dialog is displayed and reset it when the dialog is destroyed. FWIW,
WTL has a much more elegant solution with its CMessageFilter
interface and CMessageLoop handling the filters like connection
point sinks...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"Ed Dore [MSFT]" <ed...@online.microsoft.com> wrote in message news:%aU1c.42878$ko6.381731@attbi_s02...

์ƒˆ ๋ฉ”์‹œ์ง€ 0๊ฐœ