The format of the property is returned in format_ret: 32.
From some Docs I found in the internet:
If the returned format is 8, the returned data is represented as a char array. If the returned format is 16, the returned data is represented as a short array and should be cast to that type to obtain the elements. If the returned format is 32, the returned data is represented as a long array and should be cast to that type to obtain the elements.
So this should work:
uses xlib, x, xatom, xutil;
procedure TForm1.Button1Click(Sender: TObject);
var
aDis: PDisplay;
aRootWin: TWindow;
aSkypeInst: TAtom;
aStatus: cint;
type_ret: TAtom;
format_ret: integer;
nitems_ret: culong;
bytes_after_ret: culong;
prop: Pcuchar;
myprop: PCardinal;
SkypeWinID: TWindow;
begin
aDis := xlib.XOpenDisplay(nil);
try
aRootWin := XDefaultRootWindow(aDis);
aSkypeInst := XInternAtom(aDis, '_SKYPE_INSTANCE', True);
if aSkypeInst = 0 then begin
Log('Skype instance not found');
Exit;
end;
aStatus := XGetWindowProperty(aDis, aRootWin, aSkypeInst, 0, 1, False, XA_WINDOW, @type_ret, @format_ret, @nitems_ret, @bytes_after_ret, @prop);
myprop := PCardinal(prop);
SkypeWinID := TWindow(myprop^);
XFree(prop);
finally
XFlush(aDis);
end;
end;