CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2001
    Posts
    391

    Question SendNotifyMessage - Controlling another process?

    I'm trying to automate Acrobat Pro 7 with the SendNotifyMessage win32 api command from my C# app. I created a .net windows service which watches a folder for a specific file. With the correct file the service launches the acrobat process via Process.Start() then uses SendNotifyMessage to simulate keypresses to get to the correct menu option.

    The problem Im having is the SendNotifyMessage(hwnd_main,Win32.WM_COMMAND,0x19f3,0) infrequently works. At times the command is issued and the Enable Comment Save As dialog box appears as expected but other times its as if the command silently fails and nothing happens on the main window.

    Is there something i can do to get more of a consistency when sending messages to another process? Better win32 api commands to check out?

    I am using SendNotifyMessage because the resulting dialog box would normally not return control back to my app until it was closed down; this win32 function is async and so allows me continued control over the running process, and i also like the fact that i can specify a specific windows rather than relying on the current window with focus.

    Thanks.

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: SendNotifyMessage - Controlling another process?

    Have you checked if the acrobat software you are using supports OLE automation.

    I bumped into these references, not sure if you it concerns you, but worth investigating.

    http://www.adobeforums.com/cgi-bin/webx/.3bc330f9
    http://p2p.wrox.com/topic.asp?TOPIC_ID=40612

  3. #3
    Join Date
    Dec 2001
    Posts
    391

    Re: SendNotifyMessage - Controlling another process?

    It doesnt seem to support such capabilities for Enabling Commenting on a PDF from my Acrobat Pro 7.

  4. #4
    Join Date
    Mar 2001
    Posts
    2,529

    Re: SendNotifyMessage - Controlling another process?

    I think the problem you will find with the SendMessage() / SendNotifyMessage() is that Acrobat may change its dialogs over time...and perhaps you wont be able to find the correct window anymore.
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured