Use Windows API Calls to Create Windows of Different Shapes

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

See also  Digital Signage Solutions for Agile Software Development Teams

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist