for example,the RC file is below:
DLG_MAIN DIALOGEX 100,100,320,240
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |

DS_CENTER
EXSTYLE WS_EX_CLIENTEDGE
CAPTION "Just Testing"
MENU IDM_EN
FONT 9, "MS Sans Serif"
BEGIN
  PUSHBUTTON      "English",IDC_Button,116,111,72,16
  LTEXT      "Text",-1,78,39,168,42
END


How can I change the contents of the LTEXT which ID is Static(-1)?
I tried to set the ID of LTEXT, but when I LoadString(in the STRINGTABLE) and

SetDlgItemText, it failed.. :(
Posted on 2006-03-15 02:54:05 by Eric4ever
You can do like this:

  • Use EnumChildWindows

  • For each child window do a check for classname(GetClassName) to see if it equals "STATIC".
    Then check if the window's text is "Text"(GetWindowText) and check if the child window's ID is 0FFFFh(GetDlgCtrlID).


  • Then you may change the window's text to the one you like(SetWindowText).




Posted on 2006-03-15 05:09:06 by k3Eahn

You can do like this:

  • Use EnumChildWindows

  • For each child window do a check for classname(GetClassName) to see if it equals "STATIC".
    Then check if the window's text is "Text"(GetWindowText) and check if the child window's ID is 0FFFFh(GetDlgCtrlID).


  • Then you may change the window's text to the one you like(SetWindowText).





I made it!
Thanks k3Eahn
Posted on 2006-03-15 21:23:59 by Eric4ever