Commits

overlord  committed bc7d1ae

App to show all windows under Microsoft Windows.

  • Participants

Comments (0)

Files changed (6)

File ShowAll.DSW

Binary file added.

File ShowAll.ide

Binary file added.

File ShowAll.mbt

Binary file added.

File ShowAll.mrt

Binary file added.
+/Twe/x/l/c/C/k /V3.0 /LC:\BC5\LIB +
+-v- C:\BC5\LIB\c0ws.obj+
+-v- showall.obj
+showall.exe
+
+-v- C:\BC5\LIB\noehws.lib+
+-v- C:\BC5\LIB\import.lib+
+-v- C:\BC5\LIB\mathws.lib+
+-v- C:\BC5\LIB\cws.lib
+
+#include <Windows.H>
+#include <StdIO.H>
+#pragma hdrstop
+
+static int DispWins(void);
+
+int main()
+{
+	DWORD EndWaitTime;
+	printf("Show all windows 1.0 (mahem program) - David Duncan Ross Palmer\n");
+   printf("Copyright 1999 Daybo Logic, all rights reserved.\n");
+   #ifdef __WIN32__
+   printf("Win32\n\n");
+   #else
+   printf("Windows 3.x 16\n\n");
+   #endif /*__WIN32__*/
+   /* Pause for a little while */
+   EndWaitTime = GetTickCount() + 6 * 1000; /* End six seconds from now */
+   while (GetTickCount() < EndWaitTime) {}; /* Waste time */
+
+   if (MessageBox(NULL, "Running this program causes a little disruption and Windows is likely to need restarting afterwards.  This is because Windows which are hidden can\'t always expect to ever be shown so this may affect system stability, run at this time?", "Warning", MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
+   {
+   	printf("Searching and revealing...\n");
+   	return DispWins(); /* Tell OS how many wins we found */
+   }
+   else /* User does not want to run program */
+   {
+   	printf("*** STOPPED ***\n");
+   }
+   return 0;
+}
+
+static int DispWins()
+{
+	unsigned int CurrHandle; /* Start off at lowest window handle */
+   unsigned int ValidHandleCount=0; /* Number of valid handles */
+
+   for (CurrHandle = 0; CurrHandle < ~0U; CurrHandle++) /* All possible handles */
+   {
+   	if (IsWindow((HWND)CurrHandle)) /* Got a valid handle */
+      {
+      	printf("Valid handle found 0x%X - ", CurrHandle);
+         ValidHandleCount++;
+         if (ShowWindow((HWND)CurrHandle, SW_SHOW)) /* Managed to show the window */
+         {
+         	printf("Forced it out of hiding.\n");
+         }
+         else
+         {
+         	printf("Can't show it, sorry.\n");
+         }
+      }
+   }
+   return ValidHandleCount;
+}