Thread: Tab key stuff. C+WinAPI is killing me. Please help.

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    42

    Tab key stuff. C+WinAPI is killing me. Please help.

    Itīs frustrating :\ Iīm working on my first win32 app for about a month and iīm at the point of exporting results to xml files and stuff, the app is almost finished except that i canīt make one basic (and stupid) thing work.

    The TAB key Yeah, i know itīs lame and believe me, it is very ashaming to go public and ask help on this

    My app is written in pure C and WinAPI, using DEV-C++. It has only one window and no resource file: all the controls (2 groups, 3 static txt labels, 7 checkboxes, 7 edit fileds and 6 buttons) are created inside "case WM_CREATE" switch. The ones i wish i could access through the tab key got the WS_TABSTOP style. My app compiles through GCC 3.2 (mingw32 2.0) with absolutely no errors nor warnings and everything works on it, except the tab key. Nothing happens when i press it.

    I canīt post the entire code here, that would be a lot of lines for you to read, but maybe you can tell me what would be the most probable causes for this lame issue.

    Thanks in advance

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Usually i see the question, "how do I make a tab character?" when I see a thread asking about tabs. This is kind of nice

    It sounds as if it should work. The only thing I can think of without seeing the code for at least one of the controls is that the control's parent window is not being set properly. In otherwords you are probably setting it to NULL instead of your window. It would be a lot of help if you post the code for just one of the controls.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    42
    Thanks for the answer master5001, here are 2 of the controls:

    Code:
     hwndCheckServerGATEWAY = CreateWindow (TEXT("button"), "Gateway:",
                 WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX,
                  10, 210, 65, 10, mainWindow, (HMENU) 17, ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
    
    hwndEditServerGATEWAY = CreateWindow (TEXT ("edit"), valueGateway,
                 WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, 
                  110, 209, 145, 15, mainWindow, (HMENU) 18, ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
    And of course, mainWindow is my mainWindow name Look at she:

    Code:
    mainWindow = CreateWindow (szClassName, "Not finished app", WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 349, 482, HWND_DESKTOP, NULL, hInstance, NULL);
    Things look ok donīt you think?

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    For default dialog-like keyboard handling (like TAB or ESC), use IsDialogMessage in your message loop. The question has come up before so a search of this board will reveal how, where and when to use it.

    There's an example of a message loop using IsDIalogMessage here.
    Last edited by Ken Fitlike; 11-21-2002 at 02:05 PM.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    42
    Thanks a lot I had no idea things worked that way. My app is almost finished now and that was one of the last problems

  6. #6
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343
    well you probably know more than i do
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. D3DX - ALT + TAB / Drawing stuff
    By Tonto in forum Game Programming
    Replies: 8
    Last Post: 10-31-2006, 09:04 PM
  3. Tab order in Tab Control
    By Halloko in forum Windows Programming
    Replies: 2
    Last Post: 05-08-2005, 11:08 PM
  4. Replies: 0
    Last Post: 02-21-2002, 06:05 PM
  5. Doing stuff when certain Key combo's pushed
    By HisWord in forum Windows Programming
    Replies: 13
    Last Post: 09-30-2001, 07:39 AM