Macro Prog

This is a discussion on Macro Prog within the Windows Programming forums, part of the Platform Specific Boards category; hi im trying to make a macro program. im trying to do it in notepad so when i press a ...

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    110

    Macro Prog

    hi im trying to make a macro program. im trying to do it in notepad so when i press a button in my program it outputs the string

    <newline begin macro x=f s=5 y=10>

    I just realize I could make this easyer if i just pressed a key while in notepad.

    so how do i listen to keystrokes from a certian window? so im in notebad and I press F4, how do I detect that with my macro program?

  2. #2
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    You should take a look at GetAsyncKeyState() or SetWindowsHookEx.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    110
    Nice and thnx! I used

    SHORT GetAsyncKeyState(

    int vKey
    );

    Hey, do you know how to tell if a window is on top? If you know the handel?
    Last edited by Coder87C; 07-23-2005 at 12:18 PM.

  4. #4
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    GetForegroundWindow() returns the handle of the current active window, so you could compare it's return value to the handle you have.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. need help with multi line macro usage
    By Cdigitproc1 in forum C Programming
    Replies: 9
    Last Post: 04-29-2005, 09:50 AM
  5. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21