locked
unable to update listbox in credential provider custom dialog RRS feed

  • Question

  • I'm developing a credential provider for vista (based on the MS sample code) which does the following:

     

    1. store the LogonUI window handle

    HRESULT CSampleCredential::Advise(ICredentialProviderCredentialEvents* pcpce)

    ...

    HRESULT hr = pcpce->OnCreatingWindow(&m_hWndLogonUI) ;

     

    2. instantiate a custom dialog that does not return control to calling thread until exit

    HRESULT CSampleCredential:Tongue TiedetSelected(BOOL* pbAutoLogon)

    ...

    fnETIStart(m_pProvider) ; // instantiate dialog;

     

    3.  nETIStart creates a CCommandWindow object which in turn instantiates the dialog

    DWORD WINAPI CCommandWindow::CmdProc(LPVOID lpParameter)

    ...

    INT_PTR nRC = DialogBoxParam(g_hInstance, (LPTSTR)MAKEINTRESOURCE(IDD_DLG_ETIGINA), g_hWndLogonUI, fnETIGinaDlgMain, 0) ;

     

    At this juncture, the dialog box displays 3 buttons (OK, Cancel and Refresh), an empty edit box and an empty listbox.  Whenever the user presses the Refresh button, I successfully load the editbox with text as follows:

     

    HWND hCtrl = GetDlgItem(hDlg, IDC_EDT_USER_NAME) ;

    if ( hCtrl != NULL )

    {

    TCHAR tchaTemp[16] = "HelloWorld" ;

    SendMessage(hCtrl, WM_SETTEXT, 0, (LPARAM)tchaTemp) ;

    }

     

    However, when I add a string to the listbox nothing appears visually and sendmessage does not return an error code (it always returns 0)!

     

    HWND hCtrl = GetDlgItem(hDlg, IDC_LBX_SELECT_USER) ;

    if ( hCtrl != NULL )

    {

    TCHAR tchaTemp[16] = "HelloWorld" ;

    SendMessage(hCtrl, LB_RESETCONTENT, 0, 0) ;

    int nxSel = SendMessage(hCtrl, LB_ADDSTRING, 0, (LPARAM)tchaTemp) ;

    // item is not displayed in listbox!

    }

     

    What window is consuming the message to the listbox?  Why is the editbox not affected?  Have I missed something fundemental?

     

    Thanks

    dmm

    Friday, October 24, 2008 8:24 PM

Answers

  • yes i did miss something fundemental.  after converting my visual studio 6 program, visual studio 2005 botched the modification of my resource file.  to make a long story short, this caused the odd behavior previously listed.  i should have known!

    Tuesday, October 13, 2009 3:05 PM

All replies

  • yes i did miss something fundemental.  after converting my visual studio 6 program, visual studio 2005 botched the modification of my resource file.  to make a long story short, this caused the odd behavior previously listed.  i should have known!

    Tuesday, October 13, 2009 3:05 PM
  • Hi dmm3:

    Is this thread solved? Please tell me!

    Have a nice day...

    Best regards,
    Fisnik
    Coder24.com
    Wednesday, October 14, 2009 5:53 PM
  • Hi Fisnik

    Yes this thread is solved.

    Thanks
    Dan
    Thursday, October 22, 2009 2:01 PM
  • Mark something as answer then!
    Coder24.com
    Thursday, October 22, 2009 4:17 PM