How use Windows API function MessageBox? (OpenInsight Specific)
At 18 AUG 1999 04:01:28AM Oystein Reigem wrote:
I want to use the Windows API function MessageBox. It's already prototyped in SYSPROCS*DLL_USER:
<code> SHORT PASCAL MessageBox(SHORT,LPCHAR,LPCHAR,SHORT)</code>
But my C++ Reference doesn't agree:
<code> int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK );</code>
There seems to be an extra first integer parameter in the prototyped version. What is the explanation? And perhaps somebody has got a working example? TIA.
- Oystein -
At 18 AUG 1999 04:20AM Oystein Reigem wrote:
Sorry - looked in the wrong documentation. Here's the correct MessageBox:
<code> int MessageBox( HWND hWnd, // handle to owner window LPCTSTR lpText, // pointer to text in message box LPCTSTR lpCaption, // pointer to title of message box UINT uType // style of message box );</code>
So the prototype must be right after all.
- Oystein -
At 18 AUG 1999 05:16AM Oystein Reigem wrote:
I still need some help with the Windows API MessageBox function, so I'd be very grateful for a nudge in the right direction. I've no problem with running it from a window, but as you might have guessed I want it to work from the System Editor.
I quote from the online Reference article on the Msg function:
"To display a message without being in event context (for example, if code is executed from the system editor) use the Windows API function MessageBox. This requires SYSTEM MODAL to be set and all string parameters to be terminated with char(0)."
My questions is: Why do I still get the message "The stored procedure can be executed in event-context only"?
And if that can be circumvented - what should I use for the handle parameter? And which modality? 1? (=application modality)
- Oystein -