مشاهدة النسخة كاملة : تغيير مكان زر إبدأ
paix144
16-12-2009, 03:04 PM
السلام عليكم
هذا كود سورس لتغيير مكان زر إبدأ
kachwahed
20-12-2009, 11:50 AM
جميل جدا...
MoveWindow(FindWindowEx(FindWindow('Shell_TrayWnd' , nil), 0, 'Button', nil), x, y, nWidth, nHeight, True);
قديم الشوق
07-01-2010, 01:29 PM
اذا امكن تفصيل الكود البرمجي
1- كيف اجعل الحركه آليه --- (بقيمة ثابته) -- و كيف اجعله ينطلق من 0 الى نهاية شريط المهام بالكود
وجزااك الله خيراً
محمد س
31-01-2010, 05:06 PM
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Déclarations privées }
lar:Integer;
fpo:TRect;
H,Hand: THandle;
b:boolean;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Const
Pas=10;
procedure FindChildWindows(Ha: Integer);
var
h: THandle;
begin
h := GetWindow(Ha, GW_CHILD);
While h <> 0 do
Begin
InvalidateRect(H,nil,True);
FindChildWindows(h);
h := GetWindow(h, GW_HWNDNEXT);
End;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
po:TRect;
begin
// Application.ShowMainForm:=False;
H := FindWindow('Shell_TrayWnd', nil);
Hand := FindWindowEx(H, 0, 'Button', nil);
GetWindowRect(H,Po);
GetWindowRect(Hand,fPo);
fpo.Bottom:=fpo.Bottom-fpo.Top;
fpo.Top:=0;
fpo.Right:=fpo.Right-fpo.Left;
lar:=po.Right;
b:=False;
Timer1:=TTimer.Create(nil);
Timer1.Enabled:=False;
Timer1.OnTimer:=Timer1Timer;
Timer1.Interval:=100;
Timer1.Enabled:=true;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Timer1.Enabled:=False;
Timer1.Free;
MoveWindow(Hand,0,0,fpo.Right,fpo.Bottom,false);
InvalidateRect(H,nil,True);
FindChildWindows(h);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
n:integer;
begin
case b of
False:begin
n:=fpo.Left+pas;
if n+fpo.Right<lar then fpo.Left:=n
else b:=True;
end;
True:begin
if fpo.Left>pas then fpo.Left:=fpo.Left-pas
else b:=False;
end;
end;
MoveWindow(Hand,fpo.Left,fpo.Top,fpo.Right,fpo.Bot tom,false);
InvalidateRect(H,nil,True);
FindChildWindows(h);
end;
end.
محمد س
31-01-2010, 05:46 PM
أو en mode consol
program Project1;
{$APPTYPE CONSOLE}
uses
Windows,
Messages;
Const
Pas=10;
var
lar:Integer;
fpo:TRect;
H,Hand,Timer: THandle;
b:boolean;
procedure FindChildWindows(Ha: Integer);
var
h: THandle;
begin
h := GetWindow(Ha, GW_CHILD);
While h <> 0 do
Begin
InvalidateRect(H,nil,True);
FindChildWindows(h);
h := GetWindow(h, GW_HWNDNEXT);
End;
end;
procedure Timer1Timer;
var
n:integer;
begin
case b of
False:begin
n:=fpo.Left+pas;
if n+fpo.Right<lar then fpo.Left:=n
else b:=True;
end;
True:begin
if fpo.Left>pas then fpo.Left:=fpo.Left-pas
else b:=False;
end;
end;
MoveWindow(Hand,fpo.Left,fpo.Top,fpo.Right,fpo.Bot tom,false);
InvalidateRect(H,nil,True);
FindChildWindows(h);
end;
procedure FormCreate;
var
po:TRect;
begin
Timer:=SetTimer(0,0,100,nil);
H := FindWindow('Shell_TrayWnd', nil);
Hand := FindWindowEx(H, 0, 'Button', nil);
GetWindowRect(H,Po);
GetWindowRect(Hand,fPo);
fpo.Bottom:=fpo.Bottom-fpo.Top;
fpo.Top:=0;
fpo.Right:=fpo.Right-fpo.Left;
lar:=po.Right;
b:=False;
end;
Procedure FormDestroy(n:Dword);
begin
MoveWindow(Hand,0,0,fpo.Right,fpo.Bottom,false);
InvalidateRect(H,nil,True);
FindChildWindows(h);
KillTimer(Timer,0);
end;
var
Msg: TMsg;
begin
SetConsoleCtrlHandler(@FormDestroy,True);
FormCreate;
repeat
if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) and
(msg.message=WM_TIMER) then Timer1Timer;
until False;
end.
من أجل العمل في الخفاء يكفي حذف {$APPTYPE CONSOLE}
قديم الشوق
03-02-2010, 07:37 PM
هذا الرد لي وألا مشاركه منك في الموضوع
وشكراً
محمد س
03-02-2010, 08:04 PM
هذا الرد لي وألا مشاركه منك في الموضوع
وشكراً
لك طبعا :brow:
قديم الشوق
04-02-2010, 12:26 AM
الله يجزاك خير
يليت تضع الرسورس طبقت وطلع عندي أخطأ
وجزاك الله خير
محمد س
04-02-2010, 12:36 PM
الله يجزااك خير
يليت تضع الرسورس طبقت وطلع عندي أخطأ
وجزااك الله خير
أنا أستعمل delphi6
أما السورس، ما عليك إلا نقل الكود الثاني الذي يعمل في mode consol
قديم الشوق
06-02-2010, 11:03 PM
هناك أخطاء في الكود الأول
اما الكود الثاني يعمل تمام
وشكراً
vBulletin® , Copyright ©2008-2012