Name: Anonymous 2009-04-23 2:52
ITT we post short, useful programs.
/******************************************************************
Date: 23-06-2008
Author: Raj Sharma
Description: If we know the window title and that is already opened,
we can Hide/Show that window by using this programme,
very amazing functionality
******************************************************************/
#include <stdio.h>
#include <windows.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#define ShowWindowFileName "C:\\System\\ShowWindow.txt"
HANDLE ColorHandle;
HWND stealth;
char WindowList[100][200];
int count = 0;
char *GetWindowName(void)
{
char windowTitle[200];
printf("\t\t\t");
system("PAUSE");
printf("\t\t\tClick on Window to be hided within 5 seconds\n");
sleep(5*1000);
GetWindowText(GetForegroundWindow(), windowTitle, GetWindowTextLength(GetForegroundWindow()) + 1);
SetConsoleTextAttribute(ColorHandle , 13);
printf("\n\t\t\tWINDOW-TITLE: \n\t\t\t> %s\n",windowTitle);
strcpy(WindowList[count] , windowTitle);
return windowTitle;
}
void GetWindowTitle(char *Exe)
{
char *Ptr, WindowToBeHided[MAX_PATH];
int ask, Handles[40], toFileDes, Temp = 0;
HWND Handle;
SetConsoleTextAttribute(ColorHandle , 10);
printf("\n\n\t\t +++++++++++++++++++++++++++++++++++++++++++++++++++\n\t\t\tDescription: Utility to Hide your Downloads \n\t\t\tOR Other private work on Public PC\n\n\t\t\tBy: Luvrajind\n\n\t\t\tOptions:\n\t\t\t1: Want Hide some window\n\t\t\t2: Total No of Hided Windows\n\t\t\t3: Show all Hided windows\n\t\t\t4: Hide This Window\n\t\t\t5: See This Menu\n\t\t +++++++++++++++++++++++++++++++++++++++++++++++++++\n\n");
while(1)
{
SetConsoleTextAttribute(ColorHandle , 12);
printf("\t\t-----------------------------------------------------------");
printf("\n\n\t\t\tEnter Option: ");
scanf("%d",&ask);
switch(ask)
{
case 1:
//Finding Specified window name which we want to hide.
Ptr = GetWindowName();
strcpy(WindowToBeHided , Ptr);
Handle = FindWindow(0, WindowToBeHided);
SetConsoleTextAttribute(ColorHandle , 14);
if((Handle != 0) && (strcmp(Exe , WindowToBeHided) != 0))
{
printf("\n\t\t\tSpecified Window is Opened and Now we are Hiding that");
ShowWindow(Handle,0);
Handles[count++] = Handle;
printf("\n\t\t\tTotal Hided windows are: %d\n",count);
}
else
printf("\n\t\t\tSorry !!!, its Main Programme window, Can't Hide\n");
break;
case 2:
SetConsoleTextAttribute(ColorHandle , 14);
printf("\t\t\tTotal Hided windows are: %d\n",count);
printf("\n\t\t\tList: \n");
while(Temp < count)
{
printf("\t\t\t%d. %s\n",Temp+1,WindowList[Temp]);
Temp++;
}
Temp = 0;
break;
case 3:
SetConsoleTextAttribute(ColorHandle , 14);
if(count != 0)
{
printf("\t\t\tShowing all Hided windows now ...\n");
printf("\t\t\tTotal Hided windows are: %d\n",count);
printf("\n\t\t\tList: \n");
while(Temp < count)
{
printf("\t\t\t%d. %s\n",Temp+1,WindowList[Temp]);
Temp++;
}
Temp = 0;
count = count-1;
while(count >= 0)
{
ShowWindow(Handles[count],1);
count--;
}
count = 0;
}
else
printf("\n\t\t\tNo Any window is Hided\n");
break;
case 4:
stealth = FindWindowA("ConsoleWindowClass",NULL);
SetConsoleTextAttribute(ColorHandle , 5);
printf("\t\t\tYou Need Following File to see this Window again: \n\t\t\t> %s\n\t\t\t",ShowWindowFileName);
system("PAUSE");
//Hiding Window
ShowWindow(stealth,0);
//Now Waiting from user to Enter Corret Password to see this window again
while(1)
{
sleep(30);
toFileDes = open(ShowWindowFileName , O_RDWR);
if(toFileDes > 0)
{
close(toFileDes);
system("del /q " ShowWindowFileName);
//Showing Window
ShowWindow(stealth,1);
break;
}
}
break;
case 5:
SetConsoleTextAttribute(ColorHandle , 10);
printf("\n\n\t\t +++++++++++++++++++++++++++++++++++++++++++++++++++\n\t\t\tDescription: Utility to Hide your Downloads \n\t\t\tOR Other private work on Public PC\n\n\t\t\tBy: Luvrajind\n\n\t\t\tOptions:\n\t\t\t1: Want Hide some window\n\t\t\t2: Total No of Hided Windows\n\t\t\t3: Show all Hided windows\n\t\t\t4: Hide This Window\n\t\t\t5: See This Menu\n\t\t +++++++++++++++++++++++++++++++++++++++++++++++++++\n\n");
break;
}
//Avoid 100% CPU Usage
Sleep(30);
}
}
int main(int argc, char **argv)
{
ColorHandle = GetStdHandle(STD_OUTPUT_HANDLE);
char Temp[200];
strcpy(Temp , *argv);
GetWindowTitle(Temp);
}