Send Messages to WinPopUp from Your Application

Send Messages to WinPopUp from Your Application

If you have an application that must run “unattended” and you want it to alert you if something goes wrong, your application can send you a message through WinPopUp. WinPopUp uses a mail slot to communicate with other computers in the network. Choose a mail slot name, such as \computernamemailslotmessngr, and use this code:

 Option ExplicitPrivate Declare Function CloseHandle Lib _	"kernel32" (ByVal hHandle As Long) As LongPrivate Declare Function WriteFile Lib _	"kernel32" (ByVal hFileName As Long, _	ByVal lpBuff As Any, _	ByVal nNrBytesToWrite As Long, _	lpNrOfBytesWritten As Long, _	ByVal lpOverlapped As Long) As LongPrivate Declare Function CreateFile Lib _	"kernel32" Alias "CreateFileA" ( _	ByVal lpFileName As String, _	ByVal dwAccess As Long, _	ByVal dwShare As Long, _	ByVal lpSecurityAttrib As Long, _	ByVal dwCreationDisp As Long, _	ByVal dwAttributes As Long, _	ByVal hTemplateFile As Long) As LongPrivate Const OPEN_EXISTING = 3Private Const GENERIC_READ = &H80000000Private Const GENERIC_WRITE = &H40000000Private Const GENERIC_EXECUTE = &H20000000Private Const GENERIC_ALL = &H10000000Private Const INVALID_HANDLE_VALUE = -1Private Const FILE_SHARE_READ = &H1Private Const FILE_SHARE_WRITE = &H2Private Const FILE_ATTRIBUTE_NORMAL = &H80 Function SendToWinPopUp(PopFrom As String, _	PopTo As String, MsgText As String) As Long	' parms:		PopFrom: user or computer that 	'			sends the message	'			PopTo: computer that receives the 	'			message	'			MsgText: the text of the message 	'			to send	Dim rc  As Long	Dim mshandle As Long	Dim msgtxt As String	Dim byteswritten As Long	Dim mailslotname As String	' name of the mailslot	mailslotname = "\" + PopTo + _		"mailslotmessngr" 	msgtxt = PopFrom + Chr(0) + PopTo + Chr(0) + _		MsgText + Chr(0) 	mshandle = CreateFile(mailslotname, _		GENERIC_WRITE, FILE_SHARE_READ, 0, _		OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)	rc = WriteFile(mshandle, msgtxt, _		Len(msgtxt), byteswritten, 0)	rc = CloseHandle(mshandle)End Function
Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes