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

  1. #1
    Registered User
    Join Date
    Nov 2002

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

    Its frustrating :\ Im working on my first win32 app for about a month and im at the point of exporting results to xml files and stuff, the app is almost finished except that i cant make one basic (and stupid) thing work.

    The TAB key Yeah, i know its 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 cant 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
    Visalia, CA, USA
    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
    Thanks for the answer master5001, here are 2 of the controls:

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

    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 dont you think?

  4. #4
    Join Date
    Jan 2002
    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
    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
    well you probably know more than i do
    ~DJ DarkViper signing out
    My Site:
    Black Jaguar Studios

    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