moon44
Joined: 01 Feb 2005 Posts: 2
|
Posted: Tue Feb 01, 2005 6:52 pm Post subject: Cannot use %Var% for Hotkey |
|
|
First: Sorry for my bad english. This is my first AHK- and GUI-Script. This script controls e.g. the volume from winamp. i know, winamp has global keys, but not for mouseactions.
My Problem: The script doesn´t use my %Var% for Hotkeydefinition The Var is available. i tested it with clipboard = %Var%...
Have a look:
| Code: |
;Init --------------------------------------------------------------------------------
RegUrl = Software\FreemanTools
App = ahk_class Winamp v1.x
; Read Hotkeys from Registry ----------------------------------------------------------
RegRead, Player, HKEY_CURRENT_USER, %RegUrl%, CurrentPlayer
RegRead, Player_VolUp, HKEY_CURRENT_USER, %RegUrl%, VolUp
RegRead, Player_VolDown, HKEY_CURRENT_USER, %RegUrl%, VolDown
RegRead, Player_nextTrack, HKEY_CURRENT_USER, %RegUrl%, NextTrack
RegRead, Player_prevTrack, HKEY_CURRENT_USER, %RegUrl%, PrevTrack
RegRead, Player_Pause, HKEY_CURRENT_USER, %RegUrl%, PauseTrack
; Create GUI --------------------------------------------------------------------------
Gui, Add, Picture, x0 y0 w250 h85, img
; Define Hotkeys
Gui, Add, GroupBox, x0 y90 w250 h130, HotKeys
Gui, Add, Text, x10 y113 w160 h20, Volume Up
Gui, Add, Text, x10 y133 w160 h20, Volume Down
Gui, Add, Text, x10 y153 w160 h20, Next Track
Gui, Add, Text, x10 y173 w160 h20, Prev. Track
Gui, Add, Text, x10 y193 w160 h20, Pause Track
Gui, Add, Edit, vPlayer_VolUp x80 y110 w160 h20, %Player_VolUp%
Gui, Add, Edit, vPlayer_VolDown x80 y130 w160 h20, %Player_VolDown%
Gui, Add, Edit, vPlayer_nextTrack x80 y150 w160 h20, %Player_nextTrack%
Gui, Add, Edit, vPlayer_prevTrack x80 y170 w160 h20, %Player_prevTrack%
Gui, Add, Edit, vPlayer_Pause x80 y190 w160 h20, %Player_Pause%
; Define Player
Gui, Add, GroupBox, x0 y220 w250 h50, Player
Gui, Add, Radio, vPlayer x20 y240 w120 h20 vRadio checked, Winamp V5.x
Gui, Add, Button, x0 y270 w250 h30, Aktivieren
Gui, Show, x165 y399 h300 w250, FreemanTools v.1.0
Return
GuiClose:
ButtonAktivieren:
Gui, submit
; Write Hotkeys from Registry --------------------------------------------------------
RegWrite, REG_SZ, HKEY_CURRENT_USER, %RegUrl%, VolUp, %Player_VolUp%
RegWrite, REG_SZ, HKEY_CURRENT_USER, %RegUrl%, VolDown, %Player_VolDown%
RegWrite, REG_SZ, HKEY_CURRENT_USER, %RegUrl%, NextTrack, %Player_nextTrack%
RegWrite, REG_SZ, HKEY_CURRENT_USER, %RegUrl%, PrevTrack, %Player_prevTrack%
RegWrite, REG_SZ, HKEY_CURRENT_USER, %RegUrl%, PauseTrack, %Player_Pause%
; Define Keys ------------------------------------------------------------------------
if Player = Winamp
{
::%Player_VolUp%:: PostMessage, 0x111, 40058, 0, , %App% ; Vol Up
; -----------------------------------------------------------------------------------
; This Line works fine ...
; #2:: PostMessage, 0x111, 40058, 0, , %App% ; Vol Up
; -----------------------------------------------------------------------------------
::%Player_VolDown%:: PostMessage, 0x111, 40059, 0, , %App% ; Vol Down
::%Player_nextTrack%:: PostMessage, 0x111, 40044, 0, , %App% ; Previous track
::%Player_prevTrack%:: PostMessage, 0x111, 40048, 0, , %App% ; Next track
::%Player_Pause%:: PostMessage, 0x111, 40046, 0, , %App% ; Pause/Unpause
} |
|
|