01-12-2009, 09:27 AM
Function SetPropString
Function GetPropString
Function FindProp
Function FP_EnumProc
--------------------------------------------------------------
this is not needed for the above functions but may be useful somewhere else
Macro enum window props
Function Prop_EnumProc
;/
function hwnd $name $value
;Assigns a string property to the window. Or changes.
;Similar to SetProp, but SetProp assigns an integer property.
str s1.from(name "[1]*") s2
if(FindProp(hwnd s1 s2)) RemoveProp hwnd s2
s1.from(name "[1]" value)
SetProp hwnd s1 1Function GetPropString
;/
function! hwnd $name str&value
;Gets a string property assigned to the window using SetPropString.
;Similar to GetProp, but GetProp gets an integer property.
;Returns 1 if found, 0 if not.
;EXAMPLE
;int h=win("Notepad")
;SetPropString h "y" "asdfg"
;str s
;if(GetPropString(h "y" s))
,;out s
str s1.from(name "[1]*")
if(FindProp(hwnd s1 value))
,value.get(value findc(value 1)+1)
,ret 1Function FindProp
;/
function! hwnd $propw str&propFull
;Find a window property.
;In propw you specify window property name with wildcard characters, eg "ab=*".
;In propFull you receive full property name, eg "ab=cd"
;Returns 1 if found, 0 if not.
;Note: This function is not to be used with properties set by SetPropString. Use GetPropString instead.
;EXAMPLE
;int h=win("Notepad")
;SetProp h "x=qwerty" 71
;str s
;if(FindProp(h "x=*" s))
,;out s
,;out GetProp(h s)
type FINDPROPDATA $propw str*propFull
propFull.len=0
EnumPropsEx hwnd &FP_EnumProc &propw
ret propFull.len!0Function FP_EnumProc
;/
function# hwnd $lpszString hData FINDPROPDATA&x
if(lpszString<=0xffff) ret 1 ;;atom
;out lpszString
if(!matchw(lpszString x.propw 1)) ret 1
*x.propFull=lpszString--------------------------------------------------------------
this is not needed for the above functions but may be useful somewhere else
Macro enum window props
;shows what properties the window has
out
int h=win("Notepad")
EnumPropsEx h &Prop_EnumProc 0Function Prop_EnumProc
