Click here to Skip to main content
15,895,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWS_TABSTOP Pin
jkirkerx7-Dec-11 8:51
professionaljkirkerx7-Dec-11 8:51 
AnswerRe: WS_TABSTOP Pin
David Crow7-Dec-11 9:34
David Crow7-Dec-11 9:34 
GeneralRe: WS_TABSTOP Pin
jkirkerx7-Dec-11 10:56
professionaljkirkerx7-Dec-11 10:56 
GeneralRe: WS_TABSTOP Pin
jkirkerx8-Dec-11 8:49
professionaljkirkerx8-Dec-11 8:49 
AnswerRe: WS_TABSTOP Pin
Stephen Hewitt8-Dec-11 2:16
Stephen Hewitt8-Dec-11 2:16 
GeneralRe: WS_TABSTOP Pin
jkirkerx8-Dec-11 6:14
professionaljkirkerx8-Dec-11 6:14 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 15:02
Stephen Hewitt9-Dec-11 15:02 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 15:23
professionaljkirkerx9-Dec-11 15:23 
I built on it even more today, and made it bigger, and thought I optimized it a bit more.

My thinking is saying only translate and dispatch DialogMessages?, and then run the rest of my code as is. Or wrap my new code in the if statement.


C#
// Intercept the Messages I want to hear
    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);

        //WCHAR szMessage[50];
        //wsprintf(szMessage, L"msg=%u wparam=%u lparam=%u", msg.message, msg.wParam, msg.lParam);
        //SetWindowText(lbl_Manage_CreateAccount_Status, szMessage);

        switch (msg.message)  {
            case WM_LBUTTONDOWN:
            {
                WCHAR *szTempData[150];
                int iLength = SendMessageW(GetFocus(), WM_GETTEXT, (WPARAM)150, (LPARAM)szTempData );
                if ( iLength > 0 ) {
                    SendMessage(GetFocus(), EM_SETSEL, 0, -1);
                }
            }
            break;

            case WM_CHAR:
                short ks = GetKeyState(VK_SHIFT);
                if (msg.wParam == VK_TAB) {
                    if (ks >= 0) {
                        // Tab motion forward >>
                        SetFocus(GetNextDlgTabItem(hManage_CreateAccount, GetFocus(), FALSE));
                    }
                    else {
                        // Tab motion backward <<
                        SetFocus(GetNextDlgTabItem(hManage_CreateAccount, GetFocus(), TRUE));
                    }

                    // If text exist, select it
                    WCHAR *szTempData[150];
                    int iLength = SendMessageW(GetFocus(), WM_GETTEXT, (WPARAM)150, (LPARAM)szTempData );
                    if ( iLength > 0 )
                        SendMessage(GetFocus(), EM_SETSEL, 0, -1);
                }
                break;
        }
    }

GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 15:39
Stephen Hewitt9-Dec-11 15:39 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 16:34
professionaljkirkerx9-Dec-11 16:34 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 19:42
Stephen Hewitt9-Dec-11 19:42 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 20:18
professionaljkirkerx9-Dec-11 20:18 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 21:22
Stephen Hewitt9-Dec-11 21:22 
AnswerIt works, now but how to detect shift tab << Pin
jkirkerx8-Dec-11 12:40
professionaljkirkerx8-Dec-11 12:40 
GeneralRe: It works, now but how to detect shift tab << Pin
Graham Breach8-Dec-11 13:06
Graham Breach8-Dec-11 13:06 
GeneralRoom for improvement let me know. Pin
jkirkerx8-Dec-11 13:16
professionaljkirkerx8-Dec-11 13:16 
QuestionParsing in C Pin
Software20077-Dec-11 6:55
Software20077-Dec-11 6:55 
AnswerRe: Parsing in C Pin
Albert Holguin7-Dec-11 7:23
professionalAlbert Holguin7-Dec-11 7:23 
AnswerRe: Parsing in C Pin
Chris Losinger7-Dec-11 8:10
professionalChris Losinger7-Dec-11 8:10 
GeneralRe: Parsing in C Pin
Software20077-Dec-11 9:54
Software20077-Dec-11 9:54 
QuestionRe: Parsing in C Pin
David Crow7-Dec-11 9:27
David Crow7-Dec-11 9:27 
AnswerRe: Parsing in C Pin
Software200710-Dec-11 13:28
Software200710-Dec-11 13:28 
AnswerRe: Parsing in C Pin
Software200712-Dec-11 5:52
Software200712-Dec-11 5:52 
AnswerRe: Parsing in C Pin
David Crow12-Dec-11 7:15
David Crow12-Dec-11 7:15 
GeneralRe: Parsing in C Pin
Software200712-Dec-11 7:32
Software200712-Dec-11 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.