Code: Select all
#include <hmg.ch>
Function Main
Define window Form_1 at 0, 0 width 400 height 300 main Title "Demo2 - Carlos example"
DEFINE TEXTBOX Text_1
ROW 10
COL 10
WIDTH 200
END TEXTBOX
DEFINE TEXTBOX Text_2
ROW 40
COL 10
WIDTH 200
END TEXTBOX
DEFINE EDITBOX Edit_1
ROW 10
COL 230
WIDTH 120
HEIGHT 110
VALUE ""
END EDITBOX
DEFINE COMBOBOX Combo_1
ROW 70
COL 10
WIDTH 200
HEIGHT 100
ITEMS {"Item 1","Item 2","Item 3"}
VALUE 0
DISPLAYEDIT .T. // must be .T. for cuebanner
END COMBOBOX
DEFINE SPINNER Spinner_1
ROW 100
COL 10
WIDTH 200
HEIGHT 24
RANGEMIN 0
RANGEMAX 10
VALUE 0
END SPINNER
DEFINE RICHEDITBOX RichEdit_1
ROW 130
COL 230
WIDTH 120
HEIGHT 90
VALUE ""
END RICHEDITBOX
End window
Setcuebanner(GetControlHandle("Text_1","Form_1"),"Enter your name here",.t.) // Third parameter is for not dissapear when getfocus
Setcuebanner(GetControlHandle("Text_2","Form_1"),"Enter address here",.t.) // Third parameter is for not dissapear when getfocus
Setcuebanner(GetControlHandle("Spinner_1","Form_1")[2],"Spinner CueBanner",.t.) // Third parameter is for not dissapear when getfocus
Setcuebanner(FindWindowEx(GetControlHandle("Combo_1","Form_1"),0,"Edit",Nil),"ComboBox CueBanner",.t.) // Third parameter is for not dissapear when getfocus
Setcuebanner(GetControlHandle("Edit_1","Form_1"),"EditBox CueBanner",.t.) // Third parameter is for not dissapear when getfocus
Setcuebanner(GetControlHandle("RichEdit_1","Form_1"),"RichEditBox CueBanner",.t.) // Third parameter is for not dissapear when getfocus
Form_1.center
Form_1.activate
Return Nil
#pragma BEGINDUMP
#define COMPILE_HMG_UNICODE
#include <HMG_UNICODE.h>
#include <windows.h>
#include <commctrl.h>
#define ECM_FIRST 0x1500 // Edit control messages
#define EM_SETCUEBANNER (ECM_FIRST + 1) // Set the cue banner with the lParm = LPCWSTR
HB_FUNC( SETCUEBANNER ) // (editHandle, cMsg) -> nil
{
#ifdef UNICODE
LPWSTR lpWCStr = HMG_parc(2) ;
#else
LPWSTR lpWCStr = (LPCWSTR) ( hb_parc(2) == NULL ) ? NULL : hb_mbtowc( (const char *) hb_parc(2) ) ;
#endif
SendMessage( (HWND) hb_parnl(1), EM_SETCUEBANNER, (WPARAM) hb_parl(3), (LPARAM) (LPCWSTR) lpWCStr ) ;
SysFreeString( lpWCStr );
}
#pragma ENDDUMP