Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multilanguage in VS 98. Pin
Blake Miller17-Feb-05 7:47
Blake Miller17-Feb-05 7:47 
GeneralSending Bmp in peer 2 peer app Pin
Identity Undisclosed16-Feb-05 22:28
Identity Undisclosed16-Feb-05 22:28 
GeneralRe: Sending Bmp in peer 2 peer app Pin
Mohammad A Gdeisat16-Feb-05 23:19
Mohammad A Gdeisat16-Feb-05 23:19 
GeneralRe: Sending Bmp in peer 2 peer app Pin
Identity Undisclosed17-Feb-05 2:37
Identity Undisclosed17-Feb-05 2:37 
GeneralRe: Sending Bmp in peer 2 peer app Pin
Identity Undisclosed17-Feb-05 3:08
Identity Undisclosed17-Feb-05 3:08 
GeneralRe: Sending Bmp in peer 2 peer app Pin
ThatsAlok16-Feb-05 23:32
ThatsAlok16-Feb-05 23:32 
GeneralRe: Sending Bmp in peer 2 peer app Pin
Identity Undisclosed17-Feb-05 2:53
Identity Undisclosed17-Feb-05 2:53 
QuestionHow can I hook Joystick? Pin
ekklesia16-Feb-05 22:18
ekklesia16-Feb-05 22:18 
Now trying to hook joystick.but it's not easy to me.

below is my source.

//------------------------------------------------------------------
// Set Hook
//------------------------------------------------------------------
BOOL SetHook( HWND hWnd )
{
g_HwndServer = hWnd ; // Set Hook Server

if(joySetCapture( g_HwndServer , JOYSTICKID1, 0, FALSE))
{
MessageBox(g_HwndServer, "Unable to capture the joystick",
NULL, MB_OK);

}

// set movement threshold
//.......................

{
UINT nThreshold;

joyGetThreshold(JOYSTICKID1, &nThreshold);

if (nThreshold < 100)
{
nThreshold = 100;
joySetThreshold(JOYSTICKID1, nThreshold);
}
}


g_Hook = SetWindowsHookEx( WH_GETMESSAGE , GetMessageProc, (HINSTANCE)g_Module , 0 ) ;



return false ;
}

//------------------------------------------------------------------
// Remove Hook
//------------------------------------------------------------------
BOOL RemoveHook()
{
joyReleaseCapture(JOYSTICKID1);
UnhookWindowsHookEx( g_Hook ) ;

return true ;
}

//--------------------------------------------------------------
// Hook Procedure - Keyboard
//--------------------------------------------------------------
LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{

LPMSG msg=(LPMSG)lParam;
if ((nCode >= 0) && PM_REMOVE == wParam &&
(msg->message == MM_JOY1MOVE
{
MessageBox( g_HwndServer, "Joistick",
NULL, MB_OK);
}

// We must pass the all messages on to CallNextHookEx.
return ::CallNextHookEx( g_Hook , nCode , wParam , lParam );
}

the problem is that though i don't move joystick this above code is

executed.

i hope you help me to solve this problem.

God bless you!



nice to meet u
AnswerRe: How can I hook Joystick? Pin
Alexander M.,17-Feb-05 3:54
Alexander M.,17-Feb-05 3:54 
Generalthanks very much Pin
ekklesia18-Feb-05 20:27
ekklesia18-Feb-05 20:27 
Generalcompile error in cdoex Pin
lavanm16-Feb-05 22:03
lavanm16-Feb-05 22:03 
QuestionHow do I add a DOCTYPE declaration in XML using MSXML in Visual C++? Pin
IronMike16-Feb-05 21:35
IronMike16-Feb-05 21:35 
Questionhow works IWebBrowser2.Navigate Pin
ThinkingPrometheus16-Feb-05 20:43
ThinkingPrometheus16-Feb-05 20:43 
AnswerRe: how works IWebBrowser2.Navigate Pin
ThinkingPrometheus16-Feb-05 23:49
ThinkingPrometheus16-Feb-05 23:49 
QuestionHow to get HINSTANCE from a int? Pin
rushing16-Feb-05 20:11
rushing16-Feb-05 20:11 
AnswerRe: How to get HINSTANCE from a int? Pin
ThatsAlok16-Feb-05 22:26
ThatsAlok16-Feb-05 22:26 
Questionhow to integrate my applicaiton with MS Word?? Pin
rjnl16-Feb-05 17:12
rjnl16-Feb-05 17:12 
AnswerRe: how to integrate my applicaiton with MS Word?? Pin
Branislav16-Feb-05 22:53
Branislav16-Feb-05 22:53 
AnswerRe: how to integrate my applicaiton with MS Word?? Pin
ThatsAlok17-Feb-05 1:28
ThatsAlok17-Feb-05 1:28 
GeneralPOP3 + SSL Pin
Trivex16-Feb-05 16:03
Trivex16-Feb-05 16:03 
GeneralRe: POP3 + SSL Pin
Ravi Bhavnani17-Feb-05 7:17
professionalRavi Bhavnani17-Feb-05 7:17 
GeneralLink Error Pin
rushing16-Feb-05 15:55
rushing16-Feb-05 15:55 
GeneralRe: Link Error Pin
rwestgraham16-Feb-05 16:55
rwestgraham16-Feb-05 16:55 
GeneralRe: Link Error Pin
ThatsAlok16-Feb-05 18:11
ThatsAlok16-Feb-05 18:11 
GeneralTBBUTTON : Setting Font Pin
tnguyen44416-Feb-05 11:51
tnguyen44416-Feb-05 11:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.