Does window of SDL_SysWMinfo returns a Window Handle?

I’m trying to drag a SDL window by using (MS) window
handle.
http://bcbcaq.freeservers.com/move_client.html
I chose method 2. But it doesn’t work :frowning:

So far I understand, ‘window’ of SDL_SysWMinfo returns
the handle. I’m using SDL_GetWMInfo() to retrieve it.
WMInfo.window returns a value of 1. But I thought the
handle is a kind of pointer?
It returns the same value even when I comment
SDL_SetVideoMode() out, i.e. no window generated.

Currently, I’m not sure whether the routine of moving
window is wrong or the handle is not valid. My
questions:

  1. Does WMInfo.window return the window handle (for MS
    Windows implementation)?
  2. Does it make any difference where I call
    SDL_GetWMInfo(), whether before or after a SDL window
    is generated?
  3. Is the handle a counter or a pointer alike value?

thanks
Phuoc Can HUA=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Currently, I’m not sure whether the routine of moving
window is wrong or the handle is not valid. My
questions:

  1. Does WMInfo.window return the window handle (for MS
    Windows implementation)?

Yes. If you’re unsure about your call to SDL_GetWMInfo, the following
should work:

SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
SDL_GetWMInfo(&wmInfo);
HWND hWnd = wmInfo.window;

  1. Does it make any difference where I call
    SDL_GetWMInfo(), whether before or after a SDL window
    is generated?

Sort of. Once SDL’s video subsystem has been initialized (by calling
SDL_Init() or SDL_InitSubSystem() with the SDL_INIT_VIDEO flag), you should
be able to retrieve the app’s HWND, regardless of whether or not
SDL_SetVideoMode() has been called.–
David Ludwig
davidl funkitron.com
http://www.funkitron.com