Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetWindowTitle(handle:TWindow): String;
- var
- title: TXTextProperty;
- begin
- title.value := nil;
- title.encoding := XA_STRING;
- title.format := 8;
- title.nitems := 0;
- XGetWMName(display, handle, @title);
- if (title.value <> nil) and (title.nitmems <> 0) then
- begin
- SetLength(Result, title.nitems);
- Move(title.value^[0], Result[1], title.nitems);
- end;
- end;
- procedure SetWindowTitle(handle:TWindow; Text:String);
- var
- title: TXTextProperty;
- begin
- title.value := PChar(Text);
- title.encoding := XA_STRING;
- title.format := 8;
- title.nitems := Length(Text);
- XSetWMName(display, handle, @title);
- XFlush(display);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement