I want to make a program that can send messages (like winpopup) from a visual basic application. On Windows NT I have a working version with Api. Hoe can I do that in VB in Windows 95??
I what way do you want to write a winpopup program.
1. Where you can actually send (from vb) a winpopup messages to another computer and the other computer can see the message in their winpopup.
or
2. Where you have a similar program to winpopup that (i.e send a receive simple messages) but doesn't actually communicate with and of the microsoft winpopup programs.
I wud say where i can send messages from my VB application to a winpopup or a NT message prompt window in whatever case maybe...I dont have to receive msgs coming from another computer.
of a one way transmission..the receiving end will just invoke the winpopup .... no reply needed...This is more like a notification..:> just like a pager..:>
Winpopup works with Mailslots. Search for 'mailslots' on msdn.microsoft.com and you'll find a lot of information about it.
Here are some API's you need for it:
Code:
Public Declare Function CreateMailslot Lib "kernel32" Alias _
"CreateMailslotA" (ByVal lpName As String, ByVal nMaxMessageSize As Long, _
ByVal lReadTimeout As Long, lpSecurityAttributes As Long) As Long
Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, _
lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Public Declare Function WriteFile Lib "kernel32" _
(ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As Long, lpOverlapped As OVERLAPPED) As Long
Public Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, _
ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, lpOverlapped As OVERLAPPED) As Long
Public Declare Function GetMailslotInfo Lib "kernel32" (ByVal hMailslot As Long, _
lpMaxMessageSize As Long, lpNextSize As Long, lpMessageCount As Long, _
lpReadTimeout As Long) As Long
Public Declare Function SetMailslotInfo Lib "kernel32" (ByVal hMailslot As Long, _
ByVal lReadTimeout As Long) As Long