Hi all,<br/> I want to share some use full threads I found
This query will add Serial or Row Numbers 1,2,3...(ascending order) in the result set of any databaseSELECT CustCode, CustName, (SELECT COUNT(*) FROM Customers C2 WHERE C2.CustCode <= C.CustCode) AS SrNoFROM Customers CORDER BY CustCodeThis will add numbers ...3,2,1 (decending order)[SELECT C...
83 byte By
sessi4ml at 2007-12-4 21:41:41
Here some Icon files that maybe useful. I have used them many times in my projects.
I'm not sure if this is better in the assembly language section, but please feel free to move the post.As a newbie to assembly language, I recently found myself searching for something online that will help me practice my hex math. After all, every book I read about asm, whether 16-bit or 3...
Recently I had a problem where users when trying to click on a mailto button would get an error "The command line argument is notvalid". Which required a fix ... http://support.microsoft.com/default.aspx?scid=kb;en-us;312346&Product=ol2002 So then I decided to use the outlook model, then a new er...
887 byte By
XRsTX at 2007-12-4 10:17:16
I converted this from VB6 into Javascript: function CalculatePi() // Calculates Pi by counting all the points around a circle making it easier and randomizing it. { var TOTAL_POINTS = new Number(1000000); // points in pi (3.14159) var x = new Number(); var y = new Number(); var points_in...
825 byte By
XRsTX at 2007-12-4 10:17:15
Yes I know you can use:Math.atan2(y,x), but I created this awhile ago when I was first starting and thought maybe someone would like it: function Atan2(y,x) { var theta = new Number(); var str = new String(); if (String.fromCharCode(x) < 0.0000001) { if (String.fromCharCode(y) <...
2796 byte By
penagate at 2007-12-4 6:31:54
I have created an XSLT stylesheet for applying to vBulletin Private Message archive files in XML format. This stylesheet will present the XML archive as readable XHTML/HTML with expandable and contractable folders/messages.Demonstration screenshot: http://www.vbforums.com/attachment.php?attachmen...
1226 byte By
mendhak at 2007-12-4 6:24:22
How to remove all duplicate rows from a SQL Server tableDECLARE @iErrorVar int,@vchFirstname INT,@iReturnCode int,@vchAddress1 varchar(100),@iCount int,@chCount char(3),@nvchCommand nvarchar(4000)DECLARE DelDupe CURSOR FORSELECT COUNT(*) AS Amount,liCompanyIdFROM CompanyDetailsGROUP BY liCompany...
The following query will list all of the Foreign Keys in your database. It returns the name of the FKey, the source table (where the FKey resides) the destination table (that has the PKey linked to) and the column in both tables involved. It also lists any CASCADE action (if any).SelectObject_Na...
2295 byte By
Zervic at 2007-12-4 3:11:54
First off, credits go to a friend...Using the following: http://thundervb.profitux.cz/go.php?adr=home'Note double dereference because passing byrefPublic Function CheckBits(lngNumber As Long, lngTest As Long) As Boolean '#asm' mov eax,[esp+4] ;Move pointer to lngNum...
243 byte By
iPrank at 2007-12-4 3:09:02
The gems I've found.<br/>And the craps I've written.<br/>.NET<br/>Api<br/>Printing / Text Editing / PDF<br/>General<br/>Registry, INI and Application Settings<br/>File / Folder / Drive<br/>WebBrowser & Internet Related
584 byte By
wossname at 2007-12-3 23:13:12
Here is a very basic ASM Include file that contains a subroutine that draws a colored stringThe file contains comments to explain syntax and stuff like that. The file also contains a few TEXTEQU constants that define corners and lines that you can use to draw ASCII art borders and stuff on scre...
Not too much explanation needed for this one. :)Option ExplicitPrivate Sub Command1_Click() Dim oUser As Object Set oUser = GetObject("WinNT://ComputerName/UserName") If oUser.AccountDisabled = True Then MsgBox oUser.Name & " Disabled!" Else MsgBox oUser.Name & " Enable...
This code will disable the 'x' close button on a Office VBA UserForm. Demo with Excel 2003.Note: you need to give the user a method of exiting the form or they will be forced to close the app if you also show the user form modally (default).Also, you need to Enable Macros for the attac...
You can create a new user in Active Directory with this code.<br/>Dim adObj As Object<br/>Dim adUser As Object<br/>Set adObj = GetObject("WinNT://Domain")<br/>Set adUser = adObj.Create("user", "RobDog888")<br/>adUser.SetInfo<br/>Set adUser = Nothing<br/>Set adObj = Nothing
This example is designed put to use our simple error handling application, using the Revision 4 syntax, all users should have this in their applications as it is almost a must if your program couls generate errors, the simple code takes up only 5 lines of your application and will stop your user...
This code will produce a simple Hello World application written in E+:Created using the Mage Software E+ 0.1 frameworking (Revision 3)!First example is using defualt settings, second declares the default settings for coding reasons.PrintText(Hello World)Wait() thenExit()CreateWindow(800*600)Back...
437 byte By
penagate at 2007-12-3 19:37:46
A wrapper for the normalcdf() function.NCDISTMenu("METHOD","X-DIST",A,"Z-DIST",B)Lbl A1->MGoto QLbl B2->MLbl QIf M=1ThenDisp "X-DIST"ElseDisp "Z-DIST"EndInput "L-BOUND:",CInput "U-BOUND:",DInput "MEAN:",EInput "STD. DEV:",FIf M=1ThenDisp normalcdf(C,D,E,F)ElseDisp normalcdf((C-E)/F),((D-E)...
1253 byte By
penagate at 2007-12-3 19:37:44
4 programs for computing interest, both compound and simple. All are needed to run.INTERESTMenu("METHOD","COMPOUND",A,"SIMPLE",B)Lbl AprgmCNPNDINTStopLbl BprgmSMPINTRSStopCNPNDINTClrHomeDisp "COMPOUND"Disp "INTEREST"Input "PRINCIPAL?",PInput "RATE?",I1->M1->CprgmCPTINTRSSMPINTRSClrHomeDisp...
419 byte By
penagate at 2007-12-3 19:37:42
Helpful wrapper for the the binompdf() and binomcdf() functions.BINOMPDMenu(" BINOM. DIST. ","INDIVIDUAL",A,"CUMULATIVE",B)Lbl A1->MGoto CLbl B2->MLbl CClrHomeInput "N:",NInput "P:",PInput "X:",XIf M=1ThenOutput(5,5,(binompdf(N,P,X))ElseIf M=2ThenOutput(5,5,(binomcdf(N,P,X))EndEndDisp ""...
919 byte By
penagate at 2007-12-3 19:37:41
Simple program for the Texas Instruments TI-83 graphics calculator, for solving quadratic equations.QUADEQa+biDisp "INSERT A,B,C"Prompt A,B,C(-B+(√(B-4AC)))/(2A)->V(-B-(√(B-4AC)))/(2A)->WIf (B-4AC)<0ThenFix 6ElseFloatEndDisp "ZEROS:"If Str0="Y"ThenDisp V>Frac,W>FracEls...
808 byte By
Madboy at 2007-12-3 18:51:50
UsesWinInet;const MODEM = 1; LAN = 2; PROXY = 4; BUSY = 8;function GetConnectionKind(var strKind: string): Boolean;var flags: DWORD;begin strKind := ''; Result := InternetGetConnectedState(@flags, 0); if Result then begin if (flags and MODEM) = MODEM then strKind := 'M...
1164 byte By
Madboy at 2007-12-3 18:51:49
UsesRegistry;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 Re...
3254 byte By
ENet at 2007-12-3 18:49:52
Option ExplicitPrivate Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any,...
427 byte By
Madboy at 2007-12-3 18:48:24
procedure WMGetMinMaxInfo(var MSG: Tmessage); message WM_GetMinMaxInfo;procedure TForm1.WMGetMinMaxInfo(var MSG: Tmessage);Begin inherited; with PMinMaxInfo(MSG.lparam)^ do begin with ptMinTrackSize do begin X := 300; Y := 150; end; with ptMaxTrackSize do begin X...
507 byte By
Madboy at 2007-12-3 18:48:12
procedure TForm1.Button1Click(Sender: TObject);varMyHandle: THandle;Struct: TProcessEntry32;begintryMyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);Struct.dwSize:=Sizeof(TProcessEntry32);if Process32First(MyHandle, Struct) thenListBox1.Items.Add(Struct.szExeFile);while Process32Next(My...
Ever need to set a Table or other Access DB object to Hidden programmatically? Well here's the way to do it that makes the object hidden EVEN if the user unchecks the "Show Hidden Objects" feature in the Options dialog box. There are no ways to show the Object unless you programmatically tu...
700 byte By
Madboy at 2007-12-3 18:26:18
function GetFileModifyDate(FileName: string): TDateTime;var h: THandle; Struct: TOFSTRUCT; lastwrite: Integer; t: TDateTime;begin h := OpenFile(PChar(FileName), Struct, OF_SHARE_DENY_NONE); try if h <> HFILE_ERROR then begin lastwrite := FileGetDate(h); Result := F...
926 byte By
Madboy at 2007-12-3 18:26:16
function GetVersion: string;var VerInfoSize: DWORD; VerInfo: Pointer; VerValueSize: DWORD; VerValue: PVSFixedFileInfo; Dummy: DWORD;begin VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy); GetMem(VerInfo, VerInfoSize); GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize,...
155 byte By
Madboy at 2007-12-3 18:26:14
1)Edit the properties of your Delphi program icon<br/>2)Go to the "Shorcut" page, In the field "Start in" you may enter your default project directory
379 byte By
Madboy at 2007-12-3 18:26:13
uses OLECtl;var OCXHandle: THandle; RegFunc: TDllRegisterServer;begin OCXHandle:= LoadLibrary ('C:\Windows\System\FileName.ocx'); RegFunc:= GetProcAddress (OCXHandle, 'DllRegisterServer'); if RegFunc <> 0 then ShowMessage('Failed to register'); FreeL...
1019 byte By
Madboy at 2007-12-3 18:26:10
uses ComObj, Outlook2000;procedure NewContactItem;var OutlApp: OutlookApplication; OutlNamespace: Namespace; ContactFolder: MAPIFolder; Contact: ContactItem;begin OutlApp:= CoOutlookApplication.Create; OutlNamespace:= OutlApp.GetNameSpace('MAPI'); ContactFolder:= OutlNamespace....
2276 byte By
Madboy at 2007-12-3 18:26:08
uses ComObj;procedure TForm1.Button1Click(Sender: TObject);const olFolderContacts = $0000000A;var outlook, NameSpace, Contacts, Contact: OleVariant; i: Integer;begin outlook := CreateOleObject('Outlook.Application'); NameSpace := outlook.GetNameSpace('MAPI'); Contacts :...
547 byte By
Madboy at 2007-12-3 18:26:07
Here is how you can create a submenu into the existing Delphi IDE menu system. The code first grabs the handle of the menu and implements the newly defined menu into it:uses ToolsApi, Menus;var item: TMenuItem;begin {Get reference to the Delphi mainmenu. You can handle it like a standard TMain...
1097 byte By
Madboy at 2007-12-3 17:48:13
You can find this article here: http://bdn.borland.com/article/0,1410,28325,00.htmlor view the code:type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; Edit2: TEdit; Button2: TButton; Edit3: TEdit; procedure Button1Click(Sender: TObject); function EnDeCrypt(const Val...
1231 byte By
Madboy at 2007-12-3 17:45:42
procedure TForm1.InitRichEditURLDetection(RE: TRichEdit);var mask: Word;begin mask := SendMessage(RE.Handle, EM_GETEVENTMASK, 0, 0); SendMessage(RE.Handle, EM_SETEVENTMASK, 0, mask or ENM_LINK); SendMessage(RE.Handle, EM_AUTOURLDETECT, Integer(True), 0);end;procedure TForm1.FormCreate(Sender...
378 byte By
Madboy at 2007-12-3 17:45:40
function ShowRTF(RE: TRichedit): string;var strStream: TStringStream;begin strStream := TStringStream.Create('') ; try RE.PlainText := False; RE.Lines.SaveToStream(strStream) ; Result := strStream.DataString; finally strStream.Free end;end;Memo1.Text:= ShowRTF...
420 byte By
Madboy at 2007-12-3 17:39:39
These articles are intended for use of the Delphi 2005 IDE--------------This article takes you through the process of creating a new component package. http://delphi.about.com/od/vclusing/ss/newcomponentbpl.htm--------------This article documents well on how to install a component (also reffered...
742 byte By
Madboy at 2007-12-3 17:36:09
procedure TForm1.Button1Click(Sender: TObject);var Drive: Char; DriveLetter: String[4];begin for Drive := 'A' to 'Z' do begin DriveLetter := Drive + ':\'; case GetDriveType(PChar(Drive + ':\')) of DRIVE_REMOVABLE: Memo1.Lines.Add(DriveLetter + '...
1474 byte By
Madboy at 2007-12-3 17:36:08
Using a TRichEdit Component, there is now an easier way to colour HTML tags:procedure HTMLSyntax(RichEdit: TRichEdit; TextCol, TagCol, DopCol: TColor);var i, iDop: Integer; s: string; Col: TColor; isTag, isDop: Boolean;begin iDop := 0; isDop := False; isTag := False; Col := TextCol; Ri...
368 byte By
Madboy at 2007-12-3 17:36:07
function StringtoHex(Data: string): string;var i, i2: Integer; s: string;begin i2 := 1; for i := 1 to Length(Data) do begin Inc(i2); if i2 = 2 then begin s := s + ' '; i2 := 1; end; s := s + IntToHex(Ord(Data[i]), 2); end; Result := s;end;...
3572 byte By
Madboy at 2007-12-3 17:36:06
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Memo1: TMemo; Edit1: TEdit; Button1: TButton; Button2: TButton; CheckBox1: TCheckBox; procedure Button1Click(Sender: TObject);...
The attached project contains a function that will allow anyone to disable the Startup ByPass Feature in Access. This function should not be considered secure, if you are concerned about data security you should consider scrapping Access for a more secure DB such as MS SQL and MySQL. Additio...
335 byte By
Madboy at 2007-12-3 17:23:28
procedure TForm1.Button1Click(Sender: TObject);var SearchRec: TSearchRec;begin if OpenDialog1.Execute then if FindFirst(OpenDialog1.FileName, faAnyFile, SearchRec) = 0 then Label1.Caption := FloatToStrF(SearchRec.Size/1048576, ffFixed, 7, 2)+' MB'; FindClose(SearchRec);end;...
171 byte By
Madboy at 2007-12-3 17:23:27
This well documented article i found accesses some hardware and system information.<br/>You can check that out at: http://www.delphicorner.f9.co.uk/articles/wapi2.htm
755 byte By
Madboy at 2007-12-3 17:23:14
function GetFileLastAccessTime( sFileName : string ) : TDateTime;var ffd : TWin32FindData; dft : DWord; lft : TFileTime; h : THandle;begin h := Windows.FindFirstFile( PChar(sFileName), ffd); if(INVALID_HANDLE_VALUE <> h)then begin Windows.FindClose( h ); FileTimeToL...
401 byte By
Madboy at 2007-12-3 17:23:11
var taskbar:HWND; //Hide Internet Explorer procedure TForm1.Button1Click(Sender: TObject); begin taskbar:=FindWindow('IEFrame',nil); ShowWindow(taskbar,SW_HIDE); end; //Show Internet Explorer procedure TForm1.Button2Click(Sender:TOBject); taskbar:=FindWindow('IEFrame',nil); S...
2615 byte By
Madboy at 2007-12-3 17:23:09
UPDATED WITH NEW METHODunit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, WinInet;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { P...
184 byte By
Madboy at 2007-12-3 17:23:08
To turn on:<br/>Sendmessage(Application.Handle,WM_SYSCOMMAND,SC_MONITORPOWER,2); <br/>To turn off: <br/>Sendmessage(Application.Handle,WM_SYSCOMMAND,SC_MONITORPOWER,-1);