RawInput to kawalek winapi (wprowadzony w xp) ktorym mozna
obslugiwac np piec myszy na raz i tez inne inputy
definice siedza pod koniec winuser.h a wywolania siedza
w user32.dll, jako ze nie mam jeszcze doswiadczenia
w linkowaniu dlli i jjestem zmeczony i nie chce mi sie
czytac tutoriali, moze ktos sie nudzi i podalby mi
przyklad z reki jak podlinkowac sie dynamicznie do tego
tak by moc odpalic np taki kod na poczatek:
define WM_INPUT 0x00FF
char mousemessage[256]; // this is the string we draw to the screen for the
first mouse
char mousemessage2[256]; // this is the string we draw to the screen for the
second mouse
char rawinputdevices[256]; // string with number of raw input devices
void InitRawInput() {
RAWINPUTDEVICE Rid[50]; // allocate storage for 50 device (not going
to need this many :) )
UINT nDevices;
PRAWINPUTDEVICELIST pRawInputDeviceList;
if (GetRawInputDeviceList(NULL, &nDevices, sizeof
(RAWINPUTDEVICELIST)) != 0) {
return ;
}
pRawInputDeviceList = (RAWINPUTDEVICELIST *)malloc(sizeof
(RAWINPUTDEVICELIST) * nDevices);
GetRawInputDeviceList(pRawInputDeviceList, &nDevices, sizeof
(RAWINPUTDEVICELIST));
// do the job...
wsprintf(rawinputdevices,"Number of raw input devices: %i\n\n",
nDevices);
// after the job, free the RAWINPUTDEVICELIST
free(pRawInputDeviceList);
Rid[0].usUsagePage = 0x01;
Rid[0].usUsage = 0x02;
Rid[0].dwFlags =0;// RIDEV_NOLEGACY; // adds HID mouse and also
ignores legacy mouse messages
Rid[0].hwndTarget = NULL;
if (RegisterRawInputDevices(Rid, 1, sizeof (Rid [0])) == FALSE) {
wsprintf(mousemessage,"RawInput init failed:\n");
//registration failed.
}
return ;
}
?????
TNX
--
Wysłano z serwisu Usenet w portalu Gazeta.pl ->
http://www.gazeta.pl/usenet/