Hi there. Apologies if this is posted to the wrong forum - I couldn't find an API forum.
I've spent 18 hours trying to solve this one.
I am trying to send a keystroke to a running powerpoint presentation with SendMessage or Postmessage. But I can't get as far as the handle for the presentation.
As I understand it, you have to use FindWindow to get the application's handle and then FindWindowEx to get the sub-window's handle. The problem is that the line below ***FAIL*** returns 0, not a handle.
Relevant material / possible answers are given in these sites but in C-type languages and I just can't see how what I'm doing is making the code fail:
RE: hide cursor for kiosk application (powerpoint)
hide cursor for kiosk application (powerpoint) | keyongtech
Passing Event to Other Application..~ - CodeGuru Forums
As ever, all help gratefully received.
I've spent 18 hours trying to solve this one.
I am trying to send a keystroke to a running powerpoint presentation with SendMessage or Postmessage. But I can't get as far as the handle for the presentation.
VB.NET:
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindow( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, _
ByVal childAfter As Integer, _
ByVal lclassName As String, _
ByVal windowTitle As Integer) As IntPtr
End Function
Sub DoStuff
Dim intAppHWnd As New IntPtr(0)
Dim intSlideShowHWnd As New IntPtr(0)
'get the window handle to the powerpoint application '***RETURNS HANDLE***
intAppHWnd = FindWindow("PP12FrameClass", Nothing)
'get the handle to the slide show window '***FAIL***
intSlideShowHWnd = FindWindowEx(intAppHWnd, Nothing, "paneClassDC", Nothing)
End Sub
As I understand it, you have to use FindWindow to get the application's handle and then FindWindowEx to get the sub-window's handle. The problem is that the line below ***FAIL*** returns 0, not a handle.
Relevant material / possible answers are given in these sites but in C-type languages and I just can't see how what I'm doing is making the code fail:
RE: hide cursor for kiosk application (powerpoint)
hide cursor for kiosk application (powerpoint) | keyongtech
Passing Event to Other Application..~ - CodeGuru Forums
As ever, all help gratefully received.
Last edited: