Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Advanced
Jul 2, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Use Windows API Calls to Create Windows of Different Shapes

You can create windows of different shapes using windows API calls in Visual Basic. Use the API Text Viewer tool to see all the API functions available for use in VB.

The functions to used are: CreateEllipticRgn, CreateRoundRectRgn, SetWindowRgn. The code here demonstrates creating an elliptical/ rounded rectangular window. Comment/uncomment the appropriate call to the CreateRgn method to change the shape of the window.

Follow these instructions:

1) Open a new VB standard Exe project.

2) Paste the following code in a standard bas module (definitions of the API functions used in this code can be obtained from the API Text Viewer tool):
Public Declare Function SetWindowRgn Lib 
Jatin Shah
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date