Flickr

Tools
Tampilkan postingan dengan label VB. Tampilkan semua postingan
Tampilkan postingan dengan label VB. Tampilkan semua postingan

Membuat layar monitor terbalik

Sekarang kita akan mencoba membuat program yang agak usil yaitu program yang membuat user keheranan atau malah takut karena program ini akan membuat layar terbalik dan mouse akan menghilang. List di task manager pada tab application juga tidak menunjukan adanya suatu program yang berjalan, kombinasi Alt+Tab dan Alt+F4 juga tidak menyelesaikan masalah, pasti user akan semakin bingung or ketakutan.Jika ditambahi sedikit code registry yang akan membuat program berjalan pada saat windows hidup/startup mungkin akan membuat teman anda atau malah saingan anda menginstal ulang komputernya karena dikira kerjaan virus he..he.., selamat ber-iseng ria. Untuk menormalkan kembali tekan huruf N pada keyboard maka semua akan kembali Normal.Semoga bermanfaat.Program ini merupakan saduran dari buku "Eksplorasi Win32-API dengan Visual Basic" Karya Johan Saputra, terimakasih saya ucapkan pada Mas Johan Saputra, karena tulisan di blog ini sebagian besar yang menyangkut dengan Win32-API merupakan hasil dari pemikiran Mas, yang ada di dalam buku tersebut.

Private Declare Function GetDC Lib "user32" (ByVal hWND As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hWND As Long, ByVal hWndInsertAfter_ As Long, ByVal X As Long, ByVal y_ As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags_ As Long) As Long
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

'Nilai konstan untuk parameter SetWindowPos.
Private Const conHwndTopmost = -1
Private Const conHwndNoTopmost = -2
Private Const conSwpNoActivate = &H10
Private Const conSwpShowWindow = &H40

Private Sub Form_Load()
Me.AutoRedraw = True 'memastikan Form bisa menampung hasil copy layar.
Me.WindowState = 2 'Maximize.
SelaluTeratas Me.hWND, Me.Left / Screen.TwipsPerPixelX, Me.Top / Screen.TwipsPerPixelY, Me.Height / Screen.TwipsPerPixelY, Me.Width / Screen.TwipsPerPixelX, True
App.TaskVisible = False 'menyembunyikan aplikasi pada task manager (tab Application) tetapi terlihat di tab Process
ShowCursor False 'Sembunyikan cursor.
End Sub

'Saat Form berubah ukuran (maximize).
Private Sub Form_Resize()
Dim W, H 'Tipe variant.
'Set ukuran rectangle screen.
W = Screen.Width / 15
H = Screen.Height / 15
'kopian layar diambil dan di tampilkan pada Form secara Flip
StretchBlt Me.hdc, 0, H, W, -H, GetDC(0&), 0, 0, W, H, vbSrcCopy
End Sub

'Fungsi buatan.
Private Function SelaluTeratas(ByVal hWND, FrmX As Long, FrmY As Long, Tinggi As Long, Lebar As Long, ApakahTeratas As Boolean)
If ApakahTeratas = True Then

SetWindowPos hWND, conHwndTopmost, FrmX, FrmY, Lebar, Tinggi, conSwpNoActivate

ElseIf ApakahTeratas = False Then

SetWindowPos hWND, conHwndNoTopmost, FrmX, FrmY, Lebar, Tinggi, conSwpShowWindow
End If

End Function



'Fungsi buatan untuk Normalisasi seperti keadaan semula.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyN Then 'Jika tombol "N" keyboard ditekan.
ShowCursor True
End
End If
End Sub 


NB : Jika ingin mengembalikan seperti semula silahkan tekan Tombol panah bawah..

Tested by Icc Ayub Rudini,
Share:

Membuat Form Layar VB menjadi Desktop

Kali ini saya akan memberi tahu tutor bagaimana caranya agar form vb kalian berlayar desktop..

Kode ini akan mengubah latar belakang dari sebuah Form menjadi seperti gambar / wallpaper Desktop komputer Anda. Buat sebuah Form dengan kontrol Timer (Enabled=True; Interval=100) didalamnya.

[ VB 6.0 ]
Ketik kode berikut di bagian '(Declarations)' dari Form.
Private Declare Function PaintDesktop Lib "user32" (ByVal hdc As Long) As Long
Dan ketikkan kode berikut di bagian 'Timer1_Timer'.
PaintDesktop Me.hdc
Share:

Follow Us

Facebook

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.

BTemplates.com

8/Projects/feat-big
Katie Fox

Katie Fox

Fashion Blogger

Lorem Ipsum passages, and more recently with desktop publishing software.

Katie Fox

Katie Fox

Fashion Blogger

Lorem Ipsum passages, and more recently with desktop publishing software.

Melisa Edwards

Melisa Edwards

Food Critic
Janie Doe

Janie Doe

UI Designer

Product promotion, Blog advertising & SEO

Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.

Web development for clients and market

Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.

Brand creation, trend analysis & style consulting

Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.

Melisa Edwards

Melisa Edwards

Food Critic

Visitor

Cari Blog Ini

Outdoor
Fashion
Life-Style
Food

Twitter Feeds

Lorem Ipsum passages, and more recently with desktop publishing software.

Richard Roe

Richard Roe

UX Designer

Lorem Ipsum passages, and more recently with desktop publishing software.

Janie Doe

Janie Doe

UI Designer

1763

Worldwide Clients

Since 1998

1458

Projects Completed

1247

Cups of Coffee

Meet The Team

Lorem Ipsum has been the industry's standard dummy text.

What our clients say

Lorem Ipsum has been the industry's standard dummy text.

"If you want to build something big, you have to start with a small step!"

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here'. Lorem Ipsum has been the industry's standard dummy text ever since.

Contact Info

Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry's.

Our Projects

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here'. Lorem Ipsum has been the industry's standard dummy text ever since.

Recent Blog Posts

Lorem Ipsum has been the industry's standard dummy text.

Formulir Kontak

Brand Promotion

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit.

Web Development

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit.

Web Design

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit.

App Design

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit.

Advertisement

Social

Design

Projects

3/Projects/post-list

Popular Posts

Popular Posts