Click here to Skip to main content
15,913,271 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalresource error Pin
rushing16-Feb-05 23:19
rushing16-Feb-05 23:19 
GeneralRe: resource error Pin
«_Superman_»17-Feb-05 2:28
professional«_Superman_»17-Feb-05 2:28 
GeneralRe: resource error Pin
rushing17-Feb-05 14:25
rushing17-Feb-05 14:25 
GeneralRe: resource error Pin
toxcct17-Feb-05 9:15
toxcct17-Feb-05 9:15 
GeneralRe: resource error Pin
rushing17-Feb-05 14:50
rushing17-Feb-05 14:50 
GeneralRe: resource error Pin
«_Superman_»17-Feb-05 20:26
professional«_Superman_»17-Feb-05 20:26 
GeneralMultilanguage in VS 98. Pin
nguyennp16-Feb-05 23:02
nguyennp16-Feb-05 23:02 
GeneralRe: Multilanguage in VS 98. Pin
Mohammad A Gdeisat16-Feb-05 23:09
Mohammad A Gdeisat16-Feb-05 23:09 
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 

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.