Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Aug 2011
    Posts
    30

    Keystroke DLL problem

    I never had problem with this DLL but now...

    I need to send this key combination Capslock + Q.

    My code is SendKeys("{CAPSLOCK}q") but it sends Capslock first and then Q key.

    Where I got wrong?

  2. #2
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    You should read better Sendkeys instructions:

    To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".
    To specify repeating keys, use the form {key number}. You must put a space between key and number. For example, {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means press H 10 times.
    Also consider that CapsLock is not a "modifier" key, so probably is Windows that does not take in count that the Capslock+Q are pressed together, not SendKeys.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  3. #3
    Join Date
    Aug 2011
    Posts
    30
    Ok Cybergraph it seems "no skills" is my problem!

    In my project I've a button that runs an application called Virio.exe

    After used it I want close Virio by CapsLock+Q combination.

    In Global I have:
    function SendKeys(sSendString)
    sSendString = "\"" ..sSendString.."\""
    result = DLL.CallFunction(_SourceFolder.. "\\AutoPlay\\Plugins\\KS.DLL", "KEYSTROKE", sSendString, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL)
    end
    Any suggestion for me?

    I can't Kill Virio.exe because tray bar icon causes problems.
    It need to be clòosed by CapsLock+Q or Ins+Q

    Thanks

  4. #4
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    Why you don't terminate the Virio.exe process using the Window.Close function?
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  5. #5
    Join Date
    Aug 2011
    Posts
    30
    Because Virio doesn't have a window.
    Virio is a customized version of NVDA Screen Reader.
    I used this code but It doesn't work

    -- Get the titles and window handles of all open windows.
    windows = Window.EnumerateTitles();

    -- A variable containing text in the title you want to search for.
    window_name = "virio";

    -- Loop through the table of windows.
    for handle, title in pairs(windows) do

    -- Check if the window title has the target text.
    result = String.Find(title, window_name, 1, false);

    -- if the string was found in the title, send the window a close message.
    if (result ~= -1) then
    Window.Close(handle, CLOSEWND_SENDMESSAGE);
    end
    end
    Please tell me the exact code for CapsLock+Q combination so I try.
    Yhanks for help

  6. #6
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    Use System.EnumerateProcesses and System.TerminateProcess instead.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  7. #7
    Join Date
    Aug 2011
    Posts
    30
    By using this_
    instances_of_file = 0;
    file_to_check_for = "virio.exe"; --have all lowercase
    processes = System.EnumerateProcesses();

    for j, file_path in pairs(processes) do
    file = String.SplitPath(file_path);
    if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
    System.TerminateProcess(j);
    end
    end
    the applicatio was killed but tray icon does not refresh, stayin visible but useless.

    I would try with the exact code using Keystrokes.dll

    Tell me the right code for CapsLock+Q Or Insert+Q Please.

  8. #8
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    Quote Originally Posted by AndrewX View Post
    Because Virio doesn't have a window.
    Virio is a customized version of NVDA Screen Reader.
    I used this code but It doesn't work
    If you read (and you must do) with attention the user instructions, you will note that:

    Arg3 - String of target window title (See Note1 and 2)
    Note2: In place of the window title you can use too the number returned by Shell function. Empty title (Quotation marks without text) sends keys to the active window.
    But Viria.exe has not a window, so the problem is still there.

    Also, the icon that does not refresh, is due to the fact that the just closed app has not focus and this will happen with ANY way you close the app.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  9. #9
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    Give a look to SendKeys.exe here: http://cpap.com.br/orlando/SendKeysM...IdC=OrlMoreWin

    With these codes {VK nn} and {VK_nn}, you can send any key or key combinations. Pressing a control button sending its {VK_nn} code, it will be pressed until its {VK nn} normal code is sent. For example, if you want to send the shortcut key composed by ‘Windows Button’ and the letter ‘R’, first send the ‘Windows Button’ key only downing, then the ‘R’ key, and finally the ‘Windows Button’ key normally to release it, like this: {VK_91}{VK 82}{VK 91}
    The problem of the non existing window continues to exist, but at least you have something to read...

    (why should I always search ... and find(!) solutions for others?)
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  10. #10
    Join Date
    Aug 2011
    Posts
    30
    No dear Cybergraph, I'm a newbie but I read, search and more.
    Sendkeys is a freeware and I can't redistribute it.
    So I decided to avoid It from mi little app.

    Then a doubt: Keystrokes.dll sends keystrokes only within the AMS app or externall app too.
    Do you confirm this?

  11. #11
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,415
    Quote Originally Posted by AndrewX View Post
    Sendkeys is a freeware and I can't redistribute it.
    How can you argue this? Is there a limitation in the license provided by the author? Have you asked the author?
    Keystrokes.dll is not the same (free)?

    Then a doubt: Keystrokes.dll sends keystrokes only within the AMS app or externall app too.
    Do you confirm this?
    Maybe in your searches you have not found this clear example that automates Notepad, so the answer is obvious.
    Attached Files
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  12. #12
    Join Date
    Aug 2011
    Posts
    30
    This is Sendkeys license
    As you can see I'm not allowed from author.

    You are right, I read without attention.
    But you don't want really help me.
    You want humiliate me.

    Ok follow me please:
    My brother is blind and I need this little app.
    He wants share it between his forum users
    I need a little window with only a button that sends Caps+Q to an external app called Virio.exe

    You say that it doesn't work (cause Windows) but I would try.

    Could you send me an .apz?

    Thank you

  13. #13
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    You are not allowed to redistribute it with your application. But it does not say that you are not allowed to use it in your application. So, the easiest way to solve this problem without infringing the license is make your application download the file, after asking the user for permission (and perhaps opening a browser window with the home page for a single time). Once downloaded, you know where it is (use HTTP.Download) and can start using it in your application, because it doesn't even require installation.

    Ulrich

  14. #14
    Join Date
    Aug 2011
    Posts
    30
    @Ulrich
    Thank you for suggestion, this method could be useful for more external components.

    @Cybergraph
    Thanks anyway for dedicated your time.

  15. #15
    Join Date
    May 2006
    Posts
    1,443
    Looks like that is a global hotkey
    using SendKeys might not work

    this function may help you to get it to work
    keybd_event()

    this function can be called from AMS via DLL.CallFunction()

    simply , you will simulate key strokes
    1. VK_CAPITAL is down
    2. VK_Q is down
    3. VK_Q is up
    4. VK_CAPITAL is up

Posting Permissions

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