Click here to Skip to main content
13,342,442 members (54,332 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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!

        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",
            10, 10, 100, 100, hwnd, 0, 0, 0);
        case WM_DESTROY:
            PostQuitMessage (0);
            return DefWindowProc (blah,);

    return 0;

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


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!

Posted 11-Sep-11 14:27pm
SAKryukov 11-Sep-11 23:25pm
Script? Similar to this? Ever head that C++ is compiling language, not interpreted?
Rate this: bad
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
Rate this: bad
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!!

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 |
Web02 | 2.8.180111.1 | Last Updated 11 Sep 2011
Copyright © CodeProject, 1999-2018
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