Created
January 18, 2016 18:04
-
-
Save avaccari/e49d13aa76c8e9448980 to your computer and use it in GitHub Desktop.
Pop-up a message from an ArcGIS python toolbox using ctypes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
class Toolbox(object): | |
def __init__(self): | |
self.label = "popup message dev" | |
self.alias = "pupMesg_dev" | |
self.tools = [PopupMessage] | |
class PopupMessage(object): | |
def __init__(self): | |
self.label = "How do we popup messages?" | |
self.description = "Simple windll popup message example" | |
self.canRunInBackground = True | |
return | |
def getParameterInfo(self): | |
params = None | |
return params | |
def isLicensed(self): | |
return True | |
def updateParameters(self, parameters): | |
return | |
def udateMessages(self, parameters, messages): | |
return | |
def execute(self, parameters, messages): | |
"""Popup a message using ctype call to windll""" | |
# This is a very simple way to pop up messages. | |
text = "This is the message" | |
title = "This is the title of the window" | |
ctypes.windll.user32.MessageBoxA(0, text, title, 1) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment