If your program isn't using KDE, you won't be using the KWin class.
Of course you can do the same X11 communication without KDE code using just Xlib calls, or maybe your toolkit has some wrappers as well.
The question on how to get a window id for a toolkit window is definitely a question for a toolkit specific forum or mailinglist.
Cheers,
_