Script para Ver las propiedades de una ventana

y programas personales para otros como tu, puede que te corrijan ;)
Responder
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Script para Ver las propiedades de una ventana

Mensaje por Chefito »

Hola chicos.
Como este fin de semana no he podido salir, he aprovechado para hacer un script que muestre las propiedades de una ventana.
Al final me he liado y le he añadido algunas opciones :smt003 :smt024 .
Puedes meter el título de la ventana en un input. Dandole al botón de al lado o al pulsar la tecla enter, te aparecen las propiedades en la lista.
También he añadido una lista aparte con todas las ventanas del windows. Puedes seleccionar una y ver las propiedades dandole al botón o al pulsar la tecla enter.
He añadido a parte una sección donde puedes ver el texto de la ventana y la lista de clases.
Por último, le he puesto dos botones (checkboxes): Uno para dejar siempre visible la ventana del programa y el otro para que cuando pulses la tecla "f8" te muestre las propiedades de la ventana activa.

Por supuesto deciros que aparecen todas las propiedades en la lista. Si aparecen con el icono de una flecha verde es que la ventana la posee, si aparece con una equis roja es que no....logicamente :smt005 :smt005 .

Como siempre el código es totalmente libre (se agradecería que si se utiliza gran parte de éste se nombrase al autor :smt002 ).
Si quereis meter alguna propiedad más, o mejorarlo.....pues hacerlo :smt001 .
No está probado al 100%. Puede que tenga algún fallo. Si encontrais algún error comentarmelo para poder subsanarlo :smt024 .

Espero que os guste. Dejo el script en el siguiente post que he tenido problemas para meter todo en un solo post.

También he dejado el ejecutable y el código alojado en:
http://www.filefactory.com/file/a07d0f4 ... ntanas_exe
http://www.filefactory.com/file/a07d0f5 ... ntanas_au3

Darle al botón que aparece en la parte de abajo para descargarlos, el que pone DOWNLOAD FILE. Esperar el tiempo y darle de nuevo.

Saludos.
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Codigo del Script para Ver las propiedades de una ventana

Mensaje por Chefito »

;Código realizado por chefito (26/10/2009). Script para ver las propiedades de una ventana.
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
#include <Constants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>

Global $hListView,$hListView2,$hVentana="",$ItemSeleccionado,$auxDarFocoEdit=1,$GUI, $hImage

$GUI = GUICreate("Ver las propiedades de una ventana", 850, 400)
$Button_1 = GUICtrlCreateButton("Ver propiedades", 10, 285, 100)
GUICtrlSetTip(-1,"Muestra las propiedades de la ventana que coincide con el título puesto")
$Button_2 = GUICtrlCreateButton("Ver propiedades", 580, 247, 100)
GUICtrlSetTip(-1,"Muestra las propiedades de la ventana seleccionada en la lista")
$Button_3 = GUICtrlCreateButton("Refrescar lista", 700, 247, 100)
$Input_1 = GUICtrlCreateInput("Poner aquí un título de ventana...", 130, 288, 300, 20)
GUICtrlSetTip(-1,"Poner aquí un título de ventana. Puedes darle al botón o pulsar enter para ver las propiedades de la ventana")
GUICtrlSetColor(-1,0x8080ff)
$hInput_1=GUICtrlGetHandle($Input_1)
$Input_2 = GUICtrlCreateInput("", 130, 327, 300, 20,$ES_READONLY)
$label_1 = GUICtrlCreateLabel("Título de ventana >>>",10,330)
$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 520, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT,$LVS_EX_SUBITEMIMAGES))
$hListView2= _GUICtrlListView_Create($GUI, "", 540, 2, 300, 230)
_GUICtrlListView_SetExtendedListViewStyle($hListView2, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT,$LVS_EX_SUBITEMIMAGES))
GUICtrlCreateGraphic(460, 288, 380, 100, 0)
GUICtrlSetBkColor(-1, 0x808080)
$label_2=GUICtrlCreateLabel("",470,295,100,15)
GUICtrlSetBkColor(-1,0x4875b7)
GUICtrlSetColor(-1,0xffffff)
$Button_4 = GUICtrlCreateButton("Lista de Clases", 470, 320, 100)
$Button_5 = GUICtrlCreateButton("Texto de ventana", 470, 355, 100)
$Edit_1=GUICtrlCreateEdit("",580,295,250,85,$ES_READONLY+$ES_MULTILINE+$ES_AUTOVSCROLL+$WS_VSCROLL)
$Checkbox_1 = GUICtrlCreateCheckbox("TopMost", 50, 360, 100,25,$BS_PUSHLIKE)
GUICtrlSetTip(-1,"Deja la ventana del programa siempre visible")
$Checkbox_2 = GUICtrlCreateCheckbox("Propiedades de ventana activa (F8)", 200, 360, 190,25,$BS_PUSHLIKE)
GUICtrlSetTip(-1,"Para ver las propiedades de la ventana activa pulsa F8")
$hImage = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131) ;icono equis. No funciona el servidor.
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137) ;icono flecha. El servidor que se está utilizando.
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "COMMON STYLE", 180)
_GUICtrlListView_InsertColumn($hListView, 1, "EXTENDED STYLE", 180)
_GUICtrlListView_InsertColumn($hListView, 2, "OTRAS CARACTERISTICAS", 160)

_GUICtrlListView_InsertColumn($hListView2, 0, "TÍTULO DE WINS", 184)
_GUICtrlListView_InsertColumn($hListView2, 1, "HANDLE", 100)
ActualizarListaVentanas()
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            CodigoBoton1()
        Case $msg=$Button_2
            $hVentana=HWnd(_GUICtrlListView_GetItemText($hListView2,$ItemSeleccionado,1))
            VerPropiedadesWin($hVentana)
        Case $msg=$Button_3     ;borro todos los Items de la 2º lista (lista de ventanas de win).
            _GUICtrlListView_DeleteAllItems($hListView2)
            ActualizarListaVentanas()
        Case $msg=$Button_4     ;Vemos la lista de clases de la ventana a la que hayamos visto sus propiedades.
            If $hVentana<>"" Then
                $textoClases=StringReplace(WinGetClassList($hVentana),@lf,@CRLF)
                GUICtrlSetData($Edit_1,$textoClases)
                GUICtrlSetData($label_2,"Lista de clases >>")
            EndIf
        Case $msg=$Button_5     ;Vemos el texto de la ventana a la que hayamos visto sus propiedades.
            If $hVentana<>"" Then
                $textoVentana=StringReplace(WinGetText($hVentana),@lf,@CRLF)
                GUICtrlSetData($Edit_1,$textoVentana)
                GUICtrlSetData($label_2,"Texto de ventana >>")
            EndIf
        Case $msg = $Checkbox_1     ;si selecciono este checkbox (estilo botón), la ventana del programa quedará siempre visible.
            If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
                WinSetOnTop($GUI,"",1)
            Else
                WinSetOnTop($GUI,"",0)
            EndIf
        Case $msg=$Checkbox_2   ;si selecciono este checkbox (estilo botón), al pulsar la tecla f8, veremos las propiedades de la ventana activa.
            If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
                HotKeySet("{f8}","PropiedadesVentanaActiva")
            Else
                HotKeySet("{f8}")
            EndIf
    EndSelect
WEnd

Func ActualizarListaVentanas()
$VentanasWin=WinList()
For $n=1 To $VentanasWin[0][0]
    _GUICtrlListView_AddItem($hListView2, $VentanasWin[$n][0])
    _GUICtrlListView_AddSubItem($hListView2,$n-1, $VentanasWin[$n][1],1)
Next
_GUICtrlListView_SetItemSelected($hListView2, 0)
EndFunc
Func PropiedadesVentanaActiva()
    $hVentana=WinGetHandle("[active]")
    VerPropiedadesWin($hVentana)
EndFunc
Func CodigoBoton1()
    $WinTitulo=GUICtrlRead($Input_1)
    If $WinTitulo<>"" And $auxDarFocoEdit=0 Then
        $hVentana=WinGetHandle($WinTitulo)
    Else
        $hVentana=$GUI
    EndIf
    VerPropiedadesWin($hVentana)
EndFunc
Func VerPropiedadesWin($hWin)
    If $hWin<>"" Then
        $hWin=HWnd($hWin)
        ;Da el texto de la ventana elegida
        $textoVentana=StringReplace(WinGetText($hWin),@lf,@CRLF)
        GUICtrlSetData($Edit_1,$textoVentana)
        GUICtrlSetData($label_2,"Texto de ventana >>")
        ;Fin del texto de la ventana elegida
        _GUICtrlListView_DeleteAllItems($hListView)
        $WinStyle=_WinAPI_GetWindowLong($hWin, $GWL_STYLE)
        $WinExStyle=_WinAPI_GetWindowLong($hWin, $GWL_EXSTYLE)
        $WinState=WinGetState($hWin)
        $WinSize=WinGetPos($hWin)
        GUICtrlSetData($Input_2,WinGetTitle($hWin))
            If BitAND($WinStyle,$WS_BORDER)=$WS_BORDER Then
                _GUICtrlListView_AddItem($hListView, "$WS_BORDER",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_BORDER",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_ACCEPTFILES)=$WS_EX_ACCEPTFILES Then
                    _GUICtrlListView_AddSubItem($hListView,0, "$WS_EX_ACCEPTFILES",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,0, "$WS_EX_ACCEPTFILES",1, 0)
                EndIf
                If BitAND($WinState,2)=2 Then
                    _GUICtrlListView_AddSubItem($hListView,0, "VISIBLE",2, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,0, "VISIBLE",2, 0)
                EndIf

            If BitAND($WinStyle,$WS_POPUP)=$WS_POPUP Then
                _GUICtrlListView_AddItem($hListView, "$WS_POPUP",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_POPUP",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_APPWINDOW)=$WS_EX_APPWINDOW Then
                    _GUICtrlListView_AddSubItem($hListView,1, "$WS_EX_APPWINDOW",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,1, "$WS_EX_APPWINDOW",1, 0)
                EndIf
                If BitAND($WinState,4)=4 Then
                    _GUICtrlListView_AddSubItem($hListView,1, "HABILITADA",2, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,1, "HABILITADA",2, 0)
                EndIf

            If BitAND($WinStyle,$WS_CAPTION)=$WS_CAPTION Then
                _GUICtrlListView_AddItem($hListView, "$WS_CAPTION",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_CAPTION",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_CLIENTEDGE)=$WS_EX_CLIENTEDGE Then
                    _GUICtrlListView_AddSubItem($hListView,2, "$WS_EX_CLIENTEDGE",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,2, "$WS_EX_CLIENTEDGE",1, 0)
                EndIf
                If BitAND($WinState,8)=8 Then
                    _GUICtrlListView_AddSubItem($hListView,2, "ACTIVA",2, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,2, "ACTIVA",2, 0)
                EndIf

            If BitAND($WinStyle,$WS_CLIPCHILDREN)=$WS_CLIPCHILDREN Then
                _GUICtrlListView_AddItem($hListView, "$WS_CLIPCHILDREN",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_CLIPCHILDREN",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_CONTEXTHELP)=$WS_EX_CONTEXTHELP Then
                    _GUICtrlListView_AddSubItem($hListView,3, "$WS_EX_CONTEXTHELP",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,3, "$WS_EX_CONTEXTHELP",1, 0)
                EndIf
                If BitAND($WinState,16)=16 Then
                    _GUICtrlListView_AddSubItem($hListView,3, "MINIMIZADA",2, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,3, "MINIMIZADA",2, 0)
                EndIf

            If BitAND($WinStyle,$WS_CLIPSIBLINGS)=$WS_CLIPSIBLINGS Then
                _GUICtrlListView_AddItem($hListView, "$WS_CLIPSIBLINGS",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_CLIPSIBLINGS",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_DLGMODALFRAME)=$WS_EX_DLGMODALFRAME Then
                    _GUICtrlListView_AddSubItem($hListView,4, "$WS_EX_DLGMODALFRAME",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,4, "$WS_EX_DLGMODALFRAME",1, 0)
                EndIf
                If BitAND($WinState,32)=32 Then
                    _GUICtrlListView_AddSubItem($hListView,4, "MAXIMIZADA",2, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,4, "MAXIMIZADA",2, 0)
                EndIf

            If BitAND($WinStyle,$WS_DISABLED)=$WS_DISABLED Then
                _GUICtrlListView_AddItem($hListView, "$WS_DISABLED",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_DISABLED",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_MDICHILD)=$WS_EX_MDICHILD Then
                    _GUICtrlListView_AddSubItem($hListView,5, "$WS_EX_MDICHILD",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,5, "$WS_EX_MDICHILD",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,5,"Posición X (left): " & $WinSize[0],2,1)

            If BitAND($WinStyle,$WS_DLGFRAME)=$WS_DLGFRAME Then
                _GUICtrlListView_AddItem($hListView, "$WS_DLGFRAME",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_DLGFRAME",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_OVERLAPPEDWINDOW)=$WS_EX_OVERLAPPEDWINDOW Then
                    _GUICtrlListView_AddSubItem($hListView,6, "$WS_EX_OVERLAPPEDWINDOW",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,6, "$WS_EX_OVERLAPPEDWINDOW",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,6,"Posición Y (top): " & $WinSize[1],2,1)

            If BitAND($WinStyle,$WS_HSCROLL)=$WS_HSCROLL Then
                _GUICtrlListView_AddItem($hListView, "$WS_HSCROLL",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_HSCROLL",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_STATICEDGE)=$WS_EX_STATICEDGE Then
                    _GUICtrlListView_AddSubItem($hListView,7, "$WS_EX_STATICEDGE",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,7, "$WS_EX_STATICEDGE",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,7,"Ancho (width): " & $WinSize[2],2,1)

            If BitAND($WinStyle,$WS_MAXIMIZE)=$WS_MAXIMIZE Then
                _GUICtrlListView_AddItem($hListView, "$WS_MAXIMIZE",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_MAXIMIZE",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_TOPMOST)=$WS_EX_TOPMOST Then
                    _GUICtrlListView_AddSubItem($hListView,8, "$WS_EX_TOPMOST",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,8, "$WS_EX_TOPMOST",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,8,"Alto (height): " & $WinSize[3],2,1)

            If BitAND($WinStyle,$WS_MAXIMIZEBOX)=$WS_MAXIMIZEBOX Then
                _GUICtrlListView_AddItem($hListView, "$WS_MAXIMIZEBOX",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_MAXIMIZEBOX",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_TRANSPARENT)=$WS_EX_TRANSPARENT Then
                    _GUICtrlListView_AddSubItem($hListView,9, "$WS_EX_TRANSPARENT",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,9, "$WS_EX_TRANSPARENT",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,9,"Handle: " & WinGetHandle($hWin),2,1)

            If BitAND($WinStyle,$WS_MINIMIZE)=$WS_MINIMIZE Then
                _GUICtrlListView_AddItem($hListView, "$WS_MINIMIZE",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_MINIMIZE",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_TOOLWINDOW)=$WS_EX_TOOLWINDOW Then
                    _GUICtrlListView_AddSubItem($hListView,10, "$WS_EX_TOOLWINDOW",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,10, "$WS_EX_TOOLWINDOW",1, 0)
                EndIf
                _GUICtrlListView_AddSubItem($hListView,10,"Proceso: " & WinGetProcess($hWin),2,1)

            If BitAND($WinStyle,$WS_MINIMIZEBOX)=$WS_MINIMIZEBOX Then
                _GUICtrlListView_AddItem($hListView, "$WS_MINIMIZEBOX",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_MINIMIZEBOX",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_WINDOWEDGE)=$WS_EX_WINDOWEDGE Then
                    _GUICtrlListView_AddSubItem($hListView,11, "$WS_EX_WINDOWEDGE",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,11, "$WS_EX_WINDOWEDGE",1, 0)
                EndIf

            If BitAND($WinStyle,$WS_OVERLAPPED)=$WS_OVERLAPPED Then
                _GUICtrlListView_AddItem($hListView, "$WS_OVERLAPPED",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_OVERLAPPED",0)
            EndIf
                If BitAND($WinExStyle,$WS_EX_LAYERED)=$WS_EX_LAYERED Then
                    _GUICtrlListView_AddSubItem($hListView,12, "$WS_EX_LAYERED",1, 1)
                Else
                    _GUICtrlListView_AddSubItem($hListView,12, "$WS_EX_LAYERED",1, 0)
                EndIf

            If BitAND($WinStyle,$WS_OVERLAPPEDWINDOW)=$WS_OVERLAPPEDWINDOW Then
                _GUICtrlListView_AddItem($hListView, "$WS_OVERLAPPEDWINDOW",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_OVERLAPPEDWINDOW",0)
            EndIf
            If BitAND($WinStyle,$WS_POPUPWINDOW)=$WS_POPUPWINDOW Then
                _GUICtrlListView_AddItem($hListView, "$WS_POPUPWINDOW",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_POPUPWINDOW",0)
            EndIf
            If BitAND($WinStyle,$WS_SIZEBOX)=$WS_SIZEBOX Then
                _GUICtrlListView_AddItem($hListView, "$WS_POPUPWINDOW",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_POPUPWINDOW",0)
            EndIf
            If BitAND($WinStyle,$WS_SYSMENU)=$WS_SYSMENU Then
                _GUICtrlListView_AddItem($hListView, "$WS_SYSMENU",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_SYSMENU",0)
            EndIf
            If BitAND($WinStyle,$WS_THICKFRAME)=$WS_THICKFRAME Then
                _GUICtrlListView_AddItem($hListView, "$WS_THICKFRAME",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_THICKFRAME",0)
            EndIf
            If BitAND($WinStyle,$WS_VSCROLL)=$WS_VSCROLL Then
                _GUICtrlListView_AddItem($hListView, "$WS_VSCROLL",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_VSCROLL",0)
            EndIf
            If BitAND($WinStyle,$WS_VISIBLE)=$WS_VISIBLE Then
                _GUICtrlListView_AddItem($hListView, "$WS_VISIBLE",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_VISIBLE",0)
            EndIf
            If BitAND($WinStyle,$WS_CHILD)=$WS_CHILD Then
                _GUICtrlListView_AddItem($hListView, "$WS_CHILD",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_CHILD",0)
            EndIf
            If BitAND($WinStyle,$WS_GROUP)=$WS_GROUP Then
                _GUICtrlListView_AddItem($hListView, "$WS_GROUP",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_GROUP",0)
            EndIf
            If BitAND($WinStyle,$WS_TABSTOP)=$WS_TABSTOP Then
                _GUICtrlListView_AddItem($hListView, "$WS_TABSTOP",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$WS_TABSTOP",0)
            EndIf
            If BitAND($WinStyle,$DS_MODALFRAME)=$DS_MODALFRAME Then
                _GUICtrlListView_AddItem($hListView, "$DS_MODALFRAME",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$DS_MODALFRAME",0)
            EndIf
            If BitAND($WinStyle,$DS_SETFOREGROUND)=$DS_SETFOREGROUND Then
                _GUICtrlListView_AddItem($hListView, "$DS_SETFOREGROUND",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$DS_SETFOREGROUND",0)
            EndIf
            If BitAND($WinStyle,$DS_CONTEXTHELP)=$DS_CONTEXTHELP Then
                _GUICtrlListView_AddItem($hListView, "$DS_CONTEXTHELP",1)
            Else
                _GUICtrlListView_AddItem($hListView, "$DS_CONTEXTHELP",0)
            EndIf
    Else
        MsgBox(16,"No existe la ventana","La ventana que ha puesto no existe.")
    EndIf
EndFunc
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hListView2
            Switch $iCode   ;esto lo hago para coger de la lista el item seleccionado. Se puede cambiar la selección del item con el teclado o el ratón, detecta cualquier cambio en los items.
                Case $LVN_ITEMCHANGED
                    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    $ItemSeleccionado=DllStructGetData($tInfo, "Index")
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $iIDFrom, $iCode, $hWndEdit
    $hWndEdit = GUICtrlGetHandle($Input_1)
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $ilParam
        Case $hWndEdit
            Switch $iCode
                Case $EN_SETFOCUS   ;si recibe el foco el control Input_1 entra aquí.
                    If $auxDarFocoEdit Then     ;esta variable es para realizar este código solamente 1 vez.
                        GUICtrlSetData($Input_1,"")     ;Borro el contenido del Input.
                        GUICtrlSetColor($Input_1,0)     ;Cambio el color del texto del Input a negro.
                        $auxDarFocoEdit=0
                    EndIf
            EndSwitch
        Case 0      ;cuando le doy a la tecla enter entra aquí.
            Switch ControlGetFocus($GUI)    ;miro la clase del objeto que contiene el foco.
                Case "Edit1"    ;si la clase es del Input_1 ejecuta el código de la función CodigoBoton1().
                    CodigoBoton1()
                Case "SysListView322"   ;si la clase es del objeto hListView2 ejecuta el código del button_2.
                    $hVentana=HWnd(_GUICtrlListView_GetItemText($hListView2,$ItemSeleccionado,1))
                    VerPropiedadesWin($hVentana)
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Avatar de Usuario
XPyro
Profesional del Autoit
Mensajes: 542
Registrado: 04 Mar 2007, 10:12
Ubicación: México
Contactar:

Re: Script para Ver las propiedades de una ventana

Mensaje por XPyro »

En un tiempo libre me pongo a revisarlo, se ve interesante chefito, gracias :smt006
Imagen
Avatar de Usuario
Ximorro
Profesional del Autoit
Mensajes: 1500
Registrado: 10 Jul 2009, 12:35
Ubicación: Castellón, España

Re: Script para Ver las propiedades de una ventana

Mensaje por Ximorro »

TEEEEEEEELA (iba a poner un taco, pero por si me banean...)

Como diría cierto "ilustre" personaje español: "En dos palabras: im presionante"

Qué currada, buen trabajo, sí señor.
"¿Y no será que en este mundo hay cada vez más gente y menos personas?". Mafalda (Quino)
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Re: Script para Ver las propiedades de una ventana

Mensaje por Chefito »

Jejejeje....gracias a los dos :smt002 .
Este script lo hice por culpa de Ximorro jajajaja :smt005 , auque al final no sirvió para el objetivo....pero bueno, ahí está.

Saludos.
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Avatar de Usuario
Ximorro
Profesional del Autoit
Mensajes: 1500
Registrado: 10 Jul 2009, 12:35
Ubicación: Castellón, España

Re: Script para Ver las propiedades de una ventana

Mensaje por Ximorro »

Bueno no me eches toda la culpa que estábamos liados con esto por "culpa" de jonny, ja, ja.

Pero eso no quiere decir que el programa sea inútil. Bien que me lo he guardado en la carpeta de utilidades AutoIt...

Por un lado la utilidad y por otro lo que se puede aprender de él, que cuando dijiste lo del programita para ver las propiedades de las ventanas me esperaba algo rápido con un resultado en un MsgBox o la consola, y cuando lo ejecuté me quedé flipao sólo de ver el GUI que habías preparado...

Pues eso, gracias por la utilidad.
"¿Y no será que en este mundo hay cada vez más gente y menos personas?". Mafalda (Quino)
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Re: Script para Ver las propiedades de una ventana

Mensaje por Chefito »

Ximorro escribió:Bueno no me eches toda la culpa que estábamos liados con esto por "culpa" de jonny, ja, ja.
Jajajaja.....bueno sí, le hecharemos parte de culpa a Jonny :smt005 .
Ximorro escribió:cuando dijiste lo del programita para ver las propiedades de las ventanas me esperaba algo rápido con un resultado en un MsgBox o la consola, y cuando lo ejecuté me quedé flipao sólo de ver el GUI que habías preparado...
Sí, eso era lo que inicialmente iba a hacer, pero me lie y decidí hacer una GUI decente y un script que se hacercase a un programa.
Ahhhh....me alegra de que te haya gustado.
Ximorro escribió:Pues eso, gracias por la utilidad.
A mandar :smt002 .

Saludos.
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Avatar de Usuario
XPyro
Profesional del Autoit
Mensajes: 542
Registrado: 04 Mar 2007, 10:12
Ubicación: México
Contactar:

Re: Script para Ver las propiedades de una ventana

Mensaje por XPyro »

Un gran Script chefito, lo e probado y con muy buenos resultados ademas de tener una GUI muy amigable :smt003
Imagen
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Re: Script para Ver las propiedades de una ventana

Mensaje por Chefito »

Gracias Xpyro. La verdad que el GUI se puede mejorar bastante....ya sabeis que yo no soy muy bueno en eso y no le presto mucha atención. Pero al final me quedó algo potable.
Espero sorprender con otro script que tenía a medio (tengo muchos a medio :smt005 ).

Saludos.
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Responder