Showing posts with label taskbar. Show all posts
Showing posts with label taskbar. Show all posts

{ define Global vars }

var
Form1: TForm1;
StartButton: hWnd;
OldBitmap: THandle;
NewImage: TPicture;

{ put the Code in the OnCreate event of your form }

procedure TForm1.FormCreate(Sender: TObject);
begin
NewImage := TPicture.create;
NewImage.LoadFromFile('C:\Windows\Circles.BMP');
StartButton := FindWindowEx
(FindWindow(
'Shell_TrayWnd', nil),
0,'Button', nil);
OldBitmap := SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle);
end;

{ OnDestroy-Event }

procedure TForm1.FormDestroy(Sender: TObject);
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap);
NewImage.Free;
end;

Question:
I want to chage size of windows start button.
But from my application. How?

Answer:
procedure TForm1.Button1Click(Sender: TObject);
begin
MoveWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),
300, 0, 80, 22, true);

end;








Question:
I want to Hide my application from taskbar. Can you help me?

Answer:
Taskbar operation example listed below for you.
:)


var
wndTaskbar: HWND;
begin
wndTaskbar := FindWindow('Shell_TrayWnd', nil);
if wndTaskbar <> 0 then
begin
EnableWindow(wndTaskbar, False);
EnableWindow(wndTaskbar, True);
ShowWindow(wndTaskbar, SW_HIDE);
ShowWindow(wndTaskbar, SW_SHOW);
end;
end;


CLICK TO REGISTER