## Hello World Using the Windows API

# Global Imports
import ctypes

user_handle = ctypes.WinDLL("User32.dll")
k_handle = ctypes.WinDLL("Kernel32.dll")

hWnd = None # Hardware ID, not used for this API Call
lpText = "Hello World!"
lpCaption = "Hello World!"
uType = 0x00000001

response = user_handle.MessageBoxW(hWnd, lpText, lpCaption, uType)

error = k_handle.GetLastError()
if error !=0:
    print("Error Code: {0}".format(error))
    exit(1)

if response == 1:
    print("User clicked on the first option.")
elif response == 2:
    print("User clicked on Cancel.")

## Hello World Using the Windows API

# Global Imports
import ctypes

user_handle = ctypes.WinDLL("User32.dll")
k_handle = ctypes.WinDLL("Kernel32.dll")

hWnd = None # Hardware ID, not used for this API Call
lpText = "Hello World!"
lpCaption = "Hello World!"
uType = 0x00000001

response = user_handle.MessageBoxW(hWnd, lpText, lpCaption, uType)

error = k_handle.GetLastError()
if error !=0:
    print("Error Code: {0}".format(error))
    exit(1)

if response == 1:
    print("User clicked on the first option.")
elif response == 2:
    print("User clicked on Cancel.")

## Hello World Using the Windows API # Global Imports # Hardware ID, not used for this API Call