Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Best Way to send hotkeys to Window
Results 1 to 3 of 3

Thread: Best Way to send hotkeys to Window

  1. #1
    Member
    Join Date
    Oct 2012
    Location
    brazil
    Posts
    36

    Best Way to send hotkeys to Window

    Hello, i'm using my function to send hotkeys to window in tibia.

    i always send like this...

    Here f1.
    Code:
          PostMessage(TibiaHandle, WM_KEYDOWN, VK_F1, 0);
          PostMessage(TibiaHandle, WM_KEYUP, VK_F1, 0);
    here shift+f1
    Code:
          PostMessage(TibiaHandle, WM_KEYDOWN, VK_SHIFT, 0);
          PostMessage(TibiaHandle, WM_KEYDOWN, VK_F1, 0);
          PostMessage(TibiaHandle, WM_KEYUP, VK_SHIFT, 0);
          PostMessage(TibiaHandle, WM_KEYUP, VK_F1, 0);
    here ctrl+f1.
    Code:
          PostMessage(TibiaHandle, WM_KEYDOWN, VK_CONTROL, 0);
          PostMessage(TibiaHandle, WM_KEYDOWN, VK_F1, 0);
          PostMessage(TibiaHandle, WM_KEYUP, VK_CONTROL, 0);
          PostMessage(TibiaHandle, WM_KEYUP, VK_F1, 0);
    But i with this i can't send Ctrl+Q or CTRL+L

    How is the best way to send Ctrl+f2 and Ctrl+Q or shift...

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Posts
    689
    Use spy++ or similar software to check the messages actually sent when you press the keys and then you can repeat them programmatically

  3. #3
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    Quote Originally Posted by duuhleon View Post
    How is the best way to send Ctrl+f2 and Ctrl+Q or shift...
    You must pass correct parameters to PostMessage. For that, read microsoft's explanation on PostMessage function http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx. As Farsa said, Spy++ is a great tool to check whether you're using correct parameters or not.

Posting Permissions

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