Como saber las aplicaciones abiertas mediante API.
#DEFINE GW_HWNDNEXT 2 #DEFINE GW_CHILD 5 #DEFINE GWL_STYLE -16 #DEFINE WS_VISIBLE 0x10000000 #DEFINE WS_POPUP 0x80000000 DECLARE LONG GetWindow IN WIN32API LONG HWND, LONG uCmd DECLARE LONG GetWindowText IN WIN32API LONG HWND, STRING @lpString, LONG nMaxCount DECLARE INTEGER GetDesktopWindow IN Win32API DECLARE LONG GetWindowLong IN WIN32API LONG HWND, LONG nIndex DECLARE INTEGER IsIconic IN user32 INTEGER HWND CREATE CURSOR crsWindows ( ; HWND I, WindTitle C(50),isIconic L) lhWnd = GetDesktopWindow() lhWnd = GetWindow(lhWnd, GW_CHILD) DO WHILE lhWnd > 0 m.WindTitle = GetTitle(lhWnd) IF NOT EMPTY(m.WindTitle) m.hwnd = lhWnd m.Style = GetWindowLong(lhWnd, GWL_STYLE) m.hex = TRANSFORM(m.Style, ";@0") m.isiconic = IIF(IsIconic(lhWnd)=0,.F.,.T.) IF BITAND(m.Style, WS_VISIBLE) > 0 ; AND BITAND(m.Style, WS_POPUP) = 0 INSERT INTO crsWindows FROM MEMVAR ENDIF ENDIF lhWnd = GetWindow(lhWnd, GW_HWNDNEXT ) ENDDO SELECT crsWindows LOCATE BROWSE NOWAIT RETURN FUNCTION GetTitle(lhWnd) LOCAL lcTitle lcTitle = SPACE(512) lnTitle = GetWindowText(lhWnd , @lcTitle, 256) IF lnTitle > 0 lcTitle = LEFT(lcTitle, lnTitle ) ELSE lcTitle = "" ENDIF RETURN lcTitle ENDFUNC
Mauricio Henao Romero
Interesante pregunta.
ResponderBorrarMe gustaria saberlo tambien.