omar911 Posted November 27, 2014 Posted November 27, 2014 Can some tell me how to make a text button app in delphi, like in VB 6 you can add a text and then a button and when you press the button it will generate a different serial number, i would like a code for delphi but no one is willing to help me. also any one know to to edit delphi exe files too. thank you in advance my friends.
Office Jesus Posted November 27, 2014 Posted November 27, 2014 You might want to visit DelphiBasics: http://www.delphibasics.co.uk/Article.asp?Name=FirstPgmThat's usually the first place I go when I have questions about Delphi. Fair warning: that first tutorial appears to be using Borland Delphi 7, which is no longer current (but is the best version). Try that first tutorial. If you have any questions after that, feel free to ask. As for "editing" Delphi .exe files, do you mean editing the resource file or the actual executable? If you want to edit the executable file, you might consider using a debugger like Olly that allows for changes to be made to the file.
Office Jesus Posted November 27, 2014 Posted November 27, 2014 By request, here's a sample project. The code has comments. If you have any questions, please ask. Sample Project.zip procedure TForm1.Button1Click(Sender: TObject); var len, sum, i, nRand : integer; name, serial : string; begin name := Edit1.Text; len := length(name); sum := 0; // Require a name length >= 1 if len < 1 then begin Edit2.Text := 'Enter a longer name!'; end; // Actually calculating serial if len >= 1 then begin // Iterate over name and sum up the ordinal values of the characters for i := 0 to len do begin sum := sum + Ord(name[i]); end; // Format the sum to 4 hex digits serial := IntToHex(sum, 4); // Generate a random number between 1 and 9999 nRand := random(9999) + 1; // Format serial for output serial := serial + '-' + IntToHex(nRand, 4); end; Edit2.Text := serial; end; procedure TForm1.FormCreate(Sender: TObject); var hours, mins, secs, milliSecs : word; begin // Initializing the random seed // http://www.delphibasics.co.uk/RTL.asp?Name=RandSeed DecodeTime(now, hours, mins, secs, milliSecs); RandSeed := milliSecs; end;
Teddy Rogers Posted November 28, 2014 Posted November 28, 2014 Here is something knocked up quickly in PureBasic... Declare Fade(void) If OpenWindow(0, 0, 0, 350, 160, "PureBasic Example Keygen Template", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) CreateThread(@Fade(), 0) ; Fade in from a thread to avoid gadgets not showing up whilst waiting for the next window event... StringGadget(2, 10, 30, 330, 20, "teddyrogers@tuts4you.com", #PB_Text_Center) StringGadget(4, 10, 75, 330, 20, "Teddy Rogers", #PB_Text_Center | #PB_String_ReadOnly) ; Change the following gadgets to use bold font... If LoadFont(1,"Arial",8, #PB_Font_Bold) SetGadgetFont(#PB_Default, FontID(1)) EndIf TextGadget(1, 10, 10, 330, 20, "Email Address:") TextGadget(3, 10, 55, 330, 20, "Registration Code:") ButtonGadget(5, 10,100, 330, 50, "GENERATE!", #PB_Button_MultiLine) ; Wait for a window or gadget event, then do stuff... Repeat Event = WaitWindowEvent() Select Event Case #PB_Event_Gadget Select EventGadget() Case 2 ; Checks email length, detects "@" and any duplicate(s), looks for "." and minimum characters proceeding it... Email.s = GetGadgetText(2) Length = Len(Email.s) If Length >= 5 Check = FindString(Email.s, "@") If Check If Not FindString(Email.s, "@", (Check+1)) DotPos = FindString(Email.s, ".", (Check+1)) If DotPos DotStr.s = Right(Email.s, (Len(Email.s)-DotPos)) DotLen = Len(DotStr.s) ; Random numbers between 0 to 9 If DotLen >= 2 Code.s = Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000)) SetGadgetText(4, Code.s) EndIf EndIf EndIf EndIf EndIf Case 5 ; "Generate!" gadget button ID Code.s = Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000))+"-"+Str(Random(99999,000000)) SetGadgetText(4, Code.s) EndSelect EndSelect Until Event = #PB_Event_CloseWindow ; Fade out effect... For Opacity = 255 To 0 Step -1 SetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE, #WS_EX_LAYERED) SetLayeredWindowAttributes_(WindowID(0), 0, Opacity, #LWA_ALPHA) Delay(10) Next EndIf ; Fade window in effect... Procedure Fade(void) For Opacity = 0 To 255 SetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE, #WS_EX_LAYERED) SetLayeredWindowAttributes_(WindowID(0), 0, Opacity, #LWA_ALPHA) Delay(10) Next EndProcedureTed.
omar911 Posted November 28, 2014 Author Posted November 28, 2014 OMG you guys are the best online BROTHERS i could ask for, much love and wishes to you guys
omar911 Posted November 28, 2014 Author Posted November 28, 2014 thanks for the project its great but i need to add my own serial numbers so how do i edit? in VB6 its easy as you can do the following cPrivate Sub Command1_Click()Dim key As Integerkey = Int(Rnd() * 4)Select Case keyCase 0Text1.Text = "WADV-4PKZ-R5PM-ZB86-XAL7"Case 1Text1.Text = "NRYBL"Case 2Text1.Text = "FE45-RY6X-YCFX"Case 3Text1.Text = "-RY6X-YCFX"End SelectEnd Sub im learning DELPHI but its a mission but any help would be great and so far i thank you for your help and advive and hope you can help me with this solution too.
Office Jesus Posted November 28, 2014 Posted November 28, 2014 thanks for the project its great but i need to add my own serial numbers so how do i edit? in VB6 its easy as you can do the following...im learning DELPHI but its a mission but any help would be great and so far i thank you for your help and advive and hope you can help me with this solution too. I'm going to point you to these relevant pages:http://www.delphibasics.co.uk/RTL.asp?Name=Varhttp://www.delphibasics.co.uk/RTL.asp?Name=Randomhttp://www.delphibasics.co.uk/RTL.asp?Name=Case Try figuring it out for yourself first, and then ask again if you get stuck.
omar911 Posted November 28, 2014 Author Posted November 28, 2014 DAMN this is hard to code but i like delphi but i cant figure it out how to change it, oh well back to VB then but thanks for your help bro, PM me i will send you a free gift for your help
omar911 Posted November 28, 2014 Author Posted November 28, 2014 thanks it is done and sorted and thanks for given me the right advice
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now