Announcement

Collapse
No announcement yet.

Sending ALT-N to top level window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    jcfuller
    Member

  • jcfuller
    replied
    According to Jeffery Richter and Jonathan Locke in their Book Windows 95 A Developers Guide
    The only fool-proof method of sending keystrokes is to use the Journal PlayBack Hook.

    James


    ------------------

    Leave a comment:

  • Gregery D Engle
    Member

  • Gregery D Engle
    replied
    Michael,

    I mean a silent install. I have 80 computers to upgrade in a
    few hours. Much easier to simply put something in the login
    script.

    ------------------
    -Greg

    Leave a comment:

  • Michael Mattias
    Member

  • Michael Mattias
    replied
    Um, wouldn't "broadcasting" a keystroke assume that all Top-level windows are currently in a state such that they are even looking for that key?

    I can personally assure you that I have an application I have written which does NOT look for alt-n on any screen.

    In your case - a "remote install - I think a couple copies of PC Anywhere at about $150.00 per out to handle the remoteness a lot quicker and less expensively than trying to find a code solution...

    MCM



    [This message has been edited by Michael Mattias (edited July 27, 2001).]

    Leave a comment:

  • Semen Matusovski
    Member

  • Semen Matusovski
    replied
    There is a magic Keybd_Event (for roreground window).
    But better to start Spy++ and to look WM_COMMAND.

    ------------------
    E-MAIL: [email protected]

    Leave a comment:

  • Eric Pearson
    Member

  • Eric Pearson
    replied
    Sven --

    That might work too, but it would be limited to English versions of Windows.

    Hmmm... On the other hand, so would Alt-N, probably.

    -- Eric

    ------------------
    Perfect Sync Development Tools
    Perfect Sync Web Site
    Contact Us: mailto:[email protected][email protected]</A>

    Leave a comment:

  • Sven Blumenstein
    Member

  • Sven Blumenstein
    replied
    Originally posted by Gregery D Engle:
    Michael,

    That's pretty basic but I wanted to know how to send it to the
    top level window or all windows. I've tried this:

    SendMessage %HWND_BROADCAST, %WM_CHAR, 78, 29

    Doesnt work. Basically I'm wanting to simulate a remote
    installation of a setup program and it prompts for a user to
    press next and that is the only prompt. so I need to simulate
    ALT-N on the top level window.

    What's about
    hwnd = FindWindow(windowclass, windowcaption)
    hwnd = FindWindowEx(hwnd, 0, "Button", "&Next"

    SendMessage hWnd, BM_CLICK, 0, 0

    ------------------
    E-Mail (home): mailto:[email protected][email protected]</A>
    E-Mail (work): mailto:[email protected][email protected]</A>

    Leave a comment:

  • Eric Pearson
    Member

  • Eric Pearson
    replied
    Greg --

    As far as I know, it's not possible (or even a good idea ) to "broadcast" a keystroke to multiple windows in one step.

    Have you looked at the keybd_event API? That is the most reliable way to send a keystroke to the window that has the foreground because it is independent of the target app. It will work for GUI-style apps, console apps, DOS apps...

    For a complete example search the BBS for keybd_event.

    -- Eric


    ------------------
    Perfect Sync Development Tools
    Perfect Sync Web Site
    Contact Us: mailto:[email protected][email protected]</A>

    [This message has been edited by Eric Pearson (edited July 27, 2001).]

    Leave a comment:

  • Gregery D Engle
    Member

  • Gregery D Engle
    replied
    Michael,

    That's pretty basic but I wanted to know how to send it to the
    top level window or all windows. I've tried this:

    SendMessage %HWND_BROADCAST, %WM_CHAR, 78, 29

    Doesnt work. Basically I'm wanting to simulate a remote
    installation of a setup program and it prompts for a user to
    press next and that is the only prompt. so I need to simulate
    ALT-N on the top level window.



    ------------------
    -Greg

    Leave a comment:

  • Michael Mattias
    Member

  • Michael Mattias
    replied
    SendMessage hWnd, %WM_CHAR, wparam, lparam

    MCM

    Leave a comment:

  • Gregery D Engle
    Member

  • Gregery D Engle
    started a topic Sending ALT-N to top level window

    Sending ALT-N to top level window

    How can I send ALT-N to current window?

    Thanks

    ------------------
    -Greg
Working...
X