RE: A Little API Help Please
- Posted by Robert Szalay <robsz1 at hotpop.com> Jul 28, 2003
- 460 views
Hmmm. I gave it a shot. Unfortunatly, it didn't solve the problem. Any other ideas anyone ? Thanks, Robert Szalay euman at bellsouth.net wrote: > WM_SETTEXT Message > > > An application sends a WM_SETTEXT message to set the text of a window. > Syntax > To send this message, call the SendMessage function as follows. > > lResult = SendMessage( > // returns LRESULT in lResult > > (HWND) hWndControl, > // handle to destination control > > (UINT) WM_SETTEXT, > // message ID > > (WPARAM) wParam, > // = (WPARAM) () wParam; > > (LPARAM) lParam > // = (LPARAM) () lParam; > > ); > > > Parameters > wParam > This parameter is not used. > lParam > Pointer to a null-terminated string that is the window text. > > so to do this you would: > > newWintxt = allocate_string("NewTXT") > Wintxt=c_func(SendMessage,{hwnd,WM_SETTEXT,0,newWintxt}) > free(newWintxt) > > Wolf has a great demo that helps change the icon of the window if you > need this too. > > Euman > > > On 27 Jul 2003 at 9:34, Robert Szalay wrote: > > > > > Hello list. > > > > I am making a window. The window is just an invisible window to > > receive tcp and timer messages. I am also using a console. The > > problem is that in the CTRL+ALT+DEL menu, it shows the name on the > > console(EXW). I want it to say what I tell it to. > > > > Here is some code... > > > > global constant USER32 = open_dll("user32.dll"), > > xPostQuitMessage = define_c_proc(USER32, "PostQuitMessage", > > {C_INT}), > > xDefWindowProc = define_c_func(USER32, > > "DefWindowProcA",repeat(C_UINT,4),C_UINT), > > xRegisterClassEx = define_c_func(USER32, "RegisterClassExA", > > {C_POINTER}, C_INT), > > xCreateWindow = define_c_func(USER32, > > "CreateWindowExA",repeat(C_INT,12),C_INT), > > xGetMessage = define_c_func(USER32, "GetMessageA", > > repeat(C_INT,4), C_INT), > > xTranslateMessage = define_c_proc(USER32, "TranslateMessage", > > > > {C_INT}), > > xDispatchMessage = define_c_proc(USER32, "DispatchMessageA", > > {C_INT}), > > xSetTimer = define_c_func(USER32, "SetTimer", > > {C_INT,C_INT,C_INT,C_INT},C_INT), > > xKillTimer = define_c_func(USER32, "KillTimer", > > {C_INT,C_INT},C_INT), > > SIZEOF_MESSAGE = 40, > > SIZEOF_WNDCLASSEX = 48, > > WM_CREATE = #00000001, > > WM_DESTROY = #00000002, > > WM_COMMAND = #00000111, > > WM_TIMER = #113, > > WINDOW_CLASS_NAME = allocate_string("MyWndClass"), > > APP_NAME = allocate_string("My Window!!!"), > > WC_cbSize = 0, > > WC_style = 4, > > WC_WndProc = 8, > > WC_cbClsExtra = 12, -- Normally NULL > > WC_cbWndExtra = 16, -- Normally NULL > > WC_hInstance = 20, > > WC_hIcon = 24, > > WC_hCursor = 28, > > WC_hbrBackground = 32, > > WC_lpszMenuName = 36, > > WC_lpszClassName = 40, > > WC_hIconSm = 44 > > > > atom main_window_handle > > main_window_handle = 0 > > <snip>