Page 1 of 1

VLC remote control via WM_COMMAND

Posted: 24 Oct 2005 10:44
by DOOM
Hello,

cause neither the rc or telnet console fit my needs, i tryed to control VLC via WM_COMMAND (works fine). I wasnt able to locate the constants into the w32 sources, only found some for wince but they are different.

Does somebody have a complete list of WM_Commands? Especially i'm interested in a "switch to wallpaper mode" and a "open file" command.

Below a list of commands i've brute forced

http://msdn.microsoft.com/library/defau ... ommand.asp

Sample:

PostMessage(vlc_handle, WM_Command,71535,0);

5013 = about
70549= about
5999 = close
12999= close
71535= close
6000 = open file
71536= open file
7099 = open file
6001 = open file
6002 = open file
7100 = open file
6003 = open folder
6003 = open folder
6004 = open volume
7101 = open volume
6005 = open network
7102 = open network
6006 = open direct show
7103 = open direct show
6010 = streaming/transcoding
6011 = playlist
6012 = debug messages
7105 = debug messages
7107 = pause/play
7108 = pause play
6013 = stream/medianinfo
7104 = stream/medianinfo
6014 = audio
7106 = audio
6015 = adv. gui
71551= adv. gui
6020 = play/stop/open file
6021 = stop
6022 = stop
7109 = stop
7110 = stop
7111 = stop
13003 =Stop
71555 =stop
6023 = faster
6024 = slower
11000= change skin
11001= change skin
13000 = Pause/Play
13004 = Timecode
13005 = - 10 sec
13006 = + 10 sec
13007 = - 1 min
13008 = + 1 min
13009 = - 5 min
13010 = + 5 min
13011 = prev
13012 = next
13013 = faster
13014 = slower
13015 = fullscreen
13016 = vol +
13017 = Vol -
13018 = mute/unmute
13019 = Subtitle delay - 50 ms
13020 = Subtitle delay + 50 ms
13021 = Audio delay - 50 ms
13022 = Audio delay - 50 ms
13023 = change audio
13024 = change subtitle
13026 = screenshot
13050 = jmp bof
71552 = bookmark
11001 = restart VLC, new WHandle
11002 = ??
11003 = ?? http:
11004 = logger interface modul
11005 = remote control interface
11006 = vlm
71536 = close VLC
71536 = open
71537 = open
71538 = open
71539 = open folder
71540 = open volume
71541 = open Network
71542 = open direct show
71546 = streaming/transcoding
71547 = Playlist
71548 = Debug Messages
71549 = Stream Medieadetails
71550 = settings
71551 = adv Gui
71552 = Bookmark
71556 = open


DOOM

WM_COMMANDS

Posted: 26 Oct 2005 17:49
by Saturn2
If you use girder software or similar you can grab these events so for example

6027 is Next Chapter
6026 is Previous Chapter

and so on. I'm wonder if is possible to send data for OSD to display via WM_COMMAND

Cheers

Saturn

Re: VLC remote control via WM_COMMAND

Posted: 26 Oct 2005 20:11
by mokdevel
cause neither the rc or telnet console fit my needs, i tryed to control VLC via WM_COMMAND (works fine). I wasnt able to locate the constants into the w32 sources, only found some for wince but they are different.
Nice, I'd need these too. I suppose these do not work with win32?

Wallpaper mode

Posted: 27 Oct 2005 16:06
by Saturn2
Maybe you know it alrealdy but WM_COMMAND for activating wallpaper mode

is 9017


What else you want to know about file open, you have command code already?


Saturn2

wm_commands

Posted: 27 Oct 2005 19:19
by saturn2
I noticed some changes in new version 0.8.4test1a in this version wallpaper mode on/off is 9018.

BTW. What program you used for grabing of wm_commands ?

WM_COMMAND and WM_SYSCOMMAND values

Posted: 01 Nov 2005 10:11
by twd
I have included <winuser.h> for definitions to Windows Controls
and <winable.h> for definitions of Windows Events.



61456 was a code we want to decrypt

take the code and then AND the code with the hex mask 0xFFF0
this implies the lower four bits of code are zeroed out

