无双客栈

symbian linux e17 vim

8/8/2005 9:24:18 AM    Solved! (was: Re: Anyone from MS, especially GWES group (was: Re: Pinning dialog on top of other dialogs))
Michael J. Salamone wrote:  

Michael,

That was the tip that led to finding the solution. Thanks!

I'll list what I found below. Hopefully someone who has this same

problem will find my post before they find out the hard way. And if

I'm wrong about any of this someone please correctly me. (Gently ;-)

1. The window style needs to be set to Overlapped, _not_ Popup. If

it's set to popup, other popup siblings can cover it.

2. Using SetWindowLong() with WS_EX_TOPMOST plain doesn't work.

3. The parent must be the desktop (or something else other than the

app itself). Right now I'm doing it in the dialog's InitDialog:

CWnd *desktop = GetDesktopWindow();

SetParent(desktop);

this is because

4. MFC f/ CE apparently _ignores_ the parent parameter at creation,

instead surreptitiously setting the parent to the main app, a la

mpDlgSymbolBar->Create(IDD_SYMBOL_BAR, CWnd::GetDesktopWindow());

I believe I had the same problem with CreateEx(), although I didn't

investigate it enough to know for certain.

5. SetWindowPos() should be done at the dialog's Init, like

SetWindowPos(&wndTopMost, 0,0,0,0,

SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);

Later, if the dialog needs to be reshown (because it was hidden or

something) it can be brought back to the top with BringWindowToTop().

So it's finally working, and with four separate parts it's not an

easy solution. I'm sure some of my meanderings down dead ends were due

to my own ignorance of windowing/MFC issues, but a lot my problems can

be placed squarely on bad or missing documentation. Of the 5 points

above, help only correctly talks about #2 and #5. The other points are

either unmentioned or ignored. One key difference between HWND_TOPMOST

and &CWnd::wndTopMost is dead wrong.

I know that this newsgroup isn't official Microsoft support, but

this isn't the kind of issue I or my company like spending

$200/incident on. This was a problem that experts in three different

newsgroups (MVC/eVC/PB) and MS experts in the last embedded chat didn't

know the answer to. If the solution was that complicated I doubt

anyone from first-level telephone support could've helped me.

I didn't post this to whine; I'm glad I found the solution. But I

also hope that other developers don't have to go through the same

problems. Hopefully the above steps will go into the next set of docs,

or maybe the KB. I'll keep my fingers crossed, but I won't hold my

breath.


Trackback: http://tb.donews.net/TrackBack.aspx?PostId=1042449


[点击此处收藏本文]  发表于2006年09月20日 4:15 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论 
   

news

导航

blog stats

文章

收藏

相册

BBS

linux

存档


正在读取评论……