Findwindow

BlitzPlus Forums/BlitzPlus Programming/Findwindow

ghislain(Posted 2004) [#1]
Hi,
I'm trying to close a powerpoint presentation from within BlitzPlus. It seems quite easy using Findwindow and Sendmessage. My problem is that Findwindow requires both a classname and title/windowname. like:
hndl = findwindow ("PP11FrameClass", "Microsoft Powerpoint - [presentation1]" )

Now I would like blitz to close any powerpoint presentation without specifying a title/presentation. But:
hndl = findwindow ("PP11FrameClass", 0)

or
hndl = findwindow ("PP11FrameClass", "" )

returns 0 [no handle].
Does anyone know how to tackle this?


Difference(Posted 2004) [#2]
You are not passing a null value.
Use the decls below to do it.
.lib "user32.dll"
FindWindow%( class$,Text$ ):"FindWindowA"
FindWindowByClassname%( class$,thenull% ):"FindWindowA" 



ghislain(Posted 2004) [#3]
Excellent - it does the job!