Article View: borland.public.cppbuilder.nativeapi
Article #2531RegisterRawInputDevices WM_INPUT ????
From: Jonathan Dumaresq
Date: Fri, 09 Feb 2007 22:42
Date: Fri, 09 Feb 2007 22:42
51 lines
2059 bytes
2059 bytes
hi all ,
I try to find a simple application that register a hid to get his raw data.
I have try this code, but i not receive the wm_input message:
HEADER
class TForm5 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm5(TComponent* Owner);
void WindowProc(TMessage &msg);
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_INPUT,TMessage,WindowProc);
END_MESSAGE_MAP(TForm)
};
CPP file
void __fastcall TForm5::Button1Click(TObject *Sender)
{
RAWINPUTDEVICE Rid;
Rid.usUsagePage = 0x01;
Rid.usUsage = 0x04;
Rid.dwFlags = 0; // adds joystick
Rid.hwndTarget = NULL;
if (RegisterRawInputDevices(&Rid, 1, sizeof(Rid)) == FALSE)
{
//registration failed. Call GetLastError for the cause of the error.
ShowMessage("error");
}
}
//---------------------------------------------------------------------------
void TForm5::WindowProc(TMessage &msg)
{
ShowMessage("WM_INPUT");
}
this is for a joystick device.
regards
Jonathan
Technical Details
Message-ID:
<45ccf77e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,326f860468e16051,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jonathan Dumaresq" <jdumaresq@cimeq.qc.ca_nospam> Newsgroups: borland.public.cppbuilder.nativeapi Subject: RegisterRawInputDevices WM_INPUT ???? Date: Fri, 9 Feb 2007 17:42:05 -0500 Lines: 54 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 205.237.245.110 Message-ID: <45ccf77e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1171060606 205.237.245.110 (9 Feb 2007 14:36:46 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail