0

i have problem in display a login dialogbox... that have 2 textbox,1 combobox like username,password,domain...

1.i have setfocus in username ,that cant set

SetFocus(GetDlgItem(_hwnd, IDC_NAME)); 

but,it cant set when system logontime,the cursor symbol is focus that textbox,but values not get,ather i click that textbox,then only focus that textbox... but after login other dialogbox textboxs are focused using this type of code,like

SetFocus(GetDlgItem(hchged, IDC_PWD));

2.In combobox the systemname and domain name there...every login time system name only showed...how to change that into domain name...

note:i am using c++ win32 API dialogbox...

Arjun babu
  • 607
  • 2
  • 13
  • 42

1 Answers1

2

Your question is incredibly difficult to understand. Based off the title, it sounds like you want to do this:

ComboBox_SetCurSel(GetDlgItem(hwnd, IDC_COMBO_BOX), 1);
Mike Kwan
  • 24,123
  • 12
  • 63
  • 96
  • Thank u Mike...it works fine...now i have 2 doubts...1.SetFocus(GetDlgItem(_hwnd, IDC_NAME)); cant focus that textbox...2.i have three buttons in that dialogbox, if i press enter keyword ID_OK button will work...but i want to invoke ID_MYBUTTON...how can i achieve that both? – Arjun babu Oct 22 '12 at 06:49
  • @SanjuMonu: These sound like separate questions to me. You should ask a new question and include information about what kind of control `IDC_NAME` represents and why you think the focus is not being set and where in the code you are attempting to set the focus, etc. – Mike Kwan Oct 22 '12 at 08:29
  • :i did it...come to this link...http://stackoverflow.com/questions/13007869/how-to-invoke-a-button-using-c-win32-api-when-press-the-enter-button – Arjun babu Oct 25 '12 at 04:43