Do what you like, like what you do !

BagusSPlayIt

by on Aug.14, 2012, under Andorid, Programming

I currently developing media player which cannot be close by back & home button on Android.

If it already finished I’ll share the code here :p

 

Share this on FB
2 Comments more...

Custom PHP.ini & .htaccess

by on Jul.20, 2012, under Information Technology, PHP, Programming

To use a custom php.ini file with SuPHP for a website, you can define the path to the php.ini file in a .htaccess file or in the apache vhost like this:

suPHP_ConfigPath /home/websites/domain.com/

then save as .htaccess file

=====================

and create PHP.ini file then input these :

session.save_path = “/home/yourserver/public_html/yourdirectory/tmp”
magic_quotes_gpc = On

 

Done.

Leave a Comment more...

Pitu Sekop

by on Aug.31, 2010, under Games, Sundry

7Scoop

7Scoop Development is DONE.

please get here (updated with Help Game)

 

if (want_source_code) then PM;

Leave a Comment more...

Hide Application Button on Taskbar

by on May.11, 2010, under Delphi, Information Technology, Programming

procedure TMainForm.FormCreate(Sender: TObject) ;
begin
   ShowWindow(Application.Handle, SW_HIDE) ;
   SetWindowLong(Application.Handle, GWL_EXSTYLE, getWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW) ;
   ShowWindow(Application.Handle, SW_SHOW) ;
end;
Share this on FB
6 Comments more...

Send Email from Outlook

by on Apr.26, 2010, under Delphi, Information Technology, Programming

uses  ComObj;

procedure TForm1.Button1Click(Sender: TObject);
const
  olMailItem = 0;
  olByValue = 1;
var
  OutlookApp, MailItem, MyAttachments: OLEVariant;
begin
  try
    OutlookApp := GetActiveOleObject('Outlook.Application');
  except
    OutlookApp := CreateOleObject('Outlook.Application');
  end;
  try
    MailItem := OutlookApp.CreateItem(olMailItem);
    MailItem.Recipients.Add('bsujarwo@rpxholding.com');
    MailItem.Subject := 'Test';
    MailItem.Body    := 'Message';
    myAttachments    := MailItem.Attachments;
    myAttachments.Add('C:\aaa.txt', olByValue, 1, 'Name of Attachment');
    MailItem.Send;
  finally
    myAttachments := VarNull;
    OutlookApp    := VarNull;
  end;
end;
Leave a Comment more...

Round To N digits

by on Apr.17, 2010, under Delphi, Information Technology, Programming

function RoundTo(AReal:extended; NrDecs:integer):extended;
var tmp:extended;
begin
  tmp := Exp(NrDecs * Ln(10));
  Result := Round(AReal * tmp) / tmp;
end;
2 Comments more...

Check connection to Internet

by on Apr.17, 2010, under Delphi, Information Technology, Programming

procedure TForm1.Button1Click(Sender: TObject) ;
  function FuncAvail(_dllname, _funcname: string;
                     var _p: pointer): boolean;
  {return True if _funcname exists in _dllname}
  var _lib: tHandle;
  begin
   Result := false;
   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;

  {
  Call SHELL32.DLL for Win < Win98
  otherwise call URL.dll
  }
  {button code:}
  var
   InetIsOffline : function(dwFlags: DWORD):
                   BOOL; stdcall;
begin
   if FuncAvail('URL.DLL', 'InetIsOffline',
                @InetIsOffline) then
    if InetIsOffLine(0) = true
     then ShowMessage('Not connected')
     else ShowMessage('Connected!') ;
end;
Leave a Comment more...

PC Speaker

by on Apr.11, 2010, under Delphi, Information Technology, Programming

procedure SetPort(address, Value: Word) ;
var
   bValue: Byte;
begin
   bValue := trunc(Value and 255) ;
   asm
     mov dx, address
     mov al, bValue
     out dx, al
   end;
end;

function GetPort(address: Word): Word;
var
   bValue: Byte;
begin
   asm
     mov dx, address
     in al, dx
     mov bValue, al
   end;
   GetPort := bValue;
end;

procedure Sound(aFreq, aDelay: Integer) ;
   procedure DoSound(Freq: Word) ;
   var
     B: Byte;
   begin
     if Freq > 18 then
     begin
       Freq := Word(1193181 div Longint(Freq));
       B := Byte(GetPort($61));

       if (B and 3) = 0 then
       begin
         SetPort($61, Word(B or 3));
         SetPort($43, $B6);
       end;

       SetPort($42, Freq);
       SetPort($42, Freq shr 8);
     end;
   end;

   procedure Delay(MSecs: Integer) ;
   var
     FirstTickCount: LongInt;
   begin
     FirstTickCount := GetTickCount;
     repeat
       Sleep(1) ;
       //or use Application.ProcessMessages instead of Sleep
     until ((GetTickCount - FirstTickCount) >= Longint(MSecs)) ;
   end;

begin
   if Win32Platform = VER_PLATFORM_WIN32_NT then
   begin
     Windows.Beep(aFreq, aDelay) ;
   end
   else
   begin
     DoSound(aFreq);
     Delay(aDelay);
   end;
end;

procedure NoSound;
var
   Value: Word;
begin
   if not (Win32Platform = VER_PLATFORM_WIN32_NT) then
   begin
     Value := GetPort($61) and $FC;
     SetPort($61, Value) ;
   end;
end;

// Example:
procedure TForm1.Button1Click(Sender: TObject) ;
begin
   Sound(500, 1000) ;
   Sound(700, 1000) ;
   Sound(900, 1000) ;
   NoSound;
end;
Leave a Comment more...

Get/Set Cursor Position

by on Apr.07, 2010, under Delphi, Information Technology, Programming

procedure TForm1.Button1Click(Sender: TObject);
var pt:tpoint;
begin
   getcursorpos(pt);
   showmessage('The cursor pos. is: x='+inttostr(pt.x)+' y='+inttostr(pt.y));
end;

procedure TForm1.Button2Click(Sender: TObject);
var pt:tpoint;
begin
   pt.x:=15;
   pt.y:=98;
   setcursorpos(pt.x,pt.y);
   showmessage('The cursor pos. is: x='+inttostr(pt.x)+' y='+inttostr(pt.y));
end;
Leave a Comment more...

Emulate Keyboard Press

by on Mar.30, 2010, under Delphi, Information Technology, Programming

procedure TForm1.Button1Click(Sender: TObject);
begin
  // Misalnya kalo mau pencet WinKey + D (Toggle Show/Hide Desktop)
  Keybd_event(VK_LWIN, 0, 0, 0);
  Keybd_event(Byte('D'), 0, 0, 0);
  Keybd_event(Byte('D'), 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);

  // kalo mau pencet WinKey + L (Lock PC)
  Keybd_event(VK_LWIN, 0, 0, 0);
  Keybd_event(Byte('L'), 0, 0, 0);
  Keybd_event(Byte('L'), 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);

  // kalo mau pencet CTRL + SHIFT + ESC (Task Manager/CTRL+ALT+DEL)
  Keybd_event(VK_CONTROL, 0, 0, 0);
  Keybd_event(VK_SHIFT, 0, 0, 0);
  Keybd_event(VK_ESCAPE, 0, 0, 0);
  Keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
end;
1 Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!