Dec Bin
8 2^3
+4 2^2
+2 2^1
+1 2^0

Dec Bin Bin Hex
=15 2^4-1 1111 0xF

61456 AND 0xFFF0

61,456 >0xF010, roll right 4 bits >0xF01
------
0x10000=65,536 >0
0x01000= 4,096 >F 15* 4,096=61,440
0x00100= 256 >0
0x00010= 16 >1 1*16 = 16
0x00001= 1 >0 ======
61,456



0xF010 >1111 0000 0001 0000 = wParam

So the wParam we need to look up in <winuser.h>
is the hex value 0xF010... which turns up in
a line in the file for SC_MOVE.

#define SC_MOVE 0xF010



Example
-------
wParam is SC_KEYMENU,
lParam contains the character code of the key that is used with the ALT key
to display the popup menu.

For example, pressing ALT+F to display the File popup will cause a
WM_SYSCOMMAND with wParam equal to SC_KEYMENU and
lParam equal to 'f'.



http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/resources/menus/menureference/menumessages/wm_command.asp

WM_COMMAND Notification
--------------------------
The WM_COMMAND message is sent when the user selects a command item from a menu, when a
control sends a notification message to its parent window, or when an accelerator keystroke
is translated.

Syntax
------
WM_COMMAND

WPARAM wParam
LPARAM lParam;

Parameters
----------
wParam

The high-order word specifies the notification code if the message is from a control.
If the message is from an accelerator, this value is 1. If the message is from a menu,
this value is zero.


The low-order word specifies the identifier of the menu item, control, or accelerator.

lParam

Handle to the control sending the message if the message is from a control.
Otherwise, this parameter is NULL.


Return Value
------------
If an application processes this message, it should return zero.


Remarks

Accelerator keystrokes that select items from the window menu are translated into
WM_SYSCOMMAND messages.

If an accelerator keystroke occurs that corresponds to a menu item when the window
that owns the menu is minimized, no WM_COMMAND message is sent. However, if an
accelerator keystroke occurs that does not match any of the items in the window's
menu or in the window menu, a WM_COMMAND message is sent, even if the window is
minimized.

If an application enables a menu separator, the system sends a WM_COMMAND message
with the low-word of the wParam parameter set to zero when the user selects the
separator.

Windows 98/Me, Windows 2000/XP: If a menu is defined with a MENUINFO.dwStyle value
of MNS_NOTIFYBYPOS, WM_MENUCOMMAND is sent instead of WM_COMMAND.




http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/userinput/keyboardaccelerators/keyboardacceleratorreference/
keyboardacceleratormessages/wm_syscommand.asp

WM_SYSCOMMAND Notification
--------------------------

A window receives WM_SYSCOMMAND Notification when the user chooses a command from the Window
menu (formerly known as the system or control menu) or when the user chooses
the maximize button, minimize button, restore button, or close button.

Syntax
------
WM_SYSCOMMAND

WPARAM wParam
LPARAM lParam;

In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used
internally by the system. To obtain the correct result when testing the value of
wParam, an application must combine the value 0xFFF0 with the wParam value by
using the bitwise AND operator.

The menu items in a window menu can be modified by using the GetSystemMenu, AppendMenu,
InsertMenu, ModifyMenu, InsertMenuItem, and SetMenuItemInfo functions. Applications
that modify the window menu must process WM_SYSCOMMAND messages.

Accelerator keys that are defined to choose items from the window menu are translated
into WM_SYSCOMMAND messages; all other accelerator keystrokes are translated into
WM_COMMAND messages.

If the wParam is SC_KEYMENU, lParam contains the character code of the key that
is used with the ALT key to display the popup menu. For example, pressing ALT+F
to display the File popup will cause a WM_SYSCOMMAND with wParam equal to SC_KEYMENU
and lParam equal to 'f'.


Parameters
----------
wParam

Specifies the type of system command requested.

This parameter can be one of the following values.

SC_CLOSE
Closes the window.
SC_CONTEXTHELP
Changes the cursor to a question mark with a pointer. If the user then clicks
a control in the dialog box, the control receives a WM_HELP message.
SC_DEFAULT
Selects the default item; the user double-clicked the window menu.
SC_HOTKEY
Activates the window associated with the application-specified hot key.
The lParam parameter identifies the window to activate.
SC_HSCROLL
Scrolls horizontally.
SC_KEYMENU
Retrieves the window menu as a result of a keystroke. For more information, see
the Remarks section.
SC_MAXIMIZE
Maximizes the window.
SC_MINIMIZE
Minimizes the window.
SC_MONITORPOWER
Sets the state of the display. This command supports devices that have power-saving
features, such as a battery-powered personal computer.

The lParam parameter can have the following values:
1 - the display is going to low power
2 - the display is being shut off

SC_MOUSEMENU
Retrieves the window menu as a result of a mouse click.
SC_MOVE
Moves the window.
SC_NEXTWINDOW
Moves to the next window.
SC_PREVWINDOW
Moves to the previous window.
SC_RESTORE
Restores the window to its normal position and size.
SC_SCREENSAVE
Executes the screen saver application specified in the [boot] section of the System.ini file.
SC_SIZE
Sizes the window.
SC_TASKLIST
Activates the Start menu.
SC_VSCROLL
Scrolls vertically.


lParam

The low-order word specifies the horizontal position of the cursor, in screen coordinates,
if a window menu command is chosen with the mouse. Otherwise, this parameter is not used.

The high-order word specifies the vertical position of the cursor, in screen coordinates,
if a window menu command is chosen with the mouse. This parameter is –1 if the command
is chosen using a system accelerator, or zero if using a mnemonic.



http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/userinput/keyboardaccelerators.asp

Keyboard Accelerators
---------------------
A keyboard accelerator (or, simply, accelerator) is a keystroke or combination
of keystrokes that generates a WM_COMMAND or WM_SYSCOMMAND message for an application.


WM_SYSCOMMAND
A window receives this message when the user chooses a command from the
Window menu (formerly known as the system or control menu) or when the
user chooses the maximize button, minimize button, restore button, or
close button.


http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/windowui.asp

http://msdn.microsoft.com/library/defau ... d_21pv.asp


Winable.h C and C++ header file for using WinEvents
Winuser.h C and C++ header file for using Windows controls




/************************************************************
*
* winuser.h -- USER procedure declarations, constant definitions
* and macros
*
* Copyright (c) 1985-1995, Microsoft Corp. All rights reserved.
************************************************************/

#ifndef _WINUSER_
#define _WINUSER_

//
// Define API decoration for direct importing of DLL references.
//

#if !defined(_USER32_)
#define WINUSERAPI DECLSPEC_IMPORT
#else
#define WINUSERAPI
#endif

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef WINVER
#define WINVER 0x0400 /* version 4.0 */
#endif /* !WINVER */


#define WM_COMMAND 0x0111
#define WM_SYSCOMMAND 0x0112

----------
from winuser.h
--------------
#ifndef NOSYSCOMMANDS

/*
* System Menu Command Values
*/
#define SC_SIZE 0xF000
#define SC_MOVE 0xF010
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#define SC_NEXTWINDOW 0xF040
#define SC_PREVWINDOW 0xF050
#define SC_CLOSE 0xF060
#define SC_VSCROLL 0xF070
#define SC_HSCROLL 0xF080
#define SC_MOUSEMENU 0xF090
#define SC_KEYMENU 0xF100
#define SC_ARRANGE 0xF110
#define SC_RESTORE 0xF120
#define SC_TASKLIST 0xF130
#define SC_SCREENSAVE 0xF140
#define SC_HOTKEY 0xF150
#if(WINVER >= 0x0400)
#define SC_DEFAULT 0xF160
#define SC_MONITORPOWER 0xF170
#define SC_CONTEXTHELP 0xF180
#define SC_SEPARATOR 0xF00F
#endif /* WINVER >= 0x0400 */
/*
* Obsolete names
*/
#define SC_ICON SC_MINIMIZE
#define SC_ZOOM SC_MAXIMIZE

#endif /* !NOSYSCOMMANDS */

Posted: 07 Nov 2005 13:59
by DOOM
Thanks for this useful information. Another step forward :o)


Image

BTW. What program you used for grabing of wm_commands ?

I wrote a small tool that send and inc a Wm_Command every Second and watched what happend *g*


DOOM

Posted: 07 Nov 2005 18:43
by dionoea
wow ! your app looks neat (especially the EPG part). Did you do that in VLC ?

Posted: 07 Nov 2005 22:28
by DOOM
Hello,

no, i dont did this in VLC, i played with the skin feature at the beginning but then i realised - i wont get forward without own code.

VLCRape is a Remote Control tool for STB Receivers like DBox2 or Dreambox and Videolan of course. Its able to play up to four mpeg2ts from the receivers or videofiles stored on hdd/dvd simultaneous (split screen).

About the technical side:

VLCRape launches four hidden Videolan instances and captures their DirectX video panels and some controls, resizes them and finally inject all the stuff into itself. Brutal - i know *g* thats why its labled VLCRape.
Have to fix some bugs - after it reachs build status and the multilanguage support is done, ill release it.

Why all this effort? VLC is the best player i saw since now, but the gui is not really user friendly. :-/

Some new pics below

Image

Image

Image

Image

Image

Image


DOOM

Posted: 11 Nov 2005 06:57
by geo
Wow DOOM, VLCrape looks great.

I have a DM500 here if you want a tester.

Are you getting more than one TS from the Dreambox simultaneously?

cheerio - George

VLCRape is available?

Posted: 11 Nov 2005 11:51
by JAI
I saw your VLCRape program interface and it seems very useful.
Do you intent to make it available?

Jai

Posted: 11 Nov 2005 11:57
by DOOM
Hi,

that should be possible if the channels are on the same transponder, but its not implemented yet. I asked tmbinc for an enigma webinterface reference, but at the moment nearly nothing into the API runs final. I dont have enough time and motivation to permanently adapt my code to enigma.

I wrote VLCRape primarily for Dbox2 Neutrino.

Dont get me wrong, full enigma support will come - but later :o)
I saw your VLCRape program interface and it seems very useful.
Do you intent to make it available?
Yes, but i have to fix some bugs first.

DOOM

Posted: 13 Nov 2005 19:33
by streetfox
very nice....does VLCRape work remotely or only on the machine where the capturing device is connected? :-P

Posted: 18 Jul 2006 01:16
by Guest45646
Can somebody tell me how to get the VLC handle? I can't seem to send any commans to the handle for wxWindowClassNR which seems to be the classname

vlc handle

Posted: 15 Nov 2006 14:02
by junkmail
Very rough code, but maybe helps (delphi)


//function EnumWindowsFunc (Handle: THandle; List: TStringList): boolean ; stdcall;
function EnumProcess(Handle: HWND; lParam : integer): boolean; stdcall;
var Caption: array[0..256] of Char;
pPid : DWORD;
title, ClassName : string;
begin

if (Handle=NULL) then
begin
result := false;
end
else
begin
//additional functions to get more information about a process.
//get the Process Identification number.
GetWindowThreadProcessId(handle,pPid);

//set a memory area to receive
//the process class name
SetLength(ClassName, 255);
//get the class name and reset the
//memory area to the size of the name
SetLength(ClassName,
GetClassName(handle,
PChar(className),
Length(className)));
SetLength(title, 255);
//get the process title; usually displayed
//on the top bar in visible process
SetLength(title, GetWindowText(Handle, PChar(title), Length(title)));


if title = 'VLC media player' then begin

Form1.VLC_handle := Handle; // --> we have got it here!
end;
Result := true;
end;

end;

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
//Clear any previous calls
//define the tag flag
lp := 0; //globally declared integer call the windows function with the address
//of handling function and show an error message if it fails
if EnumWindows(@EnumProcess,lp) = false then
ShowMessage('Error: Could not obtain process window hook from system.');

// ShowMessage(IntToStr(VLC_handle));
PostMessage(VLC_handle, WM_Command, 13003, 0); // stop
end;

Re: VLC remote control via WM_COMMAND

Posted: 25 Feb 2008 10:55
by briantokyo
Is there a recent list of commands? I Can't find them even in the source code. All those listed above don't seem to work anymore