
i wanted to use MiniGUI Extended Version to "re-build" HBFM but it was "to much" for me
so i ask Grigory for help

---

Step 1 : compile with "-w1 -es2" in hbmk.hbm 

your HMG Source-Code must compile/link without Warning or Error before next Step
Tip : i put all "C" Code into HB-FUNC.PRG which will help you later

Step 2 : now work begin

when compile HMG "MinGW" Source with MiniGUI you get "Error", "Warning" and "missing".
you also can get "dupe" Message so a lot of work is waiting

Tip : use #IFDEF __HMG__ 

i use 32 / 64 Bit Unicode Version of MiniGUI and must include this line

#ifdef __HMG__
#include "SET_COMPILE_HMG_UNICODE.ch"
#endif


---

for Multi-Monitor i need "IN" Optiom which is different in MiniGUI

#ifndef __HMG__  // THIS is right !
   SET CENTERWINDOW RELATIVE PARENT
#endif

and use

#ifndef __HMG__
   CENTER WINDOW ShowBackList IN Win_1
#else
   CENTER WINDOW ShowBackList
#endif

---

if you use DEFAULT you need "Common.CH". 
under MiniGUI most are include in "i_winuser.ch"

#ifdef __HMG__
   #include "i_winuser.ch"
#else
   #include "common.ch"
   MEMVAR _HMG_SYSDATA  // NOT in MiniGUI
#endif

---
to use EVENT it is different under MiniGUI.

#ifdef __HMG__
   CREATE EVENT PROCNAME USB_Detect()
#else
   CREATE EVENT PROCNAME USB_Detect() HWND hForm STOREINDEX nIndex // in HbDevice.PRG
   EventProcessAllHookMessage( nIndex, .T. )
#endif

Windows Parameter are passed under MiniGUI

#ifdef __HMG__
FUNCTION USB_Detect(nHWnd , nMsg , nWParam , nLParam)
#else
FUNCTION USB_Detect()
LOCAL nHWnd   := EventHWND()
LOCAL nMsg    := EventMSG()
LOCAL nWParam := EventWPARAM()
LOCAL nLParam := EventLPARAM()
#endif

---
Toolbat must use IMAGESIZE 
#ifdef __HMG__
      DEFINE TOOLBAR ToolBar_1 OF Win_1 BUTTONSIZE aSize[ 1 ] / 16, 50 IMAGESIZE 32, 32 STRICTWIDTH FLAT // by GF
#else
      DEFINE TOOLBAR ToolBar_1 OF Win_1 BUTTONSIZE aSize[ 1 ] / 14, 50 STRICTWIDTH FLAT
#endif
p.s. this Demo Syntax make Problem under CLICK as there are 2 x DEFINE but not END

! Note : under MiniGUI do NOT "resize" Toolbar

#ifdef __HMG__
*   Setproperty( "Win_1", "ToolBar_1", "Width", mainWidth )
*   Setproperty( "Win_1", "ToolBar_1", "Height", 50 )
   nHMGDiff   := -30
#else
   Setproperty( "Win_1", "ToolBar_1", "Width", mainWidth )
   nHMGDiff   := 0
#endif

"Height" of MinGUI Toolbar seems "bigger" than HMG so ROW of Child might need "nHMGDiff"

---

now "big" Problem

#ifdef __HMG__
   aPos := GetCursorPos()
   hWnd := WindowFromPoint ( { aPos[ 2 ], aPos[ 1 ] } )
#else
   GetCursorPos( @nCol, @nRow )
   hWnd := WindowFromPoint( nCol, nRow )
#endif

same Windows API but Parameter / Return Value are Different

---

ImageList :

MiniGUI GRID and COMBOBOX seems not to use Image(list)
also "ON KEY" of GRID is not avaiable :(

TREE :

many HMG Property are not support under MiniGUI. i will ask Grigory to work on it.

RadioGroup :

have to wait for Answer why my RadioGroup crash

---

i have a new File : HMG_FUNC.PRG
it does contain "missing" Function, using "C"-Code MiniGUI Style, used by HBFM.

but it is all "under Construction" so it will take some Time before Release.

---

MiniGUI Unicode include HMG Unicode IDE
but i have Problem to activate Debugger under MiniGUI ?!

---

#ifndef __HMG__
   #define LVM_FIRST             0x1000
   #define LVM_GETCOUNTPERPAGE   (LVM_FIRST + 4)
   #define MCM_FIRST             0x1000
   #define MCM_SETCOLOR          (MCM_FIRST + 1)
   #define DTM_FIRST             0x1000
   #define DTM_SETMCCOLOR        (DTM_FIRST + 6)
#else
   #define LV_VIEW_ICON       0x0
   #define LV_VIEW_DETAILS    0x1
   #define LV_VIEW_SMALLICON  0x2
   #define LV_VIEW_LIST       0x3
   #define LV_VIEW_TILE       0x4
   #define LV_VIEW_MAX        0x4
   //   Change Notification Functions
   #define WAIT_OBJECT_0      0
   #define FILE_NOTIFY_CHANGE_NAME 0x00000003
#endif

#ifdef UNICODE
   // use UTF8 -> "W" instead of "A" API Function
   SET( _SET_CODEPAGE, "UTF8" )
   //  msgdebug ( hb_cdpSelect() )
#endif

---

#ifdef __HMG__
   aPos := GetCursorPos()
   hWnd := WindowFromPoint ( { aPos[ 2 ], aPos[ 1 ] } )
#else
   GetCursorPos( @nCol, @nRow )
   hWnd := WindowFromPoint( nCol, nRow )
#endif

---
#ifdef __HMG__
#define VK_ALT VK_MENU
#endif

HB_Deserialize() does not "restore" Array which was "save" by HB_Serialize()
so it crash
