Jump to content

VBRookie

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About VBRookie

  • Rank
    Newbie
  1. I got Alt-F working with Notepad, so the File Menu is dropped down, after changing the bottom of my original code like this: if getAppTask("Untitled - Notepad", task) then task.Activate task.SendWindowMessage WM_SYSKEYDOWN, VK_MENU, &h20380001 task.SendWindowMessage WM_SYSKEYDOWN, Asc("F"), &h20000001 task.SendWindowMessage WM_SYSCHAR, Asc("F"), &h20000001 task.SendWindowMessage WM_SYSKEYUP, Asc("F"), &hE0000001 task.SendWindowMessage WM_SYSKEYUP, VK_MENU, &hC0380001 task.SendWindowMessage WM_SYSKEYDOWN, VK_MENU, &h20380001 task.SendWindowMessage
  2. P.S.:I found an interesting forum thread athttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/821a5bd3-665c-414e-91c6-c9415dd67bacwhere the last post reads: Similar, the top post athttp://blogs.msdn.com/b/oldnewthing/archive/2005/05/30/423202.aspxsays: (The SendInput function goes to the active window.) That may be a reason why all my attempts failed:The receiving app perhaps knows or finds out that it's not active and therefore ignores Alt key sequences.However, I'm not sure whether this is the real reason because in the code of my original post above, " task.Activate" is c
  3. Thanks, justsomeguy, for your answers (BTW: cool Picture you have, the monitor white looks like eyes of a car like Lightning McQueen on the thumbnail). I'm afraid you're right that they didn't intend this way of control. I just thought since sending "normal" keypresses to non-active windows works (as demonstrated by my original code that sends letters "A" and "E" to the CMD window), sending ALT keys should be possible in a similar way. Unfortunately, it seems it's not possible :-( . Maybe for security reasons (which would be funny since you can do many kinds of other stuff with tasks such
  4. That appears to be identical to the line "task.SendWindowMessage WM_SYSKEYDOWN, Asc("E"), &h20000000" from my originally posted code. It seems to send a "normal" E instead of Alt-E. My code is ready to run, if you wish, you can copy&paste it into a .vbs file and run it by double-clicking (open a "Command Prompt" window first). Since documentation and practice seem to differ, it seems important to try out what really works. Unfortunately, I don't have admin rights and can't install a windows message logger that comes with some development IDEs - does anyone else perhaps have one and cou
  5. Hi justsomeguy, thanks for your reply. I tried to change the bottom of my code to the following:' this does not work:task.SendWindowMessage WM_SYSKEYDOWN, VK_MENU, &h20000000task.SendWindowMessage WM_KEYDOWN, Asc(" "), &h20000000task.SendWindowMessage WM_KEYUP, Asc(" "), &h20000000task.SendWindowMessage WM_KEYDOWN, Asc("E"), &h20000000task.SendWindowMessage WM_KEYUP, Asc("E"), &h20000000task.SendWindowMessage WM_KEYDOWN, Asc("S"), &h20000000task.SendWindowMessage WM_KEYUP, Asc("S"), &h20000000task.SendWindowMessage WM_SYSKEYUP, VK_MENU, 0 but it still didn't w
  6. P.S. - Motivation for my post above Here is why I want to be able to send Alt-Keys to applications whose windows are non-active: I'm using scripts to automate manual procedures involving several applications, e.g. for an automatic startup script at logon time.Using the latter, I can have a coffee break after login, and when I return, the most important applications have started, and within the applications, the most important sub-applications have been started (which in my case are started via Alt-Key combinations from the parent application), or some menu options of the applications are autom
  7. In a VBScript that's run standalone (e.g. via double-click on a .vbs file), I'm trying to send an ALT-key combination to a non-active window with a given title, e.g. "Command Prompt" (CMD).(In CMD, for example, sending Alt-Space Alt-E Alt-S should call up the menu entry for highlighting everything. But CMD is just a sample for a program without API that I want to control via key sends without making it the active window.) Abusing Word.Tasks, I succeeded in sending normal WM_CHAR messages to CMD via task.sendwindowmessage.However, sending WM_KEYDOWN or WM_SYSKEYDOWN, VK_MENU, WM_SYSKEYUP etc. m
×
×
  • Create New...