|
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.
|
|
|
|
|
Naveen.R wrote: Ya I know the risk. But didnt find any other way.
But does (did) the OP?
Steve
|
|
|
|
|
|
The Original Poster.
Steve
|
|
|
|
|
Stephen Hewitt wrote: The Original Poster.
If Toxct found this OP he will definity advice you . I have found him going on advicing and shouting not to use short cuts.( even 'u' for 'you' )
I dont know what the OP decided. But I think it worked for him. May be he have to redesign the application.
|
|
|
|
|
Naveen.R wrote: But I think it worked for him.
That's one of the things which makes advising someone to use TerminateProcess so dangerous: it will seem to work initially but could introduce hard to diagnose and reproduce bugs.
Steve
|
|
|
|
|
Thank you for the information.;)
Now I think that I need to find another way to solve the problem....
I think that the better way is to use SendMessage() to send WM_CLOSE to that window.... But I'm not so expert on handles and SDK basic functions. So I'm still searching a way to get the HWND of the other process window, starting from the info getted from ShellExecute[EX]() or CreateProcess().
Can you help me?
Russell
|
|
|
|