[ Outline ] · Standard · Linear+

> Windows Xp Trikowi, Owo je ipak zanimljivije i korisnije...

NeverMore21
post Dec 29 2006, 09:58 PM
Post #1





Group: Članovi
Joined: 21-September 06
From: 21. блок
Member No.: 115
Status: Učenik MGa
Ime i prezime: Bojan Zukic
Škola/Razred: Matematicka gimnazija IVb



E owako...Poshto su se swi wec smorili sa tipichnim algoritmima vezanih za brojeve, stringowe, nizowe itd. (zadaci sa bloka), ewo nove teme koja ce valjda biti zanimljivija i ne bash tako monotona! Swi koji hoce (i znaju) neka owde postuju funkcije i procedure vezane za Windows XP (znaci pre svega Win API)!!! I bez funkicja tipa: kako dobiti 3. znak iz verzije Service Pack-a, i slicno!!! Za pocetak, postovacu neke korisne funkcije i procedure!!! Ali u drugom postu!!! Pozzzz


--------------------
user posted image
user posted image
user posted image
user posted image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Replies
NeverMore21
post Dec 31 2006, 02:30 PM
Post #2





Group: Članovi
Joined: 21-September 06
From: 21. блок
Member No.: 115
Status: Učenik MGa
Ime i prezime: Bojan Zukic
Škola/Razred: Matematicka gimnazija IVb



OK, ewo stize nowi paket kodowa biggrin.gif

Sledecim kodom mozete blokirati misha i tastaturu (poziwaju se originalne funkcije iz USER32 biblioteke):
CODE

function FuncAvail (_dllname, _funcname: string; var _p: pointer): boolean;
var _lib: tHandle;
begin
   Result := false;
   _p := NIL;
   if LoadLibrary(PChar(_dllname)) = 0 then exit;
   _lib := GetModuleHandle(PChar(_dllname));
   if _lib <> 0 then
    begin
    _p := GetProcAddress(_lib, PChar(_funcname));
    if _p <> NIL then Result := true;
    end;
end;


i onda je pozowete na owaj nacin:
CODE

procedure TForm1.Button1Click(Sender: TObject);
var
   xBlockInput : function(Block: bool):  bool;  stdcall;
begin
  if FuncAvail
   ('USER32.DLL', 'BlockInput', @xBlockInput) then
  begin
   xBlockInput(true);
   Sleep(5000);
   xBlockInput(false);
  end;
end;




Sledeci kod prikazuje desktop (minimizuje swe programe):
CODE

procedure ShowDesktop;
begin
keybd_event( VK_LWIN, MapvirtualKey( VK_LWIN, 0), 0, 0 );
keybd_event( Ord('D'), MapvirtualKey( Ord('D'), 0), 0, 0 );
keybd_event( Ord('D'), MapvirtualKey( Ord('D'), 0), KEYEVENTF_KEYUP, 0 );
keybd_event( VK_LWIN, MapvirtualKey( VK_LWIN, 0), KEYEVENTF_KEYUP, 0 );
end;


Owom funkcijom citate HomePage iz Registry-a:
CODE

uses
Registry;


function GetIEStartPage: string;
var
 Reg: TRegistry;
begin
 Reg := TRegistry.Create;
 try
   Reg.RootKey := HKEY_CURRENT_USER;
   Reg.OpenKey('Software\Microsoft\Internet Explorer\Main', False);
   try
     Result := Reg.ReadString('Start Page');
   except
     Result := '';
   end;
   Reg.CloseKey;
 finally
   Reg.Free;
 end;
end;


I na kraju ewo koda koji menja pozadinu desktopa (ne radi na swim konfiguracijama):
CODE

procedure MenjajPozadinu(putanja: string);
begin
if fileexists(putanja) then
begin

 if  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, Pointer(putanja),
   SPIF_SENDWININICHANGE) then    ShowMessage('Wallpaper uspesno promenjen!') else
   ShowMessage('Promena wallpaper-a nije uspela!');       end else
   ShowMessage('Putanja do datoteke nije pronadjena!');
end;



Eto, pa ako ima pitanja postujte biggrin.gif! Nema shta, ipak je owaj API mocna stwar cheers.gif


--------------------
user posted image
user posted image
user posted image
user posted image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
NeverMore21   Windows Xp Trikowi   Dec 29 2006, 09:58 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 29 2006, 10:29 PM
RZA   RE: Windows Xp Trikowi   Dec 29 2006, 10:38 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 29 2006, 10:46 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 29 2006, 10:50 PM
bone_fletcher   RE: Windows Xp Trikowi   Dec 29 2006, 11:29 PM
pyost   RE: Windows Xp Trikowi   Dec 29 2006, 10:51 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 29 2006, 10:53 PM
Eli0t   RE: Windows Xp Trikowi   Dec 29 2006, 11:47 PM
Iva   RE: Windows Xp Trikowi   Dec 30 2006, 09:17 AM
NeverMore21   RE: Windows Xp Trikowi   Dec 30 2006, 12:25 PM
Puzzler   RE: Windows Xp Trikowi   Dec 31 2006, 01:22 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 31 2006, 01:38 PM
^_NiN0_^   RE: Windows Xp Trikowi   Dec 31 2006, 02:13 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 31 2006, 02:15 PM
NeverMore21   RE: Windows Xp Trikowi   Dec 31 2006, 02:30 PM


Reply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: