|
Hello all,
In my project I am creating a SDI application without Document/View architecture in MFC(Visaul C++ 2008).
Now in it, I am creating a child window using "Create()" method with window style "WS_CHILD" and i am calling this "Create()" method from "OnCreate()" of CMainFrame class.For this newly created child window I have created a new class.Now on this new child window I have added some controls like edit boxes, buttons and these controls are also created by "Create()" method and with "WS_CHILD" style.
Now my actual problem is that when I run the application, child window gets created and I can see the controls added on the child window also but I can not access these controls means these controls are disabled. Can anyone tell how to enable these controls on child window.Please help me out.
Thanks and Regards,
Abhijit
|
|
|
|
|
Hi ,
I have created an allication, i am to build the application in Debug Mode but it am not possible to build in release mode.
I have tried in building in release mode , but am getting error as "unexpected end of file while looking for precompiled header directive".
Need Help
Thanks,
Balaji S
|
|
|
|
|
You need to set the same project properties in the release than the ones you used for debug mode (in that specific case, you have to disable precompiled headers. The different modes have their own set of properties, so each time you change something in the properties for debug mode, you have to change it for the release mode also (if this is needed, sometimes you want to have different settings).
|
|
|
|
|
Hi all
Our application has to kill OUTLOOK.exe if it runs only in background . Assuming we already have process id and handle to kill it with TerminateProcess , how to find if this outlook.exe has UI active or not ?? Any APIs please ...
redindian
|
|
|
|
|
Use EnumWindows to enumerate all open windows.
Use GetWindowThreadProcessID on the window handle to get the process Id of the window.
Compare with the process Id you already have.
Now you can use TerminateProcess (or a better way) to kill outlook.
«_Superman_»
|
|
|
|
|
I am already aware of how to enumerate the processes and kill it . What I want to know is : To find if a process is running in background or running with UI ....
redindian
|
|
|
|
|
|
dharani wrote: What I want to know is : To find if a process is running in background or running with UI ....
You may want to check out functions like IsWindowVisible() , IsWindowIconic() , SendMessageTimeout(hWnd, WM_NULL, ...) , and GetForegroundWindow() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
dharani wrote: runs only in background
Define what you mean by that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
My need is application will be removed after their work completed.how i do that
|
|
|
|
|
Create a batch file from within the EXE.
Run the batch file and exit the EXE.
In the batch file create a loop and try to delete the EXE.
Check ERRORLEVEL to confirm the deletion.
Delete the batch file itself.
«_Superman_»
|
|
|
|
|
Yes i need to delete the exe file itself after completion.how to create batch file.Can you please explain in brief
|
|
|
|
|
Batch file is just a text file with a .bat extension in which you can give dos command like del to delete a file.
Create the file through code (CreateFile ) and use CreateProcess to run it.
«_Superman_»
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
are you trying to close another exe or your exe itself?
You can close your application by Sending WM_CLOSE message to the main window
AfxGetMainWnd()->PostMessage(WM_CLOSE);
or by callnig using PostQuitMessage API
You can kill another process by calling
TermainteProcess[^] API with the process's handle. Remember it's an brutal and unsafe method.
--added--
If you're trying to delete file just call DeleteFile[^] API and pass the path of executable.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
modified on Wednesday, February 11, 2009 4:49 AM
|
|
|
|
|
I think he's trying to physically delete the executable file once it has exited, not trying to stop it while running.
|
|
|
|
|
hmm... I just updated my previous post. Anyway his question is not well clear
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
All possible methods are explained here[^]
|
|
|
|
|
Hello,
I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ?
Thanks.
|
|
|
|
|
Have a function in your Dialog class that has this :
<br />
CButton* pButton = new CButton;<br />
pButton->Create("NewButton", WS_CHILD | WS_VISIBLE,<br />
CRect(x, y, x1, y1), this, 1234);<br />
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
I think I mentioned that the dialog exists in another process.
|
|
|
|
|
You can either do CreateRemoteThread to create a thread in the other process and create the button from that thread.
Or you can write a hook DLL that loads into the remote process and then create the button from the hook procedure.
I don't think you can create a button using the handle of another window or dialog.
«_Superman_»
|
|
|
|
|
Yes, I was thinking that global hooks will be helpful. But can I get some sample code please.
http://www.google.com
|
|
|
|
|
Identity Undisclosed wrote: have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible
Can you tell why you need this?
Regards,
Sandip.
|
|
|
|
|
Just for learning purposes
|
|
|
|