Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with Batch Scripts and CreateProcess() Pin
neilsolent7-Oct-06 9:32
neilsolent7-Oct-06 9:32 
QuestionData types in Visual C++ Pin
Eikthrynir5-Oct-06 22:33
Eikthrynir5-Oct-06 22:33 
AnswerRe: Data types in Visual C++ Pin
Link20065-Oct-06 23:24
Link20065-Oct-06 23:24 
AnswerRe: Data types in Visual C++ Pin
toxcct6-Oct-06 0:00
toxcct6-Oct-06 0:00 
AnswerRe: Data types in Visual C++ Pin
Gary R. Wheeler6-Oct-06 3:04
Gary R. Wheeler6-Oct-06 3:04 
GeneralRe: Data types in Visual C++ Pin
Eikthrynir6-Oct-06 6:42
Eikthrynir6-Oct-06 6:42 
AnswerRe: Data types in Visual C++ Pin
Hamid_RT6-Oct-06 19:31
Hamid_RT6-Oct-06 19:31 
QuestionToo many WM_MOUSEWHEEL events issue Pin
Tnarol5-Oct-06 22:02
Tnarol5-Oct-06 22:02 
Hi,

My problem is that I sometimes receive dozens of WM_MOUSEWHEEL events for a single rotation step of the mouse wheel. Other events like WM_KEYDOWN don't have this problem, I received them only once for a pressed key.

Normally I'm using this event in a CDialog inherited class and everything's works ok but the context here is slightly different. This time I had to create my window with "CreateWindowEx" so there's no CDialog inheritance and therefore I need to have my own message loop and message processing function. Can you have a look at them below and tell me if you see an explanation for my problem ?

Thanks.

Message loop :

<br />
MSG	msg;	<br />
while (1)<br />
{<br />
  PeekMessage(&msg, hWND, NULL, NULL, PM_REMOVE);<br />
  TranslateMessage(&msg);<br />
  DispatchMessage(&msg);		<br />
  if (msg.message == WM_QUIT)<br />
  {<br />
     break;<br />
  }<br />
  Sleep(100);<br />
}<br />



Message processing function :

<br />
LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
	switch(message)<br />
	{<br />
		case WM_CREATE:<br />
			return 0;<br />
			break;<br />
<br />
		case WM_CLOSE:					// windows is closing<br />
			PostQuitMessage(0);<br />
			return 0;<br />
			break;<br />
<br />
		case WM_DESTROY:<br />
			PostQuitMessage(0);<br />
			return 0;<br />
			break;<br />
<br />
		case WM_KEYDOWN:<br />
			ProcessKeyStroke(MapVirtualKey(((UINT)lParam & 0x00ff0000) >> 16,1));<br />
			break;<br />
<br />
		case WM_MOUSEWHEEL:<br />
			{<br />
                        short zDelta = GET_WHEEL_DELTA_WPARAM(wParam);<br />
                        ProcessMouseWheel(zDelta);<br />
			}<br />
			break;<br />
<br />
		default:<br />
			return (DefWindowProc(hwnd, message, wParam, lParam));<br />
			break;<br />
	}<br />
<br />
	return 0;<br />
}<br />
<br />

QuestionFtpCommand not defined in Visual Studio Pin
codepanter5-Oct-06 21:51
codepanter5-Oct-06 21:51 
AnswerRe: FtpCommand not defined in Visual Studio Pin
benjymous5-Oct-06 21:59
benjymous5-Oct-06 21:59 
GeneralRe: FtpCommand not defined in Visual Studio Pin
codepanter6-Oct-06 0:51
codepanter6-Oct-06 0:51 
GeneralRe: FtpCommand not defined in Visual Studio Pin
David Crow6-Oct-06 2:43
David Crow6-Oct-06 2:43 
AnswerRe: FtpCommand not defined in Visual Studio Pin
Hamid_RT5-Oct-06 22:04
Hamid_RT5-Oct-06 22:04 
QuestionTo compare two Images to find out the mismatch between them Pin
Dinu_IP5-Oct-06 21:33
Dinu_IP5-Oct-06 21:33 
AnswerRe: To compare two Images to find out the mismatch between them Pin
Sarath C5-Oct-06 22:02
Sarath C5-Oct-06 22:02 
AnswerRe: To compare two Images to find out the mismatch between them Pin
Hamid_RT6-Oct-06 8:30
Hamid_RT6-Oct-06 8:30 
Questioncolor the text of radio button Pin
vasmvr5-Oct-06 21:06
vasmvr5-Oct-06 21:06 
AnswerRe: color the text of radio button Pin
prasad_som5-Oct-06 21:18
prasad_som5-Oct-06 21:18 
AnswerRe: color the text of radio button Pin
Hamid_RT5-Oct-06 21:26
Hamid_RT5-Oct-06 21:26 
GeneralRe: color the text of radio button Pin
vasmvr5-Oct-06 23:09
vasmvr5-Oct-06 23:09 
GeneralRe: color the text of radio button Pin
Hamid_RT6-Oct-06 8:30
Hamid_RT6-Oct-06 8:30 
QuestionA Question about playing sound Pin
minihotto5-Oct-06 21:01
minihotto5-Oct-06 21:01 
AnswerRe: A Question about playing sound Pin
Hamid_RT5-Oct-06 21:12
Hamid_RT5-Oct-06 21:12 
GeneralRe: A Question about playing sound [modified] Pin
minihotto9-Oct-06 6:08
minihotto9-Oct-06 6:08 
GeneralRe: A Question about playing sound Pin
Hamid_RT9-Oct-06 6:51
Hamid_RT9-Oct-06 6: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.