Results 1 to 10 of 10

Thread: Ws_tabstop (Resolved)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    Question 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.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    Yeah, and I read that post. I don't see how having that style (as the quote states) would help anyway.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    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?

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    PHP Code:
    while(GetMessage(&msgNULL00))
    { if (
    == -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.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    All depends on your return values from your callback function, in my case this was valid. But I think, generally, you would want >=, not >.

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width