i can't seem to get the code right, the program shal return something in parm2 but it can't, i can someone make it so it can?
Code:int main () { int lol=0; HANDLE hread; GetExitCodeProcess(hread,lol*); }
i can't seem to get the code right, the program shal return something in parm2 but it can't, i can someone make it so it can?
Code:int main () { int lol=0; HANDLE hread; GetExitCodeProcess(hread,lol*); }
Code:GetExitCodeProcess(hread, &lol);
Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.
what do you mean the code dosent work?
It's probably not working because your HANDLE is bad. What does your code look like?
WHOLE CODE, INCLUDED SOME EXTRA FILES JUST GET THEM AWAY, IT ONLY NEED WINDOWS.H
Code:#include <exception> #include <cstdlib> #include <windows.h> #include <iostream> using namespace std; int main () { HANDLE hread; int lol; GetExitCodeProcess(hread,&lol*); } /* TerminateProcess( __in HANDLE hProcess, __in UINT uExitCode ); */
Your handle is not initialized. What are you trying to do? GetExitCodeProcess() gets the termination status of the process matching the HANDLE passed to the function. You are just declaring a HANDLE and passing it to GetExitCodeProcess which will always fail.
then how do i intialize it do you have a tutorial on how to make the handle return thing working?
Initialize it to what? A HANDLE represents a process. What process are you trying to get the termination status of?
explorer.exe
This assumes you know the process ID of explorer.exe
Code:int main() { DWORD dword; HANDLE handle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, explorerProcessId); GetExitCodeProcess(handle, &dword); }
If you don't launch it yourself
No faffing required.Code:DWORD explorerExitCode = 259;
don't get it why should it be so hard?