Quote Originally Posted by lucastonon View Post
This callback function is called when I press a button, but I wanted to pass the handle out of it to use it in another button or something else, and use openprocess out of it. How?
What is "EnumWindowsProcb"?

If you mean "EnumWindowsProc", then that's what the second parameter to EnumWindowsProc is for.

http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx
Code:
HANDLE myHandle = NULL;
EnumWindows(whatever, (LPARAM)&myHandle);
//....
Code:
static BOOL CALLBACK EnumWindowsProcb(HWND hwnd, LPARAM lParam) 
{
//...
    HANDLE *pHandle = (HANDLE*)lParam;
    *pHandle = hProcess;
....
Regards,

Paul McKenzie