VB.NET
Dim hWnd As Integer
Dim wMsg As Short
Dim SrqOn, Ret As Integer
hWnd = Handle.ToInt32 ' Handle is handle of runninng procedure.
wMsg = WM_USER + &H30S' A random number of 0x400-0x7FFF
SrqOn = 1 ' Event generation of SRQ
Ret = GpSetEventSrq(hWnd, wMsg, SrqOn)
C
HANDLE hWnd;
WORD wMsg;
DWORD SrqOn, Ret;
hWnd = hDlg; /* hDlg Is handle of runninng procedure.
wMsg = WM_USER + 0x30;/* A random number of 0x400-0x7FFF */
SrqOn = 1; /* Event generation of SRQ */
Ret = GpSetEventSrq(hWnd, wMsg, SrqOn);
C#
int hWnd;
ushort wMsg;
uint SrqOn, Ret;
hWnd = this.Handle.ToInt32(); /* this.Handle is handle of runninng procedure. */
wMsg = WM_USER + 0x30; /* A random number of 0x400-0x7FFF */
SrqOn = 1; /* Event generation of SRQ */
Ret = gpib.SetEventSrq(hWnd, wMsg, SrqOn);
Python
wMsg = ctypes.c_ushort()
SrqOn, Ret = ctypes.c_ulong(), ctypes.c_ulong()
hWnd = ctypes.windll.user32.FindWindowW(0, "Name") # "Name" is caption of executing procedure.
wMsg.value = WM_USER + 0x30# A random number of 0x400-0x7FFF
SrqOn.value = 1 # Event generation of SRQ
Ret.value = GpibPy.GpSetEventSrq(hWnd, wMsg, SrqOn)