Findwindow?

suresh_ed

Active member
Joined
May 19, 2008
Messages
27
Programming Experience
1-3
I am opening a PDF file in Acrobat then am sending the Menu keys using sendkeys.
AcroHandle gets the value but the send keys always working with my .Net IDE. It is opening the .Net IDE file open menu. It supposed to open Acrobat File open.

Please find the code which i am using.

VB.NET:
AcroXAVDoc.Open(FileName, "Acrobat")
AcroHandle = FindWindow(vbNullString, "Acrobat - Adobe Acrobat Professional")
        If (AcroHandle <> 0) Then            
            SetForegroundWindow(AcroHandle)
            System.Windows.Forms.SendKeys.SendWait("%(FO)")
        End If
 
Perhaps you have to wait a just a little while between setting foreground window, to allow the window to become active, and the sending of keys to the active window ? try
VB.NET:
Thread.Sleep(250)
There may also be a shortcut key for direct call to that menu item instead of the access keys, for example Ctrl+O.

By the way, you can also use the AppActivate function in VB. AppActivate Function
 
Back
Top