Saturday, November 29, 2008

Javascript > Hacking Auto-Sizing IFRAME tag

<html>
<head>
<script type="text/javascript">

/***********************************************
* IFrame SSI script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function dyniframesize() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById){ //begin resizing iframe procedure
dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] && !window.opera){
dyniframe[i].style.display="block"
if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight+FFextraHeight;
else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
}
}
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

if (window.addEventListener)
window.addEventListener("load", dyniframesize, false)
else if (window.attachEvent)
window.attachEvent("onload", dyniframesize)
else
window.onload=dyniframesize

</script>
</head>

<body>

<iframe id="myframe" src="externalpage.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

</body>
</html>


Source : http://www.dynamicdrive.com/

Read More...

Friday, November 28, 2008

Delphi > Download Source Code KSpoold Disinfector

KSpoold Disinfector is a software that writen to restore Microsoft Office files (Word, Excel, PPT etc.) from damaged file because of KSpoold virus.

KSpoold infect the docs files by mergeing these docs to the virus file, original docs files will be delete & new file with the same name will be added to cheating the users with new file extention: .EXE So anytime you double click this infected file from explorer / open it using shell api your computer will be infected too.

The software is provided "as-is," without any express or implied warranty. In no event shall the Author be held liable for any damages arising from the use of the Software

The software is writen in Borland Delphi 7. Full source-code also provided, any comments are noted of the following:
"The const SAMPLE_SIZE = 524; is taken from the following figure: Microsoft Word & Excel using the same file header at the first 512, so we get unique header at the first 12 byte after 512 offset 512 + 12 = 524"

You can download sample of infected file by KSpoold here:
http://delphi-id.org/dpr/Downloads-index-req-viewdownloaddetails-lid-180.pas

Download Source Code

KSpoold Disinfector 1.0 - Freeware
Copyright © Indra Gunawan, 2ind@mail.com
www.delphiexpert.wordpress.com

Read More...

Sample HTML Help and Visual Basic 6 - Tutorial

When you distribute an application, there should be some guidance for your customers and/or users how to work with it. You can simply add a few HTML pages, but this will not allow you to use the often appreciated "what's this help", in form of the small question mark in your applications form borders. Neither does it look professional.

The purpose of this document/tutorial is showing you how to use HTML Help for a very simple help file, and how to 'attach' it to your application. Note that by no means this document has been written to teach you everything about HTML Help. This document focuses more on the actual help file, combined with your Visual Basic 6 application.

Download sample source code and tutorial

Read More...

VB > Get a drives drive and volume info


Declare Function GetVolumeInformation Lib _
"kernel32" Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long

Declare Function GetDriveType Lib "kernel32" _
Alias "GetDriveTypeA" (ByVal nDrive As String) As Long


Private Sub cmdGetVol_Click()

Dim VolName As String, FSys As String, erg As Long
Dim VolNumber As Long, MCM As Long, FSF As Long
Dim Drive As String, DriveType As Long

VolName = Space(127)
FSys = Space(127)

Drive = "C:\" 'Enter the driverletter you want
DriveType& = GetDriveType(Drive$)

erg& = GetVolumeInformation(Drive$, VolName$, 127&, _
VolNumber&, MCM&, FSF&, FSys$, 127&)

Print "VolumeName:" & vbTab & VolName$
Print "VolumeNumber:" & vbTab & VolNumber&
Print "MCM:" & vbTab & vbTab & MCM&
Print "FSF:" & vbTab & vbTab & FSF&
Print "FileSystem:" & vbTab & FSys$
Print "DriveType:" & vbTab & DriveType&;

End Sub

Read More...

VB > Add a 3D Effect to Forms, Textboxes, and Labels


'Set form's AutoRedraw property toTrue
Sub PaintControl3D(frm As Form, Ctl As Control)
' This Sub draws lines around controls to make them 3d

' darkgrey, upper - horizontal
frm.Line (Ctl.Left, Ctl.Top - 15)-(Ctl.Left + _
Ctl.Width, Ctl.Top - 15), &H808080, BF
' darkgrey, left - vertical
frm.Line (Ctl.Left - 15, Ctl.Top)-(Ctl.Left - 15, _
Ctl.Top + Ctl.Height), &H808080, BF
' white, right - vertical
frm.Line (Ctl.Left + Ctl.Width, Ctl.Top)- _
(Ctl.Left + Ctl.Width, Ctl.Top + Ctl.Height), &HFFFFFF, BF
' white, lower - horizontal
frm.Line (Ctl.Left, Ctl.Top + Ctl.Height)- _
(Ctl.Left + Ctl.Width, Ctl.Top + Ctl.Height), &HFFFFFF, BF

End Sub

Sub PaintForm3D(frm As Form)
' This Sub draws lines around the Form to make it 3d

' white, upper - horizontal
frm.Line (0, 0)-(frm.ScaleWidth, 0), &HFFFFFF, BF
' white, left - vertical
frm.Line (0, 0)-(0, frm.ScaleHeight), &HFFFFFF, BF
' darkgrey, right - vertical
frm.Line (frm.ScaleWidth - 15, 0)-(frm.ScaleWidth - 15, _
frm.Height), &H808080, BF
' darkgrey, lower - horizontal
frm.Line (0, frm.ScaleHeight - 15)-(frm.ScaleWidth, _
frm.ScaleHeight - 15), &H808080, BF

End Sub

'DEMO USAGE
'Add 1 label and 1 textbox

Private Sub Form_Load()

Me.AutoRedraw = True
PaintForm3D Me
PaintControl3D Me, Label1 'Label1 is name of label
PaintControl3D Me, Text1 'Text1 is name of textbox

End Sub

Read More...

How to show-hide a combo drop down list on VB

Public Declare Function SendMessageLong Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

Public Const CB_SHOWDROPDOWN = &H14F
Sub Form_Load()
Combo1.AddItem "Item 1"
Combo1.AddItem "Item 2"
Combo1.AddItem "Item 3"
End Sub

Private Sub Command1_Click()
Dim r as Long
r = SendMessageLong(Combo1.hWnd, CB_SHOWDROPDOWN, True, 0)
End Sub

Private Sub Command2_Click()
Dim r as Long
r = SendMessageLong(Combo1.hWnd, CB_SHOWDROPDOWN, False, 0)
End Sub

Read More...

Tuesday, November 25, 2008

Active scripting component: Windows script host control for Delphi

Windows Scripting Host Control enables Delphi application to support active scripting languages installed in Windows Scripting Host (such as VB Script, Java Script, Perl, Python, Lua, Tcl etc).TekWSHControl allows to use Delphi objects in script, including use of published properties, running public and published methods, setting script procedures as event handlers, call unit procedures and functions from script, use unit variables etc.Version 2.5 basic features and improvements: (See previous history at http://www.ekassw.com/wshctrl/index.html) - Public methods of Delphi objects calls from script supported - Delphi unit routines (procedures and functions) from script supported - Access to Delphi unit variables from script supported - Minor bugs in wrapper expert fixed

License: Freeware
File Size : 565.0 KB
Download Link : http://www.sourcecodeonline.com/download.php?id=37637&n=1

Read More...

Latest Comments

About Me

My photo
Makassar, Sulawesi Selatan, Indonesia

Guest Book


ShoutMix chat widget

Script Sense ©Template Blogger Green by Dicas Blogger.

TOPO