Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
i have a class that its parent is CWND.
i wrote a function for WindowProc that in it, i have an if statement for message parameter.
the function works for WM_MOUSEMOVE, WM_LBUTTONDOWN and ... and i can get the message and do my action, but i have problem with WM_MOUSEWHEEL.
there is no message generated for this message and so i cant write my function for wheel.

i should add this words that, when i work with an Application, i have no problem and the WM_MOUSEWHEEL works properly, but in my usage, the class is in the ActiveX Control and it should be a window for this control.

thanks
Posted
Updated 29-Oct-13 2:55am
v3
Comments
Jochen Arndt 26-Oct-13 10:49am    
A WM_MOUSEDOWN message does not exist. If this is a typo you can edit your question using the 'Imüprove question' link.
[no name] 28-Oct-13 2:01am    
I didn't find anything like WM_MOUSEDOWN message. Use can use WM_LBUTTONDOWN message to capture for the clik event.
Moharram 29-Oct-13 8:55am    
i have problem with WM_MOUSEWHEEL
nv3 29-Oct-13 10:32am    
If you don't receive the WM_MOUSEWHEEL message in your window procedure the most likely cause is that a child control of your window receives the message and eats it. Consider the the WM_MOUSEWHEEL event is not sent to the window the is over, but to the window that has the input focus!

Well, According to your questions, I can't properly know what you want. So I've searched something about WM_MOUSEWHELL. See articles here.

http://msdn.microsoft.com/en-us/library/aa923539.aspx[^]
http://www.cplusplus.com/forum/windows/33960/[^]

If your usage is right and any other problem can remove your WM_MOUSEWHELL, use SPY++ installed on Visual Studio. You can find your window with "Log Messages" on toolbar and check only Mouse events. And you can active your window and do your mouse wheel process. When you can detect WM_MOUSEWHEEL event goes where...

I hope this will be of help to you.
 
Share this answer
 
Comments
Moharram 31-Oct-13 7:09am    
thanks to WuRunZhe and his guide on this page:

http://www.cplusplus.com/forum/windows/33960

i solved this problem by using SetFocus on WM_MOUSEMOVE. then the control can get the WM_MOUSEWHEEL.
C#
#include <stdio.h>
#include<string.h>

char f[10000];
char factorial[1010][10000];

void multiply(int k)
{
int cin,sum,i;
int len = strlen(f);
cin=0;
i=0;
while(i<len)
{
sum=cin+(f[i] - '0') * k;
f[i] = (sum % 10) + '0';
i++;
cin = sum/10;
}
while(cin>0)
{
f[i++] = (cin%10) + '0';
cin/=10;
}
f[i]='\0';
for(int j=0;j<i;j++)
factorial[k][j]=f[j];

factorial[k][i]='\0';
}
void fac()
{
int k;
strcpy(f,"1");
for(k=2;k<=1000;k++)
multiply(k);
}
void print(int n)
{
int i;
int len = strlen(factorial[n]);
printf("%d!\n",n);
for(i=len-1;i>=0;i--)
printf("%c",factorial[n][i]);
printf("\n");
}
int main()
{
int n;
factorial[0][0]='1';
factorial[1][0]='1';
fac();
while(scanf("%d",&n)==1){
print(n);
}
return 0;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900