|
What about Interprocess communiccation:- here is link for same :-
http://www.codeproject.com/threads/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Sorry!
But I can not find any cases about Windows Services in the "Interprocess communiccation"
|
|
|
|
|
Mojtaba_Service wrote:
about Windows Services in the "Interprocess communiccation
Interprocess Communication is use to communicate between two or more process (based on method you are using). Now let if you Window Service have window it must have HWND associated with it... so using Simplest Interprocess mechanism i.e. Window Message you can Post your User Defined messages (WM_APP+ and WM_USER+) with some other program/process and instruct the service to work according to it...
This is just simple logic. Better you try this logic with two desktop-based application before applying directly to service.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Services have no front end.
|
|
|
|
|
Igor Vigdorchik wrote:
Services have no front end.
Yeap service don't have any FrontEnd, but you can have both Windows and front end for service....( clue: desktop interactice service)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
is there a way to get the handle of aprocess without calling openprocess if i have the pid ?
gabby
|
|
|
|
|
euacela wrote:
openprocess if i have the pid ?
AFAIK, NO!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Definitely, no.
Definitely, yes - if you can access information on the Kernel internal structures. But even if so, your app may not work on different Windows versions.
One always gets the deserved.
http://www.silveragesoftware.com/hffr.html Update your source code with my tool HandyFile Find And Replace!
|
|
|
|
|
Even if he had kernel access he couldn't!
The kernel does not use handles for the process. It uses pointers to EPROCESS structures!
Don't try it, just do it!
|
|
|
|
|
I know that I can make a driver and use deviceiocontrol and get the handle out but just tell me the function.
The EPROCESS structure doesn't have a member for the handle.
I know about this function
NTSYSAPI
NTSTATUS
NTAPI
PsLookupProcessByProcessId (
IN ULONG ProcessId,
OUT PEPROCESS *Process
);
and this is all I know about eprocess
typedef struct _EPROCESS {
KPROCESS Pcb;
EX_PUSH_LOCK ProcessLock;
...
UCHAR ImageFileName[16];
...
UCHAR PriorityClass;
BOOLEAN WorkingSetAcquiredUnsafe;
} EPROCESS, *PEPROCESS;
is KPROCESS the process HANDLE and if it is what ACCESS does it have, i supose PROCESS_ALL_ACCESS right ??/
gabby
|
|
|
|
|
i wonder how can I get an IMAGE_FUNCTION_ENTRY of a certain function in a dll
is it
IMAGE_FUNCTION_ENTRY *IFE=(IMAGE_FUNCTION_ENTRY *)((BYTE *)hMod+FunctionAddress) ????
this returns a non NULL value but I am not sure if it is a valid structure
gabby
|
|
|
|
|
|
It is definitly not.
The code you are using may not even create a pointer to valid memory.
Read the "SymFunctionTableAccess64" page in MSDN and you will see that IMAGE_FUNCTION_ENTRY is not used on x86 (Intel + AMD) platforms.
Don't try it, just do it!
|
|
|
|
|
I'm trying to teach myself C++. I making a real simple calculator (console app) from an exercise in a book. It needs to display, "Press any key to continue".
I declared a variable chKey, but when I hit enter the cursor just keeps moving down the command prompt.
cout << "PRESS ANY KEY TO CONTINUE\n\n";
cin >> chKey;
Is there anything I need to do to "continue"? The book is no help.
Thanks
|
|
|
|
|
Try this instead:
cout << "PRESS ANY KEY TO CONTINUE" << endl << endl;
getch();
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
How do you clear the console screen?
THanks
|
|
|
|
|
See MSDN article Q99261.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
system("cls");
or use
-------
void clrscr(TCHAR FillChar)
{
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, FillChar, dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
return;
}
-------
and maybe you will need gotoxy too ( X-D )
-------
void gotoxy(int x, int y)
{
COORD pos;
pos.X = x-1; pos.Y = y-1;
SetConsoleCursorPosition(GetStdHandle( STD_OUTPUT_HANDLE ), pos);
}
|
|
|
|
|
That only seems to clear the screen if I hit enter. Any key would work. Please help.
|
|
|
|
|
I often use the function Shellexecute to run for example gzip.exe to compress files. How can I stop the execution of my program to wait for the “gzip-process” to return?
May I use any other function to accomplish my task?
_____________________________
...and justice for all
APe
|
|
|
|
|
Use WaitForSingleObject() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DWORD ExitCode;
STARTUPINFO si;
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;
if(!CreateProcessA(0, "notepad.exe", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, 0, &si, &pi))
{
printf("CreateProcess false\n");
return -1;
}
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &ExitCode);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
if (ExitCode == 0)
{
// ...
}
....
|
|
|
|
|
Anyone know of a program / class / piece of code that will take an irregularly spaced set of (x,y,z) data and transform to regularly spaced contours?
cheers,
Chris Maunder
|
|
|
|