|
Do you have the WS_TABSTOP and WS_GROUP styles in place correctly?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've been working non stop for too many time... but now I would promise you that they are in the right place.
all the controls except the CStatic's have the tabstop attribute and there is no control that has the group attribute selected...
I've done that on the pretranslatemessage, but of course I'd love to know what is going on...
Thank you for your feedback.
|
|
|
|
|
Joan Murt wrote: I've done that on the pretranslatemessage...
Done what?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
well I need to go from those buttons to the next window if I press VK_DOWN and from those buttons to the previous window if I press VK_UP... a couple of seconds and a pretranslatemessage and that's ok...
I don't like this solution, but at least it works...
Well what I've said before, if anybody know what can happen... I would love to be able to remove that code in the pretranslatemessage.
Thank you for your feedback...
|
|
|
|
|
Remove the PreTranslateMessage() customization and note the difference.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, I can see that without the pretranslatemessage costumization it don't work...
It is very strange.
|
|
|
|
|
That implies, then, that PreTranslateMessage() should not be considered as part of the problem set.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Are you sure the keyboard focus isn't in one of the edit controls?
Are you using PreTranslateMessage() in the dialog class or in derived control class(es)?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I've tested and checked it again... none of the controls has the GROUP attribute. And none of the static controls has the TABSTOP, all the other controls has the TABSTOP attribute.
|
|
|
|
|
I need to Send XML data to s target server over SSL but the target server requires me to use a PKCS#12 certificate which they have issued to me. However, the PKCS#12 file's password is an MD5 hash of a plaintext password. I can read the PKCS#12 file via code having encrypted the password ok, but I am having problems installing the certificate into the LOCAL_STORE as MMC will not install a PKCS#12 file with a MD5 hash as the password.
My question is: is it possible to use a PKCS#12 cert file from disk rather than from the LOCAL_STORE? If so how, as the setOption method of the IServerXMLHTTPRequest2 object requires the 2nd arg to be a LOCAL_STORE\... entry????
Any advice on this would be very welcome as it is begining to get me down!
|
|
|
|
|
How Can I open a Microsoft Word document in C++? I don't want to open it as text or RTF format. How can I open it in its word doc format? thanks in advance for your help.
|
|
|
|
|
Use ShellExecute() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello,
Hope it is not a stupid question but suppose I have an int i = 20031225 and I would like to parse it to get the 4 first figures (2003) and the last 2 figures (25), like the functions CStringT::Left and CStringT::Right.
is it possible to do it without too much coding and without converting into string?
Thnks.
|
|
|
|
|
Arris7 wrote: I would like to parse it to get the 4 first figures (2003)...
Divide by 10000.
Why are you against using an intermediary string?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dividing by 10000 is a very good idea.
And to get the latest 2 figures by doing i%100 works fine also.
Actually I use a huge amount of data and it takes too much time to process.
I also would like to get any numbers from the figure. for example I would like to extract 01 from 20030112. Is it doable?
|
|
|
|
|
Of course, you can do:
extraction = (i / 100) % 100;
but, as already stated by DavidCrow, this is better done using strings.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: but, as already stated by DavidCrow, this is better done using strings.
I never said one way was any better than the other. I was simply asking why he was adamantly against the string solution. It would take quite a bit of empirical testing to find which of the two methods was the "better" one. One might be faster, but the other could be more intuitive.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, I oversimplified. Using strings makes code more clear.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
thanks for the solution.
but why using string is better?
In my case I use a huge volume of data of int type and my data is fixed length.
data extracted with the solutions you provided me will be used for calculations. So converting to string + parsing data + reconverting again to int will probably be expensive in term of execution speed.
|
|
|
|
|
Arris7 wrote: So converting to string + parsing data + reconverting again to int will probably be expensive in term of execution speed
I don't know. Maybe it depends on what you are exactly doing...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I am using CMyBclass(for eg) derived from CButton Class from MFC and using DrawItem method for drawing own child controls.Except radiobuttons everthing is perfect till the time....but the thing is i am getting the controls drawn on a window perfectly....now i am getting the problem in handling that....i.e.I need to handle the radio button events ....CHECKED and UNCHECKED.....
....for that i need a Handle of Parent window...
I have options of GetParent() method...I am using like this....
CWnd *p =GetParent(); from where i am getting the handle of that....i want the functionality of radiobuttons to be in my derived class so i am doingn that....
Can Any one find the solution of controlling the radio button in derived class so that event handling can be done in that only....
This is what i am trying to get that handle//....
CWnd *pChild = NULL;
for (pChild=GetWindow(GW_CHILD); pChild; pChild=GetWindow(GW_HWNDNEXT))
{
if (pChild == pBtn)
{
((CRadioButtonEx *)pChild)->SetCheckStatus(false);
((CRadioButtonEx *)pChild)->Invalidate(TRUE);
}
}
Basically m derived class should able to handle the Events associated with the radio buttons....
Can any one know the solution....
Shailesh
|
|
|
|
|
Here is my code:
<br />
#define WINVER 0x0500<br />
#include <windows.h><br />
<br />
#define WM_MOUSEHOVER 0x02A1<br />
#define WM_NCMOUSEHOVER 0x02A0<br />
<br />
<br />
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpszCmdLine,int nCmdShow)<br />
{<br />
HWND hwnd; <br />
MSG msg; <br />
WNDCLASS wndclass; <br />
TCHAR* szAppName = TEXT("MOUSEHOVER"); <br />
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); <br />
wndclass.hCursor = LoadCursor(NULL,IDC_ARROW); <br />
wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION); <br />
wndclass.lpszClassName = szAppName; <br />
wndclass.cbClsExtra = 0; <br />
wndclass.cbWndExtra = 0; <br />
<br />
wndclass.lpszMenuName = NULL; <br />
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS ;<br />
wndclass.lpfnWndProc = WndProc; <br />
wndclass.hInstance = hInstance; <br />
<br />
if( !RegisterClass(&wndclass) ) <br />
return 0;<br />
hwnd = CreateWindow( <br />
szAppName, <br />
szAppName, <br />
WS_OVERLAPPEDWINDOW, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
NULL, <br />
NULL, <br />
hInstance, <br />
NULL <br />
);<br />
ShowWindow( hwnd,nCmdShow );<br />
UpdateWindow( hwnd );<br />
while( GetMessage(&msg,NULL,0,0) )<br />
{<br />
TranslateMessage(&msg); <br />
DispatchMessage(&msg);<br />
} <br />
return msg.wParam;<br />
}<br />
<br />
LRESULT CALLBACK MouseProc( int nCode, WPARAM wParam, LPARAM lParam )<br />
{<br />
switch( wParam )<br />
{<br />
case WM_MOUSEHOVER:<br />
MessageBox( ((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("mousehover hooked"), TEXT("mousehover"), MB_OK);<br />
break;<br />
case WM_NCMOUSEHOVER:<br />
MessageBox( ((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("ncmousehover hooked"), TEXT("ncmousehover"), MB_OK);<br />
case WM_LBUTTONDOWN:<br />
MessageBox(((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("lbuttondown hooked"), TEXT("lbuttondown"), MB_OK);<br />
break;<br />
}<br />
return CallNextHookEx(NULL, nCode, wParam, lParam);<br />
}<br />
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )<br />
{<br />
switch( message )<br />
{<br />
case WM_CREATE:<br />
{ <br />
SetWindowsHookEx(WH_MOUSE,MouseProc,<br />
((LPCREATESTRUCT)lParam)->hInstance,<br />
GetCurrentThreadId());<br />
return 0;<br />
}<br />
case WM_MOUSEMOVE:<br />
{<br />
TRACKMOUSEEVENT tme;<br />
tme.cbSize = sizeof(tme);<br />
tme.dwFlags = TME_HOVER;<br />
tme.dwHoverTime = 500;<br />
tme.hwndTrack = hwnd;<br />
<br />
TrackMouseEvent(&tme);<br />
<br />
return 0;<br />
}<br />
case WM_MOUSEHOVER:<br />
MessageBox(hwnd, TEXT("mousehover"), TEXT("mouseHover"), MB_OK);<br />
return 0;<br />
case WM_NCMOUSEHOVER:<br />
MessageBox(hwnd,TEXT("ncmouseHover"), TEXT("ncMouseHover"), MB_OK);<br />
return 0;<br />
case WM_LBUTTONDOWN:<br />
MessageBox(hwnd,TEXT("lbuttondown"), TEXT("lbuttondown"), MB_OK);<br />
return 0;<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
}<br />
return DefWindowProc( hwnd, message, wParam, lParam );<br />
}<br />
When the cursor hovers over the window for a period of time, only the message box with the content being "mousehover" pops up ,while the one called in the MouseProc does not.But WM_LBUTTONDOWN is hooked successfully.
Can any one explain why and tell me how to hook WM_MOUSEHOVER and WM_NCMOUSEHOVER?
Besides,when I use TME_HOVER and TME_NONCLIENT together, no message box pops up at all except those due to mouse clicks. Is it because WM_NCMOUSEMOVE is generated instead of WM_MOUSEMOVE,which leads to the failure of call to TrackMouseEvent? How can I use TME_HOVER and TME_NONCLIENT together?
Thank you
-- modified at 3:30 Tuesday 1st May, 2007
|
|
|
|
|
Please try to hook WH_GETMESSAGE.
Because WM_MOUSEHOVE is post to the message quene.
|
|
|
|
|
i am downloading a file from url. while downloading there is a firewall access that ask for grant access. when this comes my screen will be white (seems to be hanged but downloading is going on.) how to avoid the screen becoming white
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|