Wiskas =[O_o]=
Сообщений: 30
Оценки: 0
Присоединился: 2007-12-16 01:35:19.740000
|
Попробуй их просто заменить своими :)
unit Unit1;
interface
uses
Windows, Messages, Forms, Dialogs, jpeg, Classes, Controls, ExtCtrls;
type
TForm1 = class(TForm)
Image: TImage;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ImageClick(Sender: TObject);
private
id1, id2, id3, id4, id5: Integer;
procedure WMHotKey(var Msg: TWMHotKey);message WM_HOTKEY;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMHotKey(var Msg: TWMHotKey);
begin
if Msg.HotKey = id1 then WinExec(PChar('explorer.exe C:\'), SW_Show);
if Msg.HotKey = id2 then WinExec(PChar('explorer.exe D:\'), SW_Show);
if Msg.HotKey = id3 then WinExec(PChar('explorer.exe E:\'), SW_Show);
if Msg.HotKey = id4 then WinExec(PChar('explorer.exe F:\'), SW_Show);
if Msg.HotKey = id5 then WinExec(PChar('explorer.exe G:\'), SW_Show);
end;
procedure TForm1.FormCreate(Sender: TObject);
const
{Спец кнопы}
VK_Alt = 1;
VK_Ctrl = 2;
VK_Shift = 4;
VK_Win = 8;
{Буквы}
VK_A = 65;
VK_B = 66;
VK_C = 67;
VK_D = 68;
VK_E = 69;
VK_F = 70;
VK_G = 71;
VK_H = 72;
VK_I = 73;
VK_J = 74;
VK_K = 75;
VK_L = 76;
VK_M = 77;
VK_N = 78;
VK_O = 79;
VK_P = 80;
VK_Q = 81;
VK_R = 82;
VK_S = 83;
VK_T = 84;
VK_U = 85;
VK_V = 86;
VK_W = 87;
VK_X = 88;
VK_Y = 89;
VK_Z = 90;
{Цыфры}
VK_0 = 48;
VK_1 = 49;
VK_2 = 50;
VK_3 = 51;
VK_4 = 52;
VK_5 = 53;
VK_6 = 54;
VK_7 = 55;
VK_8 = 56;
VK_9 = 57;
{Доп кнопы}
VK_F4 = 115;
begin
// Register Hotkey Ctrl + Shift + C
id1 := GlobalAddAtom('Hotkey1');
RegisterHotKey(Handle, id1, VK_Ctrl + VK_Shift, VK_C);
// Register Hotkey Ctrl + Shift + D
id2 := GlobalAddAtom('Hotkey2');
RegisterHotKey(Handle, id2, VK_Ctrl + VK_Shift, VK_D);
// Register Hotkey Ctrl + Shift + E
id3 := GlobalAddAtom('Hotkey3');
RegisterHotKey(Handle, id3, VK_Ctrl + VK_Shift, VK_E);
// Register Hotkey Ctrl + Shift + F
id4 := GlobalAddAtom('Hotkey4');
RegisterHotKey(Handle, id4, VK_Ctrl + VK_Shift, VK_F);
// Register Hotkey Ctrl + Shift + G
id5 := GlobalAddAtom('Hotkey5');
RegisterHotKey(Handle, id5, VK_Ctrl + VK_Shift, VK_G);
end;
{ Отключить горящие кнопки }
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(Handle, id1);
UnRegisterHotKey(Handle, id2);
UnRegisterHotKey(Handle, id3);
UnRegisterHotKey(Handle, id4);
UnRegisterHotKey(Handle, id5);
end;
procedure TForm1.ImageClick(Sender: TObject);
begin
ShowWindow(Handle,SW_HIDE);
ShowWindow(Application.Handle,SW_HIDE);
end;
end.
Думаю код понятен, так что вперед! ЗЫ: ну если все совсем … то пиши
|