To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Article :: Building Dynamic Systems with Expressions in .NET
How Is XML Like An Interface?
Understanding Covariance and Contravariance
Print VS 2010 Keyboard Shortcut References in Letter (8.5x11in) and A4 (210×297mm) Sizes
Updated Productivity Power Tools



Go Back   VBForums > Other Languages > Assembly

Reply Post New Thread
 
Thread Tools Display Modes
Old Dec 6th, 2004, 11:03 PM   #1
Jacob Roman
Banned
 
Jacob Roman's Avatar
 
Join Date: Aug 04
Location: Cocoa Beach, FL Chit Chat Posts: 500+
Posts: 4,371
Jacob Roman is a jewel in the rough (200+)Jacob Roman is a jewel in the rough (200+)Jacob Roman is a jewel in the rough (200+)
Mimicing Keyboard events using _asm in C++

I'm wanting to work with a low level function in C++ that mimics keyboard strokes without the user pressing the keyboard to any active, or possible inactive windows. I don't know much on Assembly, but I have the function set up to use later on for a DLL file once I have the code:

Code:
int _stdcall Send_Keys(unsigned char Key, int *hWnd)
{
     //hWnd is a handle to a Window.

     _asm{

          //assembly source code here

     }

     return 1;
}
Can anyone help me out?
Jacob Roman is offline   Reply With Quote
Old Dec 7th, 2004, 09:22 PM   #2
Maven
Hyperactive Member
 
Maven's Avatar
 
Join Date: Feb 03
Location: Greeneville, TN
Posts: 274
Maven is on a distinguished road (20+)
Re: Mimicing Keyboard events using _asm in C++

Quote:
Originally Posted by Jacob Roman
I'm wanting to work with a low level function in C++ that mimics keyboard strokes without the user pressing the keyboard to any active, or possible inactive windows. I don't know much on Assembly, but I have the function set up to use later on for a DLL file once I have the code:

Code:
int _stdcall Send_Keys(unsigned char Key, int *hWnd)
{
     //hWnd is a handle to a Window.

     _asm{

          //assembly source code here

     }

     return 1;
}
Can anyone help me out?

You'll have to use the windows API to do that and there will not be much gain even if you do it in asm.
__________________
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

My little blog: http://vblore.blogspot.com/
Maven is offline   Reply With Quote
Old Dec 7th, 2004, 10:20 PM   #3
Jacob Roman
Banned
 
Jacob Roman's Avatar
 
Join Date: Aug 04
Location: Cocoa Beach, FL Chit Chat Posts: 500+
Posts: 4,371
Jacob Roman is a jewel in the rough (200+)Jacob Roman is a jewel in the rough (200+)Jacob Roman is a jewel in the rough (200+)
Re: Mimicing Keyboard events using _asm in C++

That's the thing though. The API's such as SendInput and keybd_event doesn't control programs that use DirectX's DirectInput.
Jacob Roman is offline   Reply With Quote
Old Dec 8th, 2004, 11:38 AM   #4
Maven
Hyperactive Member
 
Maven's Avatar
 
Join Date: Feb 03
Location: Greeneville, TN
Posts: 274
Maven is on a distinguished road (20+)
Re: Mimicing Keyboard events using _asm in C++

The problem is that you cannot generate interrupts from ASM when your programming in 32 bit protected mode. That pretty much means we are forced to do things the windows way.

I'm thinking that direct input must read from the device driver directly. So you'll have to search msdn to figure out how to deal with that situation. You may end up having to have a device driver.
__________________
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

My little blog: http://vblore.blogspot.com/
Maven is offline   Reply With Quote
Reply

Go Back   VBForums > Other Languages > Assembly


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:51 PM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.