Try this:
/*
* An MsgInfo() implementation using hbwin library.
* 06/03/2011 - 21:56:45
*
* COMPILE: hbmk2 msginfo1.prg -run -lhbwin
*/
#include "hbwin.ch"
FUNCTION MAIN()
? MsgInfo( "This is a single test" )
RETURN nil
FUNCTION MSGINFO( cText, cTitle )
RETURN WAPI_MESSAGEBOX( 0, cText, cTitle, WIN_MB_ICONQUESTION )
Regards,
Vailton Renato
2011/3/6 Qatan <wanst...@gmail.com>:
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
It works well.
I was "reinventing the wheel"! I should search more before thinking I
will have to do "invent" something. It was there all this time and I didn�t
see it...
Well your example works but creates a console window in the back of the
message.
To avoid that I tried to add these lines:
announce HB_GTSYS
request HB_GT_NUL
And compile with -GUI flag (using HBMK2). With that the console window
does not appear and I found the solution for my needs.
Anyway, follows my "reinvention" extracted from a mix of information
from different foruns, help from Culik of xHarbour and from GTWVW sources
(after some brief study).
[CODE]
/*
* MyMsg.ch
*/
#define MB_OK 0
#define MB_OKCANCEL 1
#define MB_ABORTRETRYIGNORE 2
#define MB_YESNOCANCEL 3
#define MB_YESNO 4
#define MB_RETRYCANCEL 5
#define MB_CANCELTRYCONTINUE 6
#define MB_ICONERROR 16
#define MB_ICONQUESTION 32
#define MB_ICONEXCLAMATION 48
#define MB_ICONINFORMATION 64
#define MB_USERICON 128
#define MB_APPLMODAL 0
#define MB_SYSTEMMODAL 4096
#define MB_TASKMODAL 8192
#define MB_HELP 16384 // Help Button
#define MB_NOFOCUS 32768
#define MB_SETFOREGROUND 65536
#define MB_DEFAULT_DESKTOP_ONLY 131072
#define MB_TOPMOST 262144
#define MB_RIGHT 524288
#define MB_RTLREADING 1048576
#define IDOK 1
#define IDCANCEL 2
#define IDABORT 3
#define IDRETRY 4
#define IDIGNORE 5
#define IDYES 6
#define IDNO 7
#define IDCLOSE 8
#define IDHELP 9
#define IDTRYAGAIN 10
#define IDCONTINUE 11
/*
* Test.prg
*/
announce HB_GTSYS
request HB_GT_NUL
proc main()
MyMsg( 'Titulo','Hello World!', MB_TOPMOST + MB_SETFOREGROUND )
MyMsg( 'Titulo','Hello World!', MB_ICONERROR + MB_SETFOREGROUND )
MyMsg( 'Titulo','Hello World!', MB_ICONQUESTION +
_DEFAULT_DESKTOP_ONLY )
MyMsg( 'Titulo','Hello World!', MB_ICONEXCLAMATION + MB_HELP +
MB_DEFAULT_DESKTOP_ONLY )
MyMsg( 'Titulo','Hello World!', MB_ICONINFORMATION + MB_NOFOCUS +
MB_DEFAULT_DESKTOP_ONLY )
retu
#PRAGMA BEGINDUMP
#include <windows.h>
#include "hbapi.h"
HB_FUNC( MYMSG )
{
hb_retni( MessageBox( NULL, hb_parcx( 2 ), hb_parcx( 1 ), ISNIL( 3 ) ?
MB_OK : hb_parni( 3 ) ) ) ;
}
#PRAGMA ENDDUMP
[/CODE]
Well, learning day-by-day...
Qatan
--