User Tools

Site Tools


listing_20other_20windows_20and_20applications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

listing_20other_20windows_20and_20applications [2018/03/31 13:19]
127.0.0.1 external edit
listing_20other_20windows_20and_20applications [2018/04/15 10:46] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Listing other windows and applications===== =====Listing other windows and applications=====
  
-//By Michael Hicks, June 2007, amended by Richard Russell, March 2011//\\ \\  The Microsoft Windows API call "​EnumWindows"​ enables a user to find all the windows which are open. This function requires the use of a "​callback"​ function, and to use a callback function it is necessary deploy the "​CALLBACK.BBC"​ library supplied with //BBC BASIC for Windows//​.\\ \\  In this short program we find all the open windows ("​EnumWindows"​),​ get their captions or text ("​GetWindowText"​),​ find those which are visible ("​IsWindowVisible"​),​ and where possible the file which opened them ("​GetWindowModuleFileName"​). The details of visible windows are printed. If the test for visibility is removed, numerous hidden windows can be seen.\\ \\ +//By Michael Hicks, June 2007, amended by Richard Russell, March 2011//\\ \\  The Microsoft Windows API call "​EnumWindows"​ enables a user to find all the windows which are open. This function requires the use of a "​callback"​ function, and to use a callback function it is necessary deploy the "​CALLBACK.BBC"​ library supplied with //BBC BASIC for Windows//​.\\ \\  In this short program we find all the open windows ("​EnumWindows"​),​ get their captions or text ("​GetWindowText"​),​ find those which are visible ("​IsWindowVisible"​),​ and where possible the file which opened them ("​GetWindowModuleFileName"​). The details of visible windows are printed. If the test for visibility is removed, numerous hidden windows can be seen. 
 ===== Windows 95 or 98 only: ===== ===== Windows 95 or 98 only: =====
 +
 +<code bb4w>
         INSTALL @lib$+"​CALLBACK"​         INSTALL @lib$+"​CALLBACK"​
  
Line 36: Line 39:
         index% += 1         index% += 1
         = 1         = 1
-\\ **Note:** Owing to the use of "​GetWindowModuleFileName"​ this code requires Windows 98 or earlier to work fully. In later versions of Windows the reported filename may not be correct if the window is not owned by the calling process; see this [[http://​support.microsoft.com/?​id=228469|Microsoft support article]] for further information.\\ \\  This problem can be overcome by using the code below:\\ \\ +</​code>​ 
 + 
 +**Note:** Owing to the use of "​GetWindowModuleFileName"​ this code requires Windows 98 or earlier to work fully. In later versions of Windows the reported filename may not be correct if the window is not owned by the calling process; see this [[http://​support.microsoft.com/?​id=228469|Microsoft support article]] for further information.\\ \\  This problem can be overcome by using the code below: 
 ===== Windows 2000 or later: ===== ===== Windows 2000 or later: =====
 +
 +<code bb4w>
         INSTALL @lib$+"​CALLBACK"​         INSTALL @lib$+"​CALLBACK"​
  
Line 75: Line 83:
         Index% += 1         Index% += 1
         = 1         = 1
 +</​code>​
listing_20other_20windows_20and_20applications.txt · Last modified: 2018/04/15 10:46 by richardrussell