Страница: 1 |
Страница: 1 |
Вопрос: Управление Light Alloy
Добавлено: 25.02.06 18:31
Автор вопроса: DaaGER | Web-сайт:
Люди кто разбирается в Delphi и basic помогите перевести. Мне нужно из своей проги управлять моим любимым проигрыватедем. Разроботчики мне предоставили такой код для управления (всё дословно)
======================
Можно посылать основному окну программы сообщения, где Msg = WM_APP + 2504 (0x89C8), wParam = команда. (Если в настройках установлен флажок "Эмулировать окно WinAMP", то программа также эмулирует окно WinAMP'а и принимает все его команды.)
Пример:
procedure LightAlloyFullScreen;
var
Wnd:HWND;
begin
Wnd:=FindWindow('LightAlloyFront',NIL);
if (Wnd<>0) then
SendMessage(Wnd,WM_LACMD,LAC_WINDOW_FULLSCREEN,0);
end;
Все возможные команды перечислены ниже - если Вы пишете на Delphi - можете просто скопировать этот фрагмент.
const
WM_LACMD = WM_APP + 2504;
LAC_VERSION = 000;
LAC_FILE_OPEN = 050;
LAC_FILE_INFO = 051;
LAC_PLAYBACK_STOP = 100;
LAC_PLAYBACK_PLAY = 101;
LAC_PLAYBACK_STOP_PLAY = 102;
LAC_PLAYBACK_SPEED_PLAY = 103;
LAC_PLAYBACK_FILTERS = 104;
LAC_SEEK_FRAME_STEP = 150;
LAC_SEEK_FRAME_BACK = 151;
LAC_SEEK_FORWARD = 152;
LAC_SEEK_BACKWARD = 153;
LAC_SEEK_JUMP_FORWARD = 154;
LAC_SEEK_JUMP_BACKWARD = 155;
LAC_SEEK_REWIND = 156;
LAC_SEEK_SET_BOOKMARK = 157;
LAC_WINDOW_CONTROL_PANEL = 200;
LAC_WINDOW_PLAYLIST = 201;
LAC_WINDOW_FULLSCREEN = 202;
LAC_WINDOW_ORIGINAL = 203;
LAC_WINDOW_STAY_ON_TOP = 204;
LAC_WINDOW_MINIMIZE = 205;
LAC_WINDOW_MAXIMIZE = 206;
LAC_PLAYLIST_NEXT = 250;
LAC_PLAYLIST_PREV = 251;
LAC_PLAYLIST_PLAY = 252;
LAC_PLAYLIST_ADD_FILES = 253;
LAC_PLAYLIST_ADD_FOLDER = 254;
LAC_PLAYLIST_DELETE = 255;
LAC_PLAYLIST_CLEAR = 256;
LAC_PLAYLIST_SAVE = 257;
LAC_PLAYLIST_MOVE_UP = 258;
LAC_PLAYLIST_MOVE_DOWN = 259;
LAC_PLAYLIST_SHUFFLE = 260;
LAC_PLAYLIST_SORT = 261;
LAC_PLAYLIST_REPORT = 262;
LAC_PLAYLIST_REPEAT = 263;
LAC_PLAYLIST_BOOKMARKS = 264;
LAC_VIDEO_PROPERTIES = 300;
LAC_VIDEO_SCREENSHOT = 301;
LAC_VIDEO_SCALE_50 = 302;
LAC_VIDEO_SCALE_100 = 303;
LAC_VIDEO_SCALE_200 = 304;
LAC_VIDEO_RATIO_ASIS = 305;
LAC_VIDEO_RATIO_16_9 = 306;
LAC_VIDEO_RATIO_4_3 = 307;
LAC_VIDEO_RATIO_WIDTH = 308;
LAC_VIDEO_RATIO_HEIGHT = 309;
LAC_VIDEO_RATIO_CUSTOM = 310;
LAC_VIDEO_RATIO_FREE = 311;
LAC_VIDEO_ZOOM_IN = 312;
LAC_VIDEO_ZOOM_OUT = 313;
LAC_VIDEO_BRIGHTNESS_INC = 314;
LAC_VIDEO_BRIGHTNESS_DEC = 315;
LAC_VIDEO_CONTRAST_INC = 316;
LAC_VIDEO_CONTRAST_DEC = 317;
LAC_VIDEO_SATURATION_INC = 318;
LAC_VIDEO_SATURATION_DEC = 319;
LAC_SUBTITLES_LOAD = 350;
LAC_SUBTITLES_SHOW = 351;
LAC_SOUND_PROPERTIES = 400;
LAC_SOUND_VOLUME_INC = 401;
LAC_SOUND_VOLUME_DEC = 402;
LAC_SOUND_MUTE = 403;
LAC_SOUND_ADD = 404;
LAC_APPLICATION_PREFERENCES = 450;
LAC_APPLICATION_HELP = 451;
LAC_APPLICATION_ABOUT = 452;
LAC_APPLICATION_EXIT = 453;
LAC_APPLICATION_POWER_OFF = 454;
=============================
Ответы
Всего ответов: 2
Номер ответа: 1
Автор ответа:
Victor
ICQ: 345743490
Вопросов: 42
Ответов: 385
Web-сайт:
Профиль | | #1
Добавлено: 26.02.06 00:24
Sub LightAlloyFullScreen()
Dim Wnd as long
Wnd:=FindWindow('LightAlloyFront',0);
if Wnd<>0 then
SendMessage(Wnd,WM_LACMD, LAC_WINDOW_FULLSCREEN,0);
end if
end;
Public Enum eLACommands
WM_LACMD = WM_APP + 2504
LAC_VERSION = 0
LAC_FILE_OPEN = 50
LAC_FILE_INFO = 51
LAC_PLAYBACK_STOP = 100
LAC_PLAYBACK_PLAY = 101
LAC_PLAYBACK_STOP_PLAY = 102
LAC_PLAYBACK_SPEED_PLAY = 103
LAC_PLAYBACK_FILTERS = 104
LAC_SEEK_FRAME_STEP = 150
LAC_SEEK_FRAME_BACK = 151
LAC_SEEK_FORWARD = 152
LAC_SEEK_BACKWARD = 153
LAC_SEEK_JUMP_FORWARD = 154
LAC_SEEK_JUMP_BACKWARD = 155
LAC_SEEK_REWIND = 156
LAC_SEEK_SET_BOOKMARK = 157
LAC_WINDOW_CONTROL_PANEL = 200
LAC_WINDOW_PLAYLIST = 201
LAC_WINDOW_FULLSCREEN = 202
LAC_WINDOW_ORIGINAL = 203
LAC_WINDOW_STAY_ON_TOP = 204
LAC_WINDOW_MINIMIZE = 205
LAC_WINDOW_MAXIMIZE = 206
LAC_PLAYLIST_NEXT = 250
LAC_PLAYLIST_PREV = 251
LAC_PLAYLIST_PLAY = 252
LAC_PLAYLIST_ADD_FILES = 253
LAC_PLAYLIST_ADD_FOLDER = 254
LAC_PLAYLIST_DELETE = 255
LAC_PLAYLIST_CLEAR = 256
LAC_PLAYLIST_SAVE = 257
LAC_PLAYLIST_MOVE_UP = 258
LAC_PLAYLIST_MOVE_DOWN = 259
LAC_PLAYLIST_SHUFFLE = 260
LAC_PLAYLIST_SORT = 261
LAC_PLAYLIST_REPORT = 262
LAC_PLAYLIST_REPEAT = 263
LAC_PLAYLIST_BOOKMARKS = 264
LAC_VIDEO_PROPERTIES = 300
LAC_VIDEO_SCREENSHOT = 301
LAC_VIDEO_SCALE_50 = 302
LAC_VIDEO_SCALE_100 = 303
LAC_VIDEO_SCALE_200 = 304
LAC_VIDEO_RATIO_ASIS = 305
LAC_VIDEO_RATIO_16_9 = 306
LAC_VIDEO_RATIO_4_3 = 307
LAC_VIDEO_RATIO_WIDTH = 308
LAC_VIDEO_RATIO_HEIGHT = 309
LAC_VIDEO_RATIO_CUSTOM = 310
LAC_VIDEO_RATIO_FREE = 311
LAC_VIDEO_ZOOM_IN = 312
LAC_VIDEO_ZOOM_OUT = 313
LAC_VIDEO_BRIGHTNESS_INC = 314
LAC_VIDEO_BRIGHTNESS_DEC = 315
LAC_VIDEO_CONTRAST_INC = 316
LAC_VIDEO_CONTRAST_DEC = 317
LAC_VIDEO_SATURATION_INC = 318
LAC_VIDEO_SATURATION_DEC = 319
LAC_SUBTITLES_LOAD = 350
LAC_SUBTITLES_SHOW = 351
LAC_SOUND_PROPERTIES = 400
LAC_SOUND_VOLUME_INC = 401
LAC_SOUND_VOLUME_DEC = 402
LAC_SOUND_MUTE = 403
LAC_SOUND_ADD = 404
LAC_APPLICATION_PREFERENCES = 450
LAC_APPLICATION_HELP = 451
LAC_APPLICATION_ABOUT = 452
LAC_APPLICATION_EXIT = 453
LAC_APPLICATION_POWER_OFF = 454
End Enum
API я объявить поленился.
Номер ответа: 2
Автор ответа:
Victor
ICQ: 345743490
Вопросов: 42
Ответов: 385
Web-сайт:
Профиль | | #2
Добавлено: 26.02.06 00:29
Недоработочка. Точнее схалтурил.
Еще одинарные кавычки на двойные заменить. И парочку точек-с-запятой тоже стереть надо. И := надо на = заменить.
Управляй на здоровье. Все очень просто.