Delphi va Windows

Delphi va Windows

Delphi va Windows

Windows operastion tizimi foydalanuvchilariga noqulaylik tug’dirish yo’llaridan biri bu operastion tizimni noodatiy yo’l bilan ishlashga majburlashdir.

Bu ishni delphi yordamida amalga oshirish mumkin. Quyida keltirilgan kodlardan foydalanib, delphi da bajariluvchi(exe) fayl yarating va uni ishga tushirib yuboring vassalom. :)

1. «ПУСК» tugmasini qotirib qo’yish.

EnableWindow(FindWindowEx(FindWindow(‘Shell_TrayWnd’, nill), 0, ‘button’, nill), false);

1.2 «ПУСК»ni o’z holiga qaytarish

EnableWindow(FindWindowEx(FindWindow(‘Shell_TrayWnd’, nill), 0, ‘button’, nill), true);

2. Ishchi stol(Рабочий стол) ni tozalash

ShowWindow(FindWindow(nill, ‘ProgramManager’), sw_Hide);

2.1 Ishchi stol(Рабочий стол) ni o’z holiga keltirish

ShowWindow(FindWindow(nill, ‘ProgramManager’), sw_Show);

3. Sichqoncha(мыш) knopkasini almashtirish

SwapMouseButton(true);

3.1 Sichqoncha (мыш) knopkasini o’z joyiga qaytarish

SwapMouseButton(false);

4. Windows ni qayta yuklash

ExitWindows(EW_RestartWindows,0); yoki ExitWindows(EW_ReBootSystem,0);

5. Yaratilgan dasturni «автозагрузка» ga o’rnatish

Uses registry;

—/—/—/

—/—/—/

var reg:Tregistry;

begin

reg:=TRegIniFile.Create;

reg.RootKey:=HKey_Local_Machine;

reg.OpenKey(‘Software’, true);

reg.OpenKey(‘Microsoft’, true);

reg.OpenKey(‘Windows’, true);

reg.OpenKey(‘CurrentVersion’, true);

reg.OpenKey(‘Run’, true);

reg.WriteString(‘Dastur-nomi’, Application.ExeName)

reg.closeKey;

reg.Free;

6. Caps-Lock ni yoqish va o’chirish

if getKeyState(VK_Capital) and 1=0 then

Form1.Caption:=’caps no’

else

Form1.Caption:=’caps ok’;

7. «ПУСК» ni ishga tushirish

SendMessage(Self.Handle, WM_SysCommand, sc_TaskList, 0);

8. Panel zadach ni berkitish

ShowWindow(FindWindow(‘Shell_TrayWnd’, nill), sw_hide);

9.Panel zadach ni ko’rsatish

ShowWindow(FindWindow(‘Shell_TrayWnd’, nill), sw_show);

10. Ovoz chiqaradigan funkstiya

Beep;

11. Silka yaratish

uses shellapi;

—/—/—/

ShellExecute(Application.Handle, nil, ‘http:www.localhost/wordpress’, nil, nil, sw_shownormal);

12. Kursorni yo’q qilish

showCursor(false);

13. CD-ROM ni ochish

uses MMSYSTEM;

—/—/—/

mciSendString(‘Set cdaudio door open wait’, nil, 0, Form1.Handle);

13.1. CD-ROM ni yopish

uses MMSYSTEM;

—/—/—/

mciSendString(‘Set cdaudio door closed wait’, nil, 0, Form1.Handle);

14. MSDOS komandalarini ishlatish. sw_restore-komanda bajarilishini ko’rish uchun

WinExec(‘dir d:’, sw_Restore);

15. Faylni istalgan redaktorda ochish

uses shellapi;

—/—/—/

shellexecute(handle ,’open’, pchar(‘notepad’), pchar(‘fayl adresi’), nil, sw_show);

Manba:

Umumiy Dasturlash
Delphi va Windows