Re: What Programs are running?
- Posted by don cole <doncole at pacbell.net> Apr 05, 2005
- 486 views
Michael Raley wrote: > > don cole wrote: > > > > > > How can I get a list of the programs that are currently running? > > Like when I press ctl+alt+del? > > In a euphoria sequence of course. > > > > Don Cole > > SF > > > > winclassdll.e will give a list of handles > > }}} <eucode> > include winclassdll.e > atom a > sequence s > s = listWindows() > a = open("handles.txt","w") > for i= 1 to length(s) do > printf(a,"%d -- ",s[i]) > puts(a, getCaption(s[i])&"\n") > end for > close(a) > </eucode> {{{ > > some of the output I get; > > 184 -- RPCSSWindow > 712 -- OLEChannelWnd > 532 -- MM USB Keyboard Driver > 296 -- One-touch Multimedia Keyboard > 536 -- Microsoft PC State Manager > 604 -- OleMainThreadWndName > 608 -- DDE Server Window > 724 -- MS_WebcheckMonitor > 748 -- Power Meter > 840 -- USBMMKBD > 948 -- OleMainThreadWndName > 952 -- AnalogX PortBlocker Log... > 972 -- PortBlocker > 976 -- OleMainThreadWndName > 804 -- FastCache > 988 -- Proxy > 992 -- Connection Manager > 1108 -- Adaptec DirectCD Wizard > 1532 -- WIN95 RPC Wmsg Window > 2604 -- DDHelpWndClass > 564 -- WIN95 RPC Wmsg Window > 1796 -- ΓΏ > 1548 -- WIADCWND > 1540 -- STI Monitor > 1536 -- STI Monitor > 1520 -- OLEChannelWnd > > > --"ask about our layaway plan". > -- > I have two programs accessing the same database. 'find.exe' and 'add.exe'. if 'find.exe' is still running when using 'add.exe' then all the info added is lost when I close 'find.exe'. I solved the problem with: </eucode> {{{ include window.ew global function is_file_open(sequence file) sequence windows,class,captions object caption captions={} windows = window_ListAll() for i = 1 to length(windows) do class = GetClassName( windows[i] ) caption = window_GetCaption( windows[i] ) if length(class) then captions=append(captions,caption) end if end for if find(file,captions) then return 1 else return 0 end if end function procedure check(integer self, integer event, sequence params) object ok if is_file_open("Find") then ok = message_box( "Close Find and Restart", "Find.Exe Open", MB_ICONHAND+ MB_TASKMODAL ) closeWindow(Window1) end if end procedure setHandler(Window1,w32HActivate,routine_id("check")) </eucode> {{{ Don Cole SF