|
Wim Engberts wrote: The child still covers the parent even if the parent is active and the child is not. There is no way that I get the parent to overlap the child when it is activated
While creating child dialog specify desktop window( Use GetDesktopWindow ) as the parent instead of the "parent dialog".
As you said this is the expected behavior.
|
|
|
|
|
Thanks a lot; this solved the problem.
William
|
|
|
|
|
Thanks a lot. This does indeed solve the problem.
William
|
|
|
|
|
FYI - you may want to note the following: http://blogs.msdn.com/oldnewthing/archive/2004/02/24/79212.aspx[^].
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
When advising people to use the desktop as a parent, it might be prudent to mention the dangers of doing so[^].
In general, you should not associate your child window with one that you do not own/control.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for this info james.
|
|
|
|
|
Hello,
If I have a menu with 4 menu options and I want to attach a popup menu to one of the menu options then is it possible ?
I have tried ModifyMenu() function with MF_POPUP parameter but it did not work.When I want to change the string with MF_STRING parameter for ModifyMenu() I am able to do it.
Thanks
Pritha
|
|
|
|
|
Hello,
Thanks
Please don't answer.
I used the ModifyMenu() option properly
Prithaa
|
|
|
|
|
Hello all,
I want the source code of a webpage through coding, and i don't know where to start from.Can anybody give me some idea or a piece of code to do it.
Thanks in advance
|
|
|
|
|
Hi,
Where does the webpage resides,
1) file : webpages are ascii files you can simply read it.
2) displayed: web page is displayed by your application use MSHTML API to retrieve the source.
please explain the scenario
|
|
|
|
|
|
How to make (programmatically) our VC++ application to stay always on top?
|
|
|
|
|
if (bAlwaysOnTop)
SetWindowPos(&wndTopMost, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
else
SetWindowPos(&wndNoTopMost, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
|
Thank you very much Hans Dietrich.
|
|
|
|
|
how to register an activX component using DOS commands????
NT
|
|
|
|
|
'register' inevitably means writing to the Windows Registry database. Hacking USER.DAT and the like from DOS is pretty much suicidal in term of Windows ever booting up again, so ultimately if you want register an ActiveX the registration process will need to run under Windows. There's nothing to stop you running regsvr32 from a command prompt or by use of ShellExecute(). It can be run with a quiet switch, /q I think, if you don't want any message boxes popping up.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi, I'm developing an MFC Application, and I need to use the Main Ribbon Button (On the Top-Left Corner) without the Ribbon Control, because my app is poor of function. I'll attach on the bottom of the Main Ribbon Control a simple Toolbar.
- Is it possible to use the main Ribbon button without the all the Ribbon?
- Another possibility is to use the Ribbon with a fix Catalog of control. Is it possible?
Thanks a lot
|
|
|
|
|
I need to hook the user32.dll function for my process only.
My application is running multiple worker threads which are hosting
3rd party STA component which is calling hooked function where I need to override
it's default implementation.
I've tried to do this:
- created my function using exactly same parameters and definition as original function
- save originl function's address
- created critical section cs
- saved first 5 bytes of original code and replaced by jmp _my_function (5 bytes code)
my finction:
LONG retVal;
EnterCriticalSection(&cs);
retVal = CallOriginal();
LeaveCriticalSection(&cs);
return retVal;
The problem is that when I'm running more than one workng threads,
it will crash after some random time.
Do you have idea what could be wrong? Is there some problem with this design?
Thank you!
PS. EnterCriticalSection() seems to be working, because when I remove LeaveCriticalSection(), there is a deadlock.
rrrado
|
|
|
|
|
I need to run an external application for a specified time (i.e. 5 minutes).
I start that exe using ShellExecute.
How I can post the message 'close' to that app while it is running.
Thank you
Russell
|
|
|
|
|
|
If you use the ShellExecuteEx() function, you will get the HANDLE of the process. So atleast you will be able to call TerminateProcess() function.
|
|
|
|
|
It works
This is my code (if someone needs it):
SHELLEXECUTEINFO ShellExecuteInfo;
ShellExecuteInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShellExecuteInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShellExecuteInfo.hwnd = NULL;
ShellExecuteInfo.lpVerb = NULL;
ShellExecuteInfo.lpFile = "notepad.exe";
ShellExecuteInfo.lpParameters = "";
ShellExecuteInfo.lpDirectory = NULL;
ShellExecuteInfo.nShow = SW_SHOW;
ShellExecuteInfo.hInstApp = NULL;
ShellExecuteEx(&ShellExecuteInfo);
Sleep(10000);
TerminateProcess(ShellExecuteInfo.hProcess, NULL);
Thanks
Russell
|
|
|
|
|
_Russell_ wrote: It works
Does it?....
Here's a quote from MSDN on TerminateProcess :
The TerminateProcess function is used to unconditionally cause a process to exit. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.
ExitProcess is of no use to you however as it exits the calling process! Calling TerminateProcess like you are is, in general, dangerous and unpredictable. For example, the process could be half way through updating a file and terminating it will result in data corruption. Another example, as eluded to by MSDN, is if the DLL uses shared memory: in this case the corruption will spread to other processes using the same DLL. TerminateProcess in only meant as a last resort: you can’t make reliable software that uses it as the primary mechanism to get a process to exit.
Steve
|
|
|
|
|
Here's a quote from MSDN on TerminateProcess :
The TerminateProcess function is used to unconditionally cause a process to exit. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.
ExitProcess is of no use however as it exits the calling process! Calling TerminateProcess like you suggest is, in general, dangerous and unpredictable. For example, the process could be half way through updating a file and terminating it will result in data corruption. Another example, as eluded to by MSDN, is if the DLL uses shared memory: in this case the corruption will spread to other processes using the same DLL. TerminateProcess in only meant as a last resort: you can’t make reliable software that uses it as the primary mechanism to get a process to exit.
Steve
|
|
|
|
|
Ya I know the risk. But didnt find any other way.
|
|
|
|