Hiding the console - extended
This thread is already on the C++ board, however it doesn't explain what's happening. I'd like to know what a few things mean :
Code:
#include <windows.h>
int main()
{
char wintitle[] = "Disappearing CONSOLES...";
::SetConsoleTitle( wintitle );
Sleep( 2000 );
HWND hWnd = NULL;
while (NULL == hWnd)
{
hWnd = ::FindWindow( NULL, wintitle );
}
ShowWindow( hWnd, SW_HIDE );
Sleep( 2000);
ShowWindow( hWnd, SW_SHOW );
Sleep( 2000 );
return 0;
}
So, firstly, what's the :: operator that sets the console title ?
Secondly, what's HWND hWnd, and why is it being set to NULL ?
Thirdly, again, the :: operator, but after an equals sign ? Why ? What are the two variables being used in the function FindWindow ?
Fourthly, the function ShowWindow, what are the two variables that are fed in ?
Thanks
EDIT : A handle is something that can be used to manipulate programs, correct ? Please define a handle "the correct way", :P before I start pulling my hair out :) Also, how are they used ?