Here's below a simple demo. A different way to display a message:
Code: Select all
/*
Win_Msg - A kind of Notification message so easy and friendly Demo
Version.........: 1.1
Created by......: Pablo César on February 9th, 2017
*/
#include <hmg.ch>
Function Main()
SET WINDOW MAIN OFF
Notifier("Printing file xxxxx.xxx sent to EPSON LX-300",,3)
Notifier(CRLF+"File not found!",1)
SET WINDOW MAIN ON
Return Nil
Function Notifier(cMsg,ERROR,nSeconds)
LOCAL nHeight := 82, nWidth := 204
LOCAL nLeft := (GetDesktopWidth() - 5) - nWidth
LOCAL nTop := (GetDesktopHeight() - 50) - nHeight
LOCAL hWnd, aBcolor, nWinRow := nTop, nWinCol := nLeft
DEFAULT nSeconds := 2
If ValType(ERROR) = "U"
aBcolor := {0,153,0}
Else
aBcolor := {204,0,0}
Endif
DEFINE WINDOW Win_Msg AT nTop, nLeft WIDTH nWidth HEIGHT nHeight TOPMOST ;
NOMAXIMIZE NOMINIMIZE NOSIZE NOSYSMENU NOCAPTION BACKCOLOR aBcolor
DEFINE LABEL Label_1
ROW 10
COL 10
WIDTH nWidth - 20
HEIGHT nHeight - 20
VALUE cMsg
FONTNAME "MS Shell Dlg"
FONTSIZE 10
FONTBOLD .F.
BACKCOLOR aBcolor
FONTCOLOR WHITE
CENTERALIGN .T.
END LABEL
END WINDOW
hWnd := GetFormHandle("Win_Msg")
HMG_ChangeWindowStyle(hWnd, WS_EX_CLIENTEDGE, NIL, .T.)
AnimateWindow(hWnd, (nSeconds*300), AW_VER_NEGATIVE)
hb_IdleSleep(nSeconds)
AnimateWindow(hWnd, (nSeconds*1500), (AW_BLEND + AW_HIDE))
SendMessage( hWnd, WM_SYSCOMMAND, SC_CLOSE, 0 )
Return Nil