Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Saturday, July 23, 2011

Sending Email From VB6 App

Email Sending UserControl - This UserControl is for sending emails with attachments via SMTP server, there is no dependencies like Winsock OCX, CDO, MAPI, Outlook.
[Visit Website]

Sunday, November 14, 2010

Use XP Icons in VB6 Apps

This code shows how you can use Windows XP style icon (32-bit alpha icons) in your VB 6 application. VB6 only supports icons up to 24-bit true color and this code shows the workaround.



[Download]

Temporarily Disable AutoRun

This code shows how you can temporarily disable autorun using your VB6 application.

[Download]

Drop Shadow on Form

This code shows how to add drop shadow to you VB6 form without using any subclassing. All using Windows APIs. Just 8 Lines of code.

[Download]

Tuesday, November 9, 2010

Draw System Icons

This code shows how you can Draw System Icons like - Critical, Exclamation, Question, Information and new Shield icon introduced in Windows Vista, 7.



[Download]

Monday, September 27, 2010

Detect 64-Bit Windows

This code shows how to Detect if you are using 64-Bit Edition of Windows in VB6.

[Download]

Disable DEP

DEP (Data Execution Prevention) is a new feature that was introduced with Windows XP SP2 and above, to prevent running of malicious codes, it marks certain memory locations as non-executable. But sometimes it creates problem with applications that are not doing anything harmful and they crashes. In XP SP3 and above Microsoft introduced new APIs that allow us to disable or enable DEP on our applications. This code shows how you can disable or enable DEP at runtime for your applications.

'API In General Declaration Section
Private Declare Function SetProcessDEPPolicy Lib "Kernel32.dll" (ByVal dwFlags As Long) As Long

'To Disable DEP
SetProcessDEPPolicy(0)

'To Enable DEP
SetProcessDEPPolicy(1)

'Note: Once Enabled Using API you cannot disable it Again
More on MSDN
SetProcessDEPPolicy Function [Visit]

New NX APIs added to Vista SP1, XP SP3 and Server 2008 [Visit]

Sunday, September 26, 2010

Draw Text with Shadow

This code shows how you can draw text with shadow. It uses DrawShadowText function in ComCtl32.dll to draw the text with shadow. Only works on Windows XP+ with manifest file.



[Download]

Saturday, September 25, 2010

Add Bitmap to Menus

This code shows how you can add Bitmap to Menus. It works on all versions of Windows. On Windows 95-XP the bitmap size is limited to 13x13 pixels and on Vista, 7 we can use 16x16 pixel bitmap. i have taken this code from MS KB Article 298144.



[Download]

Sunday, September 19, 2010

Cool Form Closing Effect

Just a snippet I wrote. Put this code in Form Unload event to test.

'---
Dim i As Long
Me.Top = (Screen.Height / 2) - (Me.Height / 2)
Me.Left = (Screen.Width / 2) - (Me.Width / 2)
For i = Me.Left To (Screen.Width / 2) Step 10
Me.Height = Me.Height - 15
Me.Width = Me.Width - 20
Me.Left = Me.Left + 100
DoEvents
Next
Unload Me
'---

Hello

Would try to update this blog from now. many links are broken like platnet source code and many websites shutdown.