I have code that does exactly that. I think I sent it in to whomever was 
maintaining the
CarbonDeclareLibrary at the time.

Hope this helps,
~ Tomis

Note: kCarbon refers to a global constant whose value is "CarbonLib" for PEF 
and "Carbon" for
Mach-O

To set a window's click-through state:

Sub SetWindowClickThrough(Win as window, B as boolean)
#if TargetCarbon then
const attrib = 536870912
dim err as integer
Declare Function ChangeWindowAttributes Lib kCarbon (window as WindowPtr, 
setTheseAttributes as
Integer, clearTheseAttributes as Integer) as Integer
if b then
err = ChangeWindowAttributes(win, attrib, 0)
else
err = ChangeWindowAttributes(win, 0, attrib)
end
#endif
End Sub


Getting a window's click through requires two methods. Though you could of 
course roll them into
one. GetWindowAttributes is included in the CarbonDeclareLibrary module and so 
I left it separate.


Function GetWindowClickThrough(Win as window) As Boolean
#if TargetCarbon then
return (mid(GetWindowAttributes(win),6,1)="1")
#endif 
End Function


Function GetWindowAttributes(w as window) As String
#if TargetMacOS then
dim i,err as integer, m, s as memoryBlock
#if targetcarbon then
Declare Function GetAttrib Lib kCarbon Alias "GetWindowAttributes" (window as 
WindowPtr,
outAttributes as ptr) as Integer
#else
Declare Function GetAttrib Lib "WindowsLib" Alias "GetWindowAttributes" (window 
as WindowPtr,
outAttributes as ptr) as Integer
#endif
m = NewMemoryBlock(4)
s = NewMemoryBlock(32)
err = GetAttrib(w,m)

for i = 0 to m.size - 1
s.Byte(8 * i) = BitwiseAnd(m.Byte(i), &b00000001) + 48
s.Byte(8 * i + 1) = Min(BitwiseAnd(m.Byte(i), &b00000010), 1) + 48
s.Byte(8 * i + 2) = Min(BitwiseAnd(m.Byte(i), &b00000100), 1) + 48
s.Byte(8 * i + 3) = Min(BitwiseAnd(m.Byte(i), &b00001000), 1) + 48
s.Byte(8 * i + 4) = Min(BitwiseAnd(m.Byte(i), &b00010000), 1) + 48
s.Byte(8 * i + 5) = Min(BitwiseAnd(m.Byte(i), &b00100000), 1) + 48
s.Byte(8 * i + 6) = Min(BitwiseAnd(m.Byte(i), &b01000000), 1) + 48
s.Byte(8 * i + 7) = Min(BitwiseAnd(m.Byte(i), &b10000000), 1) + 48
next

return s.StringValue(0, s.Size)
#endif
End Function






> I have made a Global floating window that has a translucent image on it. 
> Now what I need is for the window to be transparent to mouse clicks. As
> in the mouse clicks go through the window to whatever is underneath. 
>Any ideas?
>
> Thanks,
> Chris

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to