Page 1 of 1

Windows Functions work differently with skins2 interface

Posted: 07 Dec 2006 20:07
by mgreene
I posted a similar ? on the general discussion thread, but this one is more specific. Background: I want to be able to control the VLC window (size, position, etc.) programatically from another Windows application. I would like to run the VLC with the skins2 interface, but it seems to work differently. To wit:

If I launch VLC via command line without a skin, then using another Windows C++ MFC based app, I can minimize, reposition, and resize the VLC window:

Code: Select all

CWnd *hWndVLC; hWndVLC = FindWindow(NULL,"VLC media player"); CString s; // verify we've go the right window hWndVLC->GetWindowText(s); MessageBox (s, "Caption of VLC" , MB_OK); // minimize hWndVLC->ShowWindow(SW_MINIMIZE); // maximize hWndVLC->ShowWindow(SW_MAXIMIZE); //reposition (center on screen) CWnd *hDesktop = CWnd::GetDesktopWindow(); hWndVLC->CenterWindow(hDesktop);
But the last function (and any other repositioning or resizing functions) will only work on the VLC window when it is not skinned. What is about the skinned interface that precludes programatic repositioning?

Posted: 08 Dec 2006 09:25
by ipkiss
To be able to be skin the windows easily (without a title bar and such), we create them with the WS_POPUP style (see msdn for more details). Here is the line creating the windows:

Code: Select all

m_hWnd = CreateWindowEx( WS_EX_TOOLWINDOW, "SkinWindowClass", "default name", WS_POPUP | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hParentWindow, 0, hInst, NULL );