|
-
Jul 15th, 2003, 08:42 AM
#1
Thread Starter
Hyperactive Member
Ws_tabstop (Resolved)
I've searched the forums once around to no find no clear answer, so...
What's the deal with this stupid style? I can't seem to get it to work at all. Does it just set the window up accept WM_NEXTDLGCTL messages?
The WS_TABSTOP Style
The WS_TABSTOP style specifies the controls to which the user can move by pressing the TAB key or SHIFT+TAB keys.
When the user presses TAB or SHIFT+TAB, the system first determines whether these keys are processed by the control that currently has the input focus. It sends the control a WM_GETDLGCODE message, and if the control returns DLGC_WANTTAB, the system passes the keys to the control. Otherwise, the system uses the GetNextDlgTabItem function to locate the next control that is visible, not disabled, and that has the WS_TABSTOP style. The search starts with the control currently having the input focus and proceeds in the order in which the controls were createdthat is, the order in which they are defined in the dialog box template. When the system locates a control having the required characteristics, the system moves the input focus to it.
If the search for the next control with the WS_TABSTOP style encounters a window with the WS_EX_CONTROLPARENT style, the system recursively searches the window's children.
An application can also use GetNextDlgTabItem to locate controls having the WS_TABSTOP style. The function retrieves the window handle of the next or previous control having the WS_TABSTOP style without moving the input focus.
Source: MSDN.
If anyone has any code they would like to show, please, be my guest.
Last edited by Phobic; Jul 23rd, 2003 at 10:17 PM.
-
Jul 15th, 2003, 01:51 PM
#2
Does your parent window have the WS_EX_CONTROLPARENT style?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 15th, 2003, 04:07 PM
#3
Thread Starter
Hyperactive Member
Yeah, and I read that post. I don't see how having that style (as the quote states) would help anyway.
-
Jul 16th, 2003, 01:09 AM
#4
It tells DefWindowProc to handle the tab key so that the control switching works.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 16th, 2003, 11:10 AM
#5
Thread Starter
Hyperactive Member
Okay, so define "works," Because nothing happens when I hit tab. It's my understanding that setting WS_TABSTOP would automatically set up tabbing between controls on a window, but perhaps I'm wrong. I think what this flag really does is allow GetNextDlgTabItem and other similar functions find it, but you have to implement these functions within DefWindowProc when the message is received. Agreed? Anyone have any examples?
-
Jul 16th, 2003, 02:13 PM
#6
I don't agree. I got it to work once (without implementing anything). But I don't have the code anymore.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 23rd, 2003, 10:17 PM
#7
Thread Starter
Hyperactive Member
PHP Code:
while(i = GetMessage(&msg, NULL, 0, 0))
{ if (i == -1) break; //Program asked to terminate, get out of loop
if(!IsDialogMessage(hwnd,&msg)) //Allows tabstops to be processed
{ TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
A source I found said to check the IsWindow function with the IsDialogMessage function to make sure that the window still exists. Also, if you want to use alt commands in labels (static class) to trigger textboxes (edit class), just make the caption like "&Snoogans" (where ALT+S would be the trigger) and create the label directly before the textbox.
-
Jul 24th, 2003, 01:52 AM
#8
Why not simply
while(GetMessage(...) > 0)
and forget about the i variable?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 24th, 2003, 08:18 AM
#9
Thread Starter
Hyperactive Member
All depends on your return values from your callback function, in my case this was valid. But I think, generally, you would want >=, not >.
-
Jul 25th, 2003, 05:04 AM
#10
Huh? No, it does not. The return value of GetMessage is coded like this:
> 0 -> ok
= 0 -> ok, but WM_QUIT was received
< 0 -> error
Therefore we want >, not >=.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|