Click here to Skip to main content
12,625,619 members (34,207 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ Windows Dev
Hey folks!

I have a script similar to this:

void newThread(void* none){
    
    buff = "New changed text!!"
    Some script that changes texthwnd to buff;
    texthwnd.label = buff;                   //<---- This is what i want!
}
 

int winmain(blah,blah,,){
    Making window structure...
    
    still making window structure...
 
    hwnd = CreateWindowEx(blah, classname, windowname, blah);
    ShowWindow(hwnd, something);
 
    _beginthread(newThread, 0, 0);            //<--- IMPORTANT!

    while(1){
        some important while loop for messages;
    }
}
 
LRESULT CALLBACK WindowProcedure (blah,blah,blah){
    switch (message){
	case WM_CREATE:
	    texthwnd = CreateWindowEx(0, "STATIC", //<---- Creating the texthwnd.
            "Random Text",
            WS_CHILD | WS_VISIBLE | SS_SIMPLE,
            10, 10, 100, 100, hwnd, 0, 0, 0);
	    break;
		
		
        case WM_DESTROY:
            PostQuitMessage (0);
            break;
        default:
            return DefWindowProc (blah,);
    }
 
    return 0;
}

The thing I want is to change the text of the "texthwnd"?

How!?!?!?

I've been "googling" alot!

Im new to GUI programming and this is one of my first projects with GUI.

This is the first time i send a question anywhere on the internet so let me know if there's something i've missed!

Thanks!
Posted 11-Sep-11 14:27pm
Comments
SAKryukov 11-Sep-11 23:25pm
   
Script? Similar to this? Ever head that C++ is compiling language, not interpreted?
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

It sounds like you are looking for the SetWindowText Function[^]

SetWindowText(texthwnd,_T("Hello World"));

Best Wishes,
-David Delaune
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Thanks but i actually found a solution but your's was much better! Thanks alot!

My solution was SetDlgItemText Function

SetDlgItemText(texthwnd, 0, "Some teext!!!");

Well still thanks alot!!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161205.1 | Last Updated 11 Sep 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100