Programa en Graphic Mode para cambiar el titulo a una ventana :P :
#include <windows.h>
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
char szClassName[ ] = "windowsclass";
HINSTANCE miinstance;
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
miinstance=hThisInstance;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = CreateSolidBrush(RGB(192,192,192));
if (!RegisterClassEx (&wincl))return 0;
hwnd = CreateWindowEx (
0,
szClassName,
"Change Title::Javier",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
400,
200,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL);
ShowWindow (hwnd, nCmdShow);
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
char texto[50],textos[50];
case WM_CREATE:
static HWND mensaje = CreateWindowEx(1, "STATIC", "Inicio : ", WS_CHILD|WS_VISIBLE, 0, 0, 80, 25, hwnd, 0, miinstance, NULL);
static HWND mensajex = CreateWindowEx(1, "STATIC", "Fin : ", WS_CHILD|WS_VISIBLE, 0, 25, 80, 25, hwnd, 0, miinstance, NULL);
static HWND string = CreateWindowEx(1, "EDIT", NULL, WS_CHILD|WS_VISIBLE|WS_TABSTOP, 100, 0, 210, 24, hwnd, 0, miinstance, NULL);
static HWND strings = CreateWindowEx(1, "EDIT", NULL, WS_CHILD|WS_VISIBLE|WS_TABSTOP, 100, 25, 210, 24, hwnd, 0, miinstance, NULL);
static HWND boton = CreateWindowEx(0, "BUTTON", "Listo!", WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, 0, 60, 80, 20, hwnd, 0, miinstance, NULL);
break;
case WM_COMMAND:
GetWindowText(string,texto,50);
GetWindowText(strings,textos,50);
if((HWND)lParam==boton){
hwnd = FindWindow(NULL, texto);
if (hwnd != 0)
{
SetWindowText(hwnd, textos);
MessageBox(hwnd, "Titulo Cambiado !", "Resultado", MB_OK);
}else{
MessageBox(hwnd, "Titulo No Encontrado !", "Resultado", MB_OK);
}
}
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
En aquél tiempo lo hice para CPH , hoy lo comparto con ustedes :D