C ++ GUI STATIC的标签更改为HELP!?!? [英] C++ GUI STATIC'S changing label HELP!?!?

查看:45
本文介绍了C ++ GUI STATIC的标签更改为HELP!?!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我有一个与此相似的脚本:

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;
}



我想要的是更改"texthwnd"的文本?

怎么!?!!?!?

我已经大量搜索"了!

我是GUI编程的新手,这是我使用GUI的第一个项目.

这是我第一次在互联网上的任何地方发送问题,所以让我知道是否有我错过的事情!

谢谢!



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!

推荐答案

听起来您正在寻找 ^ ]

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

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



最好的祝福,
-David Delaune



Best Wishes,
-David Delaune


谢谢,但我实际上找到了一个解决方案,但您的解决方案要好得多!非常感谢!

我的解决方案是 SetDlgItemText函数

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!!


这篇关于C ++ GUI STATIC的标签更改为HELP!?!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