Thanks very much. That's just what I needed to learn. Craig
casid
Posts
-
How MessageBox() kills active context menu -
How MessageBox() kills active context menuI've noticed within my MFC application that should a MessageBox() API be invoked while the user is displaying a context menu that the menu is taken down and the MessageBox is shown. However, if a DoModal() API is called to show one of my dialogs while a context menu is being shown the menu stays up but you can no longer select from it. Its kind of frozen. How can I go about causing the context menu to go away prior to calling the DoModal() API? Is there a way to search for a visible menu and then subsequently destroy them? Any ideas or code snipits? Craig
-
Coming out of StandBy application crashesMy MSVC 6.0 MFC application crashes for a few people when they come out of StandBy mode when its running. I've never been able to reproduce this myself but I'm wondering what areas to look at that could cause a crash at this time. Here's the Dr. Watson log from the thread that crashes below. It looks at though the code just didn't get loaded again. Any ideas or suggestions on how to debug something like this?
*----> State Dump for Thread Id 0xec4 <----* eax=00000001 ebx=00ca2d00 ecx=0000000a edx=7c90eb94 esi=0669daa0 edi=00000000 eip=0124b3c7 esp=0189ff60 ebp=0189ff80 iopl=0 nv up ei pl zr na po nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 function: No prior disassembly possible 0124b3c7 ?? ??? 0124b3c9 ?? ??? 0124b3cb ?? ??? 0124b3cd ?? ??? 0124b3cf ?? ??? 0124b3d1 ?? ??? 0124b3d3 ?? ??? 0124b3d5 ?? ??? 0124b3d7 ?? ??? FAULT ->0124b3c7 ?? ??? Error 0x00000001 0124b3c9 ?? ??? 0124b3cb ?? ??? 0124b3cd ?? ??? 0124b3cf ?? ??? 0124b3d1 ?? ??? 0124b3d3 ?? ??? 0124b3d5 ?? ??? 0124b3d7 ?? ??? 0124b3d9 ?? ??? 0124b3db ?? ??? *----> Stack Back Trace <----* WARNING: Stack unwind information not available. Following frames may be wrong. ChildEBP RetAddr Args to Child 0189ff5c 000d0670 00000218 0000000a 00000000 0x124b3c7 0189ff80 77c3a3b0 00bda558 00000000 7c9105c8 0xd0670 0189ffb4 7c80b50b 00ca2d00 00000000 7c9105c8 msvcrt!endthreadex+0xa9 0189ffec 00000000 77c3a341 00ca2d00 00000000 kernel32!GetModuleFileNameA+0x1b4 *----> Raw Stack Dump <----* 000000000189ff60 70 06 0d 00 18 02 00 00 - 0a 00 00 00 00 00 00 00 p............... 000000000189ff70 69 79 6d 0d 79 04 00 00 - 8b 01 00 00 58 a5 bd 00 iym.y.......X... 000000000189ff80 b4 ff 89 01 b0 a3 c3 77 - 58 a5 bd 00 00 00 00 00 .......wX....... 000000000189ff90 c8 05 91 7c 00 2d ca 00 - 05 00 00 c0 8c ff 89 01 ...|.-.......... 000000000189ffa0 84 fb 89 01 dc ff 89 01 - 94 5c c3 77 d8 40 c1 77 .........\.w.@.w 000000000189ffb0 00 00 00 00 ec ff 89 01 - 0b b5 80 7c 00 2d ca 00 ...........|.-.. 000000000189ffc0 0
-
How to determine the current IP addressI've got a VC++ program in which I need to determine the dotted-numeric IP address of the PC its running on. What's the best/simplest way to do this? Thanks for any ideas, Craig
-
Bringing desktop window to the top without taking focusSorry, I meant to code it: HWND hwnd = ::GetForegroundWindow(); ::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE); ::SetWindowPos(hwnd, myhwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
-
Bringing desktop window to the top without taking focusOff and on for some time I've tried to find the best way to bring a window (whose parent is the desktop) to the top of all the other application windows on some particular event. They could very well be using another application window at the time so I can't allow it to take the focus away as this could result in lost keystrokes. My current implementation of this is basically the following: HWND hwnd = ::GetForegroundWindow(); ::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE); ::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE); I've investigated numerous other ways over time. This works well but doesn't always work perfectly. Some times focus is stolen and sometimes the z-order isn't correct. These are rare cases and usually involve some specific other application that was in use at the time. I'm wondering if anyone could offer solutions they've tested and used in the past for performing something similar? Craig
-
Possible to kill MessageBox?Check out GetLastActivePopup :)
-
display tooltips on CToolBarCtrlSpecify the TTS_ALWAYSTIP flag when creating it.