EK Programmerz - Post Your Cool Codes.

pjayampathi

Well-known member
  • Jan 20, 2008
    6,253
    39
    48
    EK Programmerz la.. Oyala gaawa thiyana elaz codes me Thread eke Post Karanna.. :nerd::nerd:

    oonama Programming Language ekakin.. :yes::yes::yes:

    onna mama Start kala... :):)
     

    pjayampathi

    Well-known member
  • Jan 20, 2008
    6,253
    39
    48
    Programming Language : Visual Basic 6 or .Net
    Note : Make the Window Transparent..



    Code:
    [B]Declaretion :[/B]
    
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_LAYERED = &H80000
    Private Const LWA_ALPHA = &H2&
    
    [B]Code :
    [/B]
    Dim bytOpacity As Byte
    bytOpacity = 128
    Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
    Call SetLayeredWindowAttributes(Me.hWnd, 0, bytOpacity, LWA_ALPHA)
     

    pjayampathi

    Well-known member
  • Jan 20, 2008
    6,253
    39
    48
    Language : Visual Basic 6 or .Net
    Note : Change the Wallpaper

    Code:
    [B]
    Declaration :[/B]
    
    Private Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    Private Const SPI_SETDESKWALLPAPER As Long = 20
    
    [B]Code :[/B]
    
    SystemParametersInfo SPI_SETDESKWALLPAPER, 0, "Image.bmp",0
     

    booleanB

    Member
    May 2, 2008
    1,721
    2
    0
    25
    127.0.0.1
    compile with javac

    ------------------------------------------1

    class Elakiri {
    public static void main(String arg[]){
    System.out.println(arg[0]+"is an elakiriyan");
    }
    }


    -------------------------------------------2
    run with java

    prompt/>java Elakiri your_name

    -------------------------------------------3
    output

    your_name is an elakiriyan


    :yes:
     

    pjayampathi

    Well-known member
  • Jan 20, 2008
    6,253
    39
    48
    Language : Win32 Assembly
    Note : Change the Wallpaper

    Code:
    .386
    .MODEL FLAT,STDCALL
    option casemap:none 
    include C:\masm32\include\windows.inc
    includelib C:\masm32\lib\user32.lib
    include C:\masm32\include\user32.inc
    include C:\masm32\include\kernel32.inc
    includelib C:\masm32\lib\kernel32.lib
    include C:\masm32\include\shell32.inc
    includelib C:\masm32\lib\shell32.lib
    .CONST
    SPI_SETDESKWALLPAPER = 20
    .DATA
    image db "Image.bmp",0
    .CODE
    start:
    invoke SystemParametersInfoA, SPI_SETDESKWALLPAPER, 0, addr image, 0
    invoke ExitProcess, NULL 
    end start
     

    Ranhiru

    Member
    Feb 2, 2007
    6,438
    42
    0
    Inside FIREFOX
    pjayampathi said:
    Programming Language : Visual Basic 6 or .Net
    Note : Make the Window Transparent..



    Code:
    [B]Declaretion :[/B]
    
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_LAYERED = &H80000
    Private Const LWA_ALPHA = &H2&
    
    [B]Code :
    [/B]
    Dim bytOpacity As Byte
    bytOpacity = 128
    Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
    Call SetLayeredWindowAttributes(Me.hWnd, 0, bytOpacity, LWA_ALPHA)

    Thanx machan!!! But in Dot Net there is already a property named Transparency and you can change it :D :D
     

    Ranhiru

    Member
    Feb 2, 2007
    6,438
    42
    0
    Inside FIREFOX
    Well ill post one of my codes! If any of you have downloaded my software and checked the About part in the program it gives a flashing color background and music and scrolling text :D So here's how you do it

    Language : VB .NET

    Create a Timer. This timer takes care of the flashing color background

    Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Dim Red, Green, Blue As Integer
            Red = Int((255 - 0 + 1) * Rnd() + 0)
            Green = Int((255 - 0 + 1) * Rnd() + 0)
            Blue = Int((255 - 0 + 1) * Rnd() + 0)
            Me.BackColor = Color.FromArgb(Red, Green, Blue)
    
        End Sub

    Create another Timer. This timer takes care of the scrolling text. If the Location is 110 which is the position where my text should stop, the timer is disabled

    Code:
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            Label1.Location = New Point(35, Label1.Location.Y - 1)
    
            If Label1.Location.Y = 110 Then
                Timer2.Enabled = False
                Button1.Visible = True
            End If
        End Sub

    And finally the music. The music is an embedded resource (wav) in the resource file and will be played when the form loads

    Code:
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            My.Computer.Audio.Play(My.Resources.Wasath_Kalaye___IntenZe_Ft__Dirty_X_from_ELAKIRI_COM__Custom_, AudioPlayMode.Background)
        End Sub