Sunday, December 9, 2012

Blogging - Memposting Artikel ke Blogger Menggunakan VB6

Mohon maaf source code ini dijual, agar Anda tidak memiliki kecewaan pada saat membuka posting ini - Ini merupakan aplikasi sederhana yang dibuat dengan Visual Basic 6.0. Aplikasi sangat sederhana ini digunakan untuk mempublish artikel ke blogger.

Tentu Anda bertanya mengapa membuat aplikasi sepele seperti ini, sementara diluar sana banyak sekali software-software weblog client dari mulai yang gratis hingga berbayar dari fitur sederhana hingga canggih contohnya: BlogDesk, BlogJet, Chrysanth WebStory, Ecto, LIPIDr Blog Client, Microsoft Word 2007, Post2Blog, QTM, Qumana, RocketPost, Semagic, Zoundry Raven, w.bloggar,WB Editor, Windows Live Writer, WordPress Comments notifier. Ada banyak alasan, salah satu alasan yang paling utama adalah mudah untuk dimodikasi (tambah kode disana, disini, disitu, tambah database ini, itu, tambah fitur ini, itu dan sebagainya) maksudnya dimodifikasi untuk disesuaikan dengan kebutuhan.
VB6 Blogger Poster
VB6 Blogger Poster

Jika Anda berminat harga source codenya Rp. 40.000 (empat puluh ribu)
Download: VB6 Blogger Poster
Catatan:
  • Aplikasi di atas banyak sekali berhubungan dengan kode-kode XML, mengenai kode-kode XML saya sendiri telah memposting ala kadarnya di sini, selain itu tentu saja pemahaman mengenai Blogger API.
  • Aplikasi ini mendukung juga draft, posting terjadwal, serta kategori.
READ MORE - Blogging - Memposting Artikel ke Blogger Menggunakan VB6

Thursday, December 6, 2012

VB6 Code - Menambah Internet Explorer Pada Saat Runtime

Contoh kode VB6 sederhana untuk dikembangkan mengenai cara menambah objek internet explorer pada saat runtime.
Option Explicit

Private IE As VBControlExtender

Private Sub Form_Load()
On Error GoTo IEMissing
Set IE = Form1.Controls.Add("Shell.Explorer", "wcIE")
IE.Visible = True
If Not IE Is Nothing Then
IE.object.silent = True
IE.object.Navigate "http://khoiriyyah.blogspot.com"
End If
IEMissing:

End Sub

Private Sub Form_Resize()
If Not IE Is Nothing Then
IE.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End If
End Sub
READ MORE - VB6 Code - Menambah Internet Explorer Pada Saat Runtime

VB6 Code - Mengcapture Gambar Dari WebCam

Meng-capture gambar dari sebuah webcam menggunakan Visual Basic 6.0.

Public Const WS_CHILD As Long = &H40000000
Public Const WS_VISIBLE As Long = &H10000000
Public Const WM_USER As Long = &H400
Public Const WM_CAP_START As Long = WM_USER

Public Const WM_CAP_DRIVER_CONNECT As Long = WM_CAP_START + 10
Public Const WM_CAP_DRIVER_DISCONNECT As Long = WM_CAP_START + 11
Public Const WM_CAP_SET_PREVIEW As Long = WM_CAP_START + 50
Public Const WM_CAP_SET_PREVIEWRATE As Long = WM_CAP_START + 52
Public Const WM_CAP_DLG_VIDEOFORMAT As Long = WM_CAP_START + 41
Public Const WM_CAP_FILE_SAVEDIB As Long = WM_CAP_START + 25


Public Declare Function capCreateCaptureWindow _
Lib "avicap32.dll" Alias "capCreateCaptureWindowA" _
(ByVal lpszWindowName As String, ByVal dwStyle As Long _
, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long _
, ByVal nHeight As Long, ByVal hwndParent As Long _
, ByVal nID As Long) As Long
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long _
, ByVal wParam As Long, ByRef lParam As Any) As Long
Dim hCap As Long

Private Sub cmd4_Click()
    Dim sFileName As String
    Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(False), 0&)
    With CDialog
        .CancelError = True
        .Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt
        .Filter = "Bitmap Picture(*.bmp)|*.bmp|JPEG Picture(*.jpg)|*.jpg|All Files|*.*"
        .ShowSave
        sFileName = .FileName
    End With
    Call SendMessage(hCap, WM_CAP_FILE_SAVEDIB, 0&, ByVal CStr(sFileName))
    DoFinally:
    Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(True), 0&)
End Sub

Private Sub Cmd3_Click()
    Dim temp As Long
    temp = SendMessage(hCap, WM_CAP_DRIVER_DISCONNECT, 0&, 0&)
End Sub

Private Sub Cmd1_Click()
    hCap = capCreateCaptureWindow("Take a Camera Shot", WS_CHILD Or WS_VISIBLE, 0, 0, PicWebCam.Width, PicWebCam.Height, PicWebCam.hWnd, 0)
    If hCap <> 0 Then
        Call SendMessage(hCap, WM_CAP_DRIVER_CONNECT, 0, 0)
        Call SendMessage(hCap, WM_CAP_SET_PREVIEWRATE, 66, 0&)
        Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(True), 0&)
    End If
End Sub

Private Sub Cmd2_Click()
    Dim temp As Long
    temp = SendMessage(hCap, WM_CAP_DLG_VIDEOFORMAT, 0&, 0&)
End Sub

Private Sub Form_Load()
    cmd1.Caption = "Start &Cam"
    cmd2.Caption = "&Format Cam"
    cmd3.Caption = "&Close Cam"
    cmd4.Caption = "&Save Image"
End Sub
READ MORE - VB6 Code - Mengcapture Gambar Dari WebCam

VB Fungsi API - Mengetahui Ukuran Screen Yang Sebenarnya

Contoh fungsi API untuk mengetahui ukuran layar (screen) yang sebenarnya (dikurangi tinggi taskbar).

Option Explicit

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Public Function ScreenWidth() As Single
    Dim R As RECT
    GetWindowRect GetDesktopWindow(), R
    ScreenWidth = R.Right * Screen.TwipsPerPixelX
End Function

Public Function ScreenHeight() As Single
    Dim R As RECT
    GetWindowRect GetDesktopWindow(), R
    ScreenHeight = R.Bottom * Screen.TwipsPerPixelY
End Function
READ MORE - VB Fungsi API - Mengetahui Ukuran Screen Yang Sebenarnya