|
Eugene Pustovoyt wrote:
Yes, dialog has the focus. By press arrow button has effect in the last focused window (for example - CListBox).
Then, the dialog does not have the focus. How is this window being shown, is it a modeless dialog ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No, it's modal dialog
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Then how can you be pressing tab to move the focus into the dialog ? Or did I misunderstand you ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You're misunderstand me. When I press TAB then focus jump by all controls of the MODAL dialog and to my control (OnSetFocus method) too. Therefore I think a dialog do process WM_KEYDOWN message, but this message isn't arrive at my CWnd-derived class.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Oh - is your CWnd derived class a control on the dialog ? If that's the case, then the fact you need to press tab proves that your control does not have focus, and therefore does not get any keyboard messages.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, my CWnd-derived class is a control on the dialog.
And how can set focus if SetFocus() method has not effect or how can I get WM_KEYDOWN message??
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
To get the message, you need the focus. Can't you set your control to be the one that recieves initial focus in the dialog editor ? Perhaps making it top of the tab order will do this ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In my OnSetFocus() handler I call CWnd::OnSetFocus(pOldWnd) and just SetFocus(), but it has not effect to getting WM_KEYDOWN message. How another I can set a focus?
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Which OnSetFocus handler ? YOu're saying you call OnSetFocus in the dialog, and the handler in your control calls it as well, as it's a composite control ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Probably it because my bad English.
Start from begin step by step:
1. I wrote a Cwnd-derived control which must to get a WM_KEYDOWN
2. I'm put his to MODAL DEMO DIALOG
3. If I press TAB in my demo then I see as a focus jump from the control to the control. Focus also jump into WM_SETFOCUS handler of the my control CMyControl::OnSetFocus()
4. In the WM_SETFOCUS handler of the my control I call CWnd::OnSetFocus() or SetFocus() but it has not effect to getting a WM_KEYDOWN message. I can't get this message neither in the WM_KEYDOWN handler of the CMyControl nor in the CMyControl::PreTranslateMessage.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Now what - dialog of CWnd??
With dialogs you'll never get this msg since always a child wnd has the focus.
Dig into PreTranslateMessage() instead.
----------------------
~hamster1
|
|
|
|
|
I'm understand, but how can I set a focus, if SetFocus() method has not effect.
In the PreTranslateMessage() method I don't retrive a WM_KEYDOWN message too.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Hello,
For some reason my dialog boxes that have radio buttons in them don't show the "underscore" portion of the name unless the user hits the "Alt" key. So if I have a radio button with the word "&Hello" as its caption it doesn't put an underscore the 'H' as it should.
Any clues as to why this is happening?
Thank you,
Al
|
|
|
|
|
there's a display property ( display control panel, in the appearance section ) that regulates the display or not of the underscore.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thank you Maximilien, but I'm unfamiliar with this property. Is it a property of the Radio Button, the Dialog Box, or withing Visual C++ itself?
Any help is greatly appreciated.
Thanks,
Al
|
|
|
|
|
It's a property which controls all radio buttons, irrelevant of which toolkit you use. If this property is set to true, the underscores will only show up whenever the user presses ALT. This property also controls the underscores in menus.
Good music: In my rosary[^]
|
|
|
|
|
I should also add that this is a MFC project and I'm using Visual C++.
Thanks,
Al
|
|
|
|
|
Thank you. I figured out you meant within the acutal display property of the OS not Visual Studio. It works now.
|
|
|
|
|
Hello !
I'm a newbie and I hope to get help from here.
I must send a file from a specific location on my pc to a switch. The switch has an TFTP-Server, so the upload works with the dos-tool
> tftp 172.16.0.2 put file.csv config.csv
Now I have to do the same from my program, but i must have the possibility to check if the upload worked fine. So shellExecute is not well. Or if the state of the upload could be checked, i have to know.
How can i do that ?
With WinInet it does not work, because the protocol and port is not available
It is possible by winsock ? The examples just show how to send data to a console and not how to send files....
Thanks for help
|
|
|
|
|
schaf13 wrote:
It is possible by winsock ? The examples just show how to send data to a console and not how to send files....
You will have to implement the TFTP protcol yourself, or find/buy a function/class library.
Good music: In my rosary[^]
|
|
|
|
|
Jorgen is right. Do a search on "Rfc 1350". It is a document on the protocol. Get familiar with that then do a search for "tftp.c" and/or "tftp.h" for a code sample. There is also a sample function called tftp_print .
There should be enough samples out there and once you have an understanding of the protocol, to make your own version of a client or server. I've implemented my own version as a TFTP server. I had an embedded device (client) connect to my computer (server) and it requested a file. I sent it the file receiving status messages as it progressed. Thus, I only processed the RDRQ (read request) and not the write but also handled the OACK to display a status in the program as it progressed and when it was complete.
|
|
|
|
|
Hello!
I'm currently writing a Windows service that should upload each day some files to some webserver. I decided to use a Windows service, so it can use the network functions also when no user is logged in (workstation locked).
Now I got a problem: for the uploading, I need to call an external program (WinSCP, I need to upload the files using the SCP protocol). A command-line version of WinSCP is available, that's not the problem. The problem is that WinSCP doesn't have the required rights to access the network!
Is there any way to execute the WinSCP executable so that it has the same rights as the Windows service? It must be able to access the network while the workstation is locked, and to my knowledge only Windows services are permitted to do so...
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
No. It's logging in under the local system account... Does that matter?
If I would set it to Network Service, would the other executed application inherit the rights of the service?
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
From the MSDN docs:
Using the Local System Account
The local system account does not require a password, does not have network access rights in Windows NT 4.0 and Windows 2000, and restricts your SQL Server installation from interacting with other servers.
Good music: In my rosary[^]
-- modified at 17:00 Monday 29th August, 2005
|
|
|
|