|
Thansk for your answer
The next control is a DatePickerWnd.
All controls have "TabStop" to TRUE.
If i press the TAB-Key on the control, then the focus steps on the (correct) next control.
But via WM_NEXTDLGCTL it steps 2 controls farer.
If i remove the WM_NEXTDLGCTL, the focus stays on the initial control.
And 2 WM_NEXTDLGCTL sets the focus indeed 4 controls farer
|
|
|
|
|
Probably that's how you've set up the "Tab Order" in design time?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
The Tab-Order is correct at designtime and during the execution of the application.
Pressing the Tab-Key navigates me correctly trough the view ...
thanks for help
|
|
|
|
|
Did you read the fine print on the MSDN page[^]? (The parameters - wParam, lParam and the Remarks section)
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yes, but i doesn't work for me
A PostMessage(WM_KEYDOWN,(WPARAM)VK_TAB); sets the focus to the previous control
but with silly sideeffects (insertion bar is still in the initial textbox and the new taped characters are inserted in the new textbox )
Thanks anyway
|
|
|
|
|
baerten wrote: A PostMessage(WM_KEYDOWN,(WPARAM)VK_TAB); sets the focus to the previous control
You told me that you read the documentation:
If wParam is zero, the next control receives the focus; otherwise, the previous control with the WS_TABSTOP style receives the focus.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: baerten wrote:
A PostMessage(WM_KEYDOWN,(WPARAM)VK_TAB); sets the focus to the previous control
You told me that you read the documentation:
If wParam is zero, the next control receives the focus; otherwise, the previous control with the WS_TABSTOP style receives the focus.
That was just for testing (in this case i use a WM_KEYDOWN and not a WM_NEXTDLGCTL )
|
|
|
|
|
baerten wrote: is not set on the next
control but is set on the second next control.
Try GetNextDlgTabItem(PrevWnd)->SetFocus() .
BTW read the docs carefully on WM_NEXTDLGCTL . It has some detail associated with it.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Yes, i already read the MSDN-Documentation.
I don't have a handle to the next control.
I call the WM_NEXTDLGCTL in a universal function, which sets only
the focus on the next control, wherever the control is placed.
In my case:
I hit the F2-Key on a certain textbox. A Dialog opens modal and shows a Grid.
The user selects a line and the Dialog places a string into the textbox (where the user hit's the F2-Key)
Then i post the WM_NEXTDLGCTL Message so that the next textbox is selected.
Thanks
|
|
|
|
|
baerten wrote: WM_NEXTDLGCTL in a universal function, which sets only
the focus on the next control, wherever the control is placed.
Well for testing purpose, I put this event call in a timer
void OnTimer( UINT Id )
{
PostMessage( WM_NEXTDLGCTL, FALSE, FALSE );
}
Works well for me, focus shifts properly around all controls in the dialog. Then I put it in a button event handler, after this the focus always moved to the Cancel button, guess why? So you need to watch out for such issues.
A wild guess! Are you posting WM_NEXTDLGCTL twice, since it's a post message you wouldn't know, a suggestion would be replace PostMessage with SendMessage (MSDN says don't) for testing purpose to find out where if at all a duplicate one is being posted, since it blocks. Don't forget to revert back to PostMessage .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Tuesday, June 24, 2008 8:00 AM
|
|
|
|
|
Hi. I am programming c++ with MFC on VS2005. I was wondering how you can make your application draw outside its own window.
There are softwares out there that allow a user to scribble anything on the computer screen over any applications that are running or the desktop. A couple of them are
ActivePen (http://www.kongda.com/products/activepen/default.asp),
VBDoodle (http://www.hopkinsprogramming.net/software/vbdoodle/gallery/)
Draw-On-Screen (http://downloads.zdnet.com/abstract.aspx?docid=352162)
My question is how would I replicate this behavior? Im new to visual c++, and although i have experimented with making my own version of paint, I was only able to draw inside the screen of my MFC application which was made using Edit view class as base class. Did not see any way to draw just anywhere on the screen outside the window.
It would be great if you could maybe name a few built in classes/methods that can do this, or provide me with a link to a known resource on this topic. Thank you.
|
|
|
|
|
If you are using MFC, you can use CWindowDC dc(0); to get a device conext to entire screen. Other wise use GetDC(0) to get the dc to entire screen.
Any drawing to the above dc's will come in screen at the specified locations.
|
|
|
|
|
On similar lines as the answer you received above you can get a dc for the desktop window HWND. The desktop window hwnd can be obtained by GetDesktopWindow API
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Thanks a lot jijo. The article you have linked me to is just what i needed.
|
|
|
|
|
garyofcourse wrote: Thanks a lot jijo.
Always Welcome!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi All,
We have quite about 30 clients connecting to about 200 servers on our WAN. Currently we are experiencing extremely slow connection establishment times, in the order of 15-20 seconds. However, a ping from a client to the same server responds in 1-2 seconds.
The client and server applications are based on WSASocket.
I have traced the client and server side applications to death and it seams that the delay is in the receiving of the FD_ACCEPT event. Once the event has been received and the connections established, all seems fine, but it takes an unusually long time for the event to be received (through WSAEnumNetworkEvents).
Are there any reasons for the connection establishment to take SOOOO long, while a ping goes through quite quickly ?
Thanks
OD
|
|
|
|
|
Sounds strange, maybe your routers do some traffic shaping or you hit a bottleneck in your network infrastructure. I would try to send more dummy data with the connection handshake (to see if that has a negative or positive impact), plus try another listening port number.
/M
|
|
|
|
|
I can't start the MDI application by dbclick a data file.
It reports that the file can't be found, and crashes.
I check the registry, and found:
open
|
|---command
| Default d:\myapp.exe /dde
|---ddeexec
Default [open("%1")]
I tried to change it as below:
open
|
|---command
Default d:\myapp.exe "%1"
the problem is solved, but when I open a data file the second time, the registry is restored automatically.
What's dde? How to make it correct?
|
|
|
|
|
HANDLE hToken;
if(!GetTokenByName(hToken,"EXPLORER.EXE"))
{
return FALSE;
}
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb= sizeof(STARTUPINFO);
si.lpDesktop = TEXT("winsta0\\default");
BOOL bResult = CreateProcessAsUser(hToken,"D:\\1.bat",NULL,NULL,NULL, FALSE,NORMAL_PRIORITY_CLASS,NULL,lpCurrentDir,&si,&pi);
I use CreateProcessAsUser run 1.bat attach a database to sql server 2000.
1.bat:
OSQL -E -Q "sp_attach_db @dbname = 'YDJC2', @filename1 = '%CD%\database 08-6-5\YDJC2_Data.MDF', @filename2 = '%CD%\database 08-6-5\YDJC2_Log.LDF'"
But, this database is read only attribute in sql server 2000, why?
I double click mouse button to run 1.bat is OK, database is read/write attribute in sql server 2000.
How to use CreateProcessAsUser to solve this problem?
|
|
|
|
|
Dear All,
I want to develop an application in VC++ as dll. Please tell me whether it is possible to access the dll from a C# GUI application. For example, I have 5 dll for five different application. In the C# GUI I have 5 buttons, clicking the button has to launch the application (dll) accordingly.
I dont know how to develop this kind of application and also dont know whether this is possible or not.
|
|
|
|
|
bhanu_8509 wrote: For example, I have 5 dll for five different application. In the C# GUI I have 5 buttons, clicking the button has to launch the application (dll) accordingly.
A dll is not an executable, so you can't "execute" a dll. Why don't you simply make 5 executables that you can start from C# ? I don't really understand why you want to use dll's. Or I misunderstood your question, and then some more information would be useful.
|
|
|
|
|
Please kindly refer my reply.
|
|
|
|
|
Do you wan to make your dlls on the c++ and use of them on the C#? yes
|
|
|
|
|
>>For example, I have 5 dll for five different application?
What kind of applications are these??
You can export functions from a dll and then on every button click, you can call any function inside any dll. So, it is possible for you to make five dll and make each dlls export 1 function which you will call depending on which button is clicked.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|