[python-win32] Have IHTMLWindow2 objectneed correspondingIHTMLWindow3 object and flash box
Richard Bell
rbell01824 at earthlink.net
Tue Jul 31 14:50:41 CEST 2007
Tim,
Did you really mean:
brush = win32ui.CreateBrush(1, 0, 0) # create a brush (hollow, no color)
since the win32gui brush will not select into the device context?
Which brings me to the real question:
What's the difference between win32ui and win32gui anyway and what's the
best online reference for them?
Regards,
Richard
BTW, here's the code as it now stands.
--- code ---
def flash( left, top, width, height ):
""" put a flashing box at cordinates """
gui_dc = win32gui.GetDC(0) # int handle of DC for
screen
pycdc = win32ui.CreateDCFromHandle(gui_dc) # PyCDC object
pycdc.SetROP2(7) # R2_XOR
brush = win32ui.CreateBrush(1, 0, 0) # create a brush (hollow, no
color)
pycdc.SelectObject(brush) # put it in the dc
pen = win32ui.CreatePen(0, 3, 0x00ff00) # create a pen (solid, 3
pels wide, color)
# colorref is 0x00bbggrr
pycdc.SelectObject(pen) # put it in the dc
adj = 0 # or 4
cord = (left, top,
left+width+adj, top + height+adj) # +1 for the way windows
draws rect
# +3 for pen width
for i in range(0,5): # 5 flashes
pycdc.Rectangle(cord) # make a solid rectangle
time.sleep(.250) # hang out
pycdc.Rectangle(cord) # put the screen back
time.sleep(.250) # hang out
win32gui.ReleaseDC(gui_dc,0) # is this all I have to
release?
--- end code ---
|
|Thanks again Tim, I'll make the change.
|
||Tim Roberts wrote:
||> ...
||> If you use the hollow brush, as I suggested, then the driver won't even
||> be ASKED to fill the interior.
||>
||> brush = win32ui.GetStockObject( 5 ) # HOLLOW_BRUSH
||>
||
||D'oh, did I really say win32ui? That's wrong.
||
|| brush = win32gui.GetStockObject( 5 ) # HOLLOW_BRUSH
||
||--
||Tim Roberts, timr at probo.com
||Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list