Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera20-May-09 11:56
Sternocera20-May-09 11:56 
AnswerRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Stuart Dootson20-May-09 11:39
professionalStuart Dootson20-May-09 11:39 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera20-May-09 12:10
Sternocera20-May-09 12:10 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Stuart Dootson20-May-09 13:22
professionalStuart Dootson20-May-09 13:22 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera20-May-09 22:58
Sternocera20-May-09 22:58 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Stuart Dootson21-May-09 0:56
professionalStuart Dootson21-May-09 0:56 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera21-May-09 3:35
Sternocera21-May-09 3:35 
QuestionHow to manipulate with processes from your app? Any help is appreciated Pin
Oshtri Deka20-May-09 7:55
professionalOshtri Deka20-May-09 7:55 
The problem: big bad legacy application with code written from 1996 onward.

Application starts another process (utility app written on .Net), original idea was to start utility app in background during loading time and to close it when main application is closing.
Now someone wants ability to close it whenever one wants.
All that is rather simple to comprehend, but what worries me how to inform main application that utility app is closed?

Main app has utility's process handle and it made me to believe everything will be easy...

This is code for utility start:
void CFireAdder::StartService(void)
{
CString planBrowserPath;	 
#ifdef DEBUG
	planBrowserPath = CUtils::AddPathToWorkingPath("Debug\\FireAdder");
#else
planBrowserPath = CUtils::AddPathToWorkingPath("FireAdder");
#endif

planBrowserPath = CUtils::AddFilenameToPath(planBrowserPath,"FireAdder.exe");

	TRACE("starting planbrowser... ");
	_process=(HANDLE)_spawnl(_P_NOWAIT,planBrowserPath,"FireAdder",NULL);
	WaitForInputIdle(_process,INFINITE);
	TRACE("... started\n");
	
}


And this is little piece of code I've written for getting utility's window handle:
HWND CFireAdder::getWindowHandle()
{
	if(_process == (HANDLE) -1) return NULL;

	//if(_windowHandle != NULL) return _windowHandle;

	DWORD procID = GetProcessId(_process);

	if(procID > 0){
	        //:) I know it's ugly but I was in a hurry 
		HWND hw = FindWindow("WindowsForms10.Window.8.app.0.378734a","FireAdder - pregled reklama");
		//_windowHandle = hw;
		return hw;
	}
	_process = (HANDLE) -1;
	return NULL;
}


I though I could use same recipe for checking if utility app is closed, but above mentioned code does not return NULL, I thought GetProcessID will return 0!
Can someone tell me how to check whether utility process is still active in more inteligent way?

I am .Net brat with limited C++ Windows programming experience.

Excuse me for bad grammar or spelling, I am in a hurry.


AnswerRe: How to manipulate with processes from your app? Any help is appreciated Pin
Stuart Dootson20-May-09 8:16
professionalStuart Dootson20-May-09 8:16 
GeneralRe: How to manipulate with processes from your app? Any help is appreciated Pin
Oshtri Deka20-May-09 22:38
professionalOshtri Deka20-May-09 22:38 
AnswerRe: How to manipulate with processes from your app? Any help is appreciated Pin
ThatsAlok20-May-09 21:42
ThatsAlok20-May-09 21:42 
GeneralRe: How to manipulate with processes from your app? Any help is appreciated Pin
Oshtri Deka20-May-09 22:41
professionalOshtri Deka20-May-09 22:41 
QuestionCEdit with image suport? Pin
bosfan20-May-09 7:24
bosfan20-May-09 7:24 
AnswerRe: CEdit with image suport? Pin
David Crow20-May-09 7:43
David Crow20-May-09 7:43 
AnswerRe: CEdit with image suport? Pin
Nuri Ismail20-May-09 7:50
Nuri Ismail20-May-09 7:50 
QuestionConvert C++ from VisC++ 6 to VS 2008 [modified] Pin
gartnerj20-May-09 6:49
gartnerj20-May-09 6:49 
AnswerRe: Convert C++ from VisC++ 6 to VS 2008 Pin
David Crow20-May-09 7:42
David Crow20-May-09 7:42 
GeneralRe: Convert C++ from VisC++ 6 to VS 2008 Pin
gartnerj20-May-09 8:02
gartnerj20-May-09 8:02 
AnswerRe: Convert C++ from VisC++ 6 to VS 2008 Pin
led mike20-May-09 7:53
led mike20-May-09 7:53 
GeneralRe: Convert C++ from VisC++ 6 to VS 2008 Pin
gartnerj20-May-09 8:00
gartnerj20-May-09 8:00 
GeneralRe: Convert C++ from VisC++ 6 to VS 2008 Pin
led mike20-May-09 8:48
led mike20-May-09 8:48 
GeneralRe: Convert C++ from VisC++ 6 to VS 2008 Pin
gartnerj20-May-09 8:55
gartnerj20-May-09 8:55 
AnswerRe: Convert C++ from VisC++ 6 to VS 2008 Pin
Stuart Dootson20-May-09 8:24
professionalStuart Dootson20-May-09 8:24 
GeneralRe: Convert C++ from VisC++ 6 to VS 2008 Pin
gartnerj20-May-09 8:53
gartnerj20-May-09 8:53 
Questionassigning string table element to char* variable Pin
jimjim73320-May-09 5:31
jimjim73320-May-09 5:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.