Помогите пожалуйста
как можно получить classnameNN по handle
Google третий день использую``
нужно сохранить в ini фаиле
как можно получить classnameNN по handle
Google третий день использую``
нужно сохранить в ini фаиле
Код:
#include <WinAPI.au3>
#include <Misc.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Global $ConfigFile = @ScriptDir & "\File_config.ini"
Win_Info_Rfaem()
Func Save_Win($Window_Name,$ClassnameNN)
IniWrite($ConfigFile, "Settings", "Window_Name", $Window_Name)
IniWrite($ConfigFile, "Settings", "ClassnameNN", $ClassnameNN)
EndFunc
Func Win_Info_Rfaem()
Local $stPoint=DllStructCreate($tagPOINT),$aPos,$hControl,$hWin,$aLastPos[2]=[-1,-1],$sLastStr='',$sStr
Opt('TrayMenuMode', 1)
Opt('MustDeclareVars', 1)
Global $aGUI[4]
HotKeySet('{ESC}', '_Exit')
For $i = 0 To 3
$aGUI[$i] = GUICreate('', 0, 0, 0, 0, $WS_POPUP, _
BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
GUISetBkColor(0xFF0000, $aGUI[$i])
GUISetState(@SW_HIDE, $aGUI[$i])
Next
While Not _IsPressed('1B')
$aPos=MouseGetPos()
If $aPos[0]<>$aLastPos[0] Or $aPos[1]<>$aLastPos[1] Then
DllStructSetData($stPoint,1,$aPos[0])
DllStructSetData($stPoint,2,$aPos[1])
$hControl=_WinAPI_WindowFromPoint($stPoint)
$hWin=_WinAPI_GetAncestor($hControl,2)
;~ $sStr='Window at '&$aPos[0]&','&$aPos[1]&': "'&WinGetTitle($hWin)&'"'& @LF & '_WinAPI_GetWindow($hWin, $GW_CHILD) = ' & _WinAPI_GetWindow($hWin, $GW_CHILD) & @LF & WinGetHandle("[ACTIVE]")
$sStr = 'Window at '&$aPos[0]&','&$aPos[1]&': "'& WinGetTitle($hWin) &'"'& @LF & 'Child from point: ' & $hControl & ' (' & _WinAPI_GetClassName($hWin)& ')'
If $sLastStr<>$sStr Then
ToolTip($sStr,0,@DesktopHeight-50)
$sLastStr=$sStr
EndIf
$aLastPos=$aPos
EndIf
_DrawWindow($hControl)
If (_IsPressed("11") and _IsPressed('01')) Then ;????? ?????? ????
Save_Win( WinGetTitle($hWin) ,_WinAPI_GetClassName($hWin))
Return
While _IsPressed('01')
Sleep(10)
WEnd
_DrawWindowHide()
EndIf
Sleep(15)
WEnd
EndFunc
Func _DrawWindowHide()
For $i = 0 To 3
GUISetState(@SW_HIDE, $aGUI[$i])
Next
EndFunc ;==>_DrawWindowHide
Func _DrawWindow($hControl)
Local $hWin = $hControl, $aPos
$hWin = $hControl
;~ $hWin = WinGetHandle('[ACTIVE]')
ConsoleWrite("$hWin = " & $hWin & @LF)
If Not $hWin Then Return
$aPos = WinGetPos($hWin)
If @error Then Return
WinMove($aGUI[0], '', $aPos[0], $aPos[1], 3, $aPos[3])
WinMove($aGUI[1], '', $aPos[0], $aPos[1], $aPos[2], 3)
WinMove($aGUI[2], '', $aPos[0] + $aPos[2], $aPos[1], 3, $aPos[3])
WinMove($aGUI[3], '', $aPos[0], $aPos[1] + $aPos[3], $aPos[2] + 3, 3)
For $i = 0 To 3
GUISetState(@SW_SHOWNOACTIVATE, $aGUI[$i])
WinSetOnTop($aGUI[$i], '', 1)
Next
EndFunc ;==>_DrawWindow
Func _Exit()
Exit
EndFunc ;==>_Exit