Cancel wireless network connection attempt Wlan API

Ruslan Sydorovych 86 Reputation points
2022-12-06T20:17:51.907+00:00

Hello!

I would like to know what exactly Windows does when clicking on "Cancel" button to cancel the wireless network connection attempt. Please, check out the screenshot below:

267839-wlan-network-cancel.jpg

What Wlan API it calls?

For example, there are two functions:

  1. WlanDisconnect
  2. WlanRegisterNotification

From docs:
WlanDisconnect function disconnects an interface from its current network. So, it means it disconnects from already connected network?
WlanRegisterNotification function is used to register and unregister notifications on all wireless interfaces.

So, should I call these two methods or what exactly function should I use to cancel connection attempt to the wireless network? Thank you.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,526 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor
    2022-12-07T02:26:47.607+00:00

    Hello,

    Welcome to Microsoft Q&A!

    According to the Doc: WlanConnect function

    The WlanConnect function attempts to connect to a specific network. The WlanConnect function returns immediately. To be notified when a connection is established or when no further connections will be attempted, a client must register for notifications by calling WlanRegisterNotification.

    When you are clicking on "Cancel" button, it means no further connections will be attempted. If you want to be notified, you could call WlanRegisterNotification.

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful