Dear Friends,
Is it possible to have a form with console panel inside ?
TIA
best rgds,
Chang
Form with console panel
Moderator: Rathinagiri
Form with console panel
Just Hmg It !
Re: Form with console panel
Chang, you can try in this way:
Code: Select all
#include "hmg.ch"
REQUEST HB_GT_WIN_DEFAULT
MEMVAR _HMG_SYSDATA
FUNCTION Main()
DEFINE WINDOW MainForm;
WIDTH 700;
HEIGHT 500;
MAIN;
ON INIT MainFormOnInit();
ON PAINT RedrawWindow(GetConsoleWindow())
DEFINE BUTTON WriteButton
ROW 430
COL 10
WIDTH 130
HEIGHT 25
CAPTION "Write in console"
ACTION WriteInConsole()
END BUTTON
END WINDOW
MainForm.CENTER
MainForm.ACTIVATE
RETURN NIL
FUNCTION MainFormOnInit()
LOCAL nHWndConsole := GetConsoleWindow()
IF nHWndConsole != 0
IF SetParent(nHWndConsole, MainForm.HANDLE) != 0
SetMode(25, 80)
SetWindowPos(nHWndConsole, 0, 10, 10, 0, 0, 0x15 /*SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE*/)
RedrawWindow(nHWndConsole)
ENDIF
MainForm.WriteButton.SETFOCUS
? "0"
ENDIF
RETURN NIL
FUNCTION WriteInConsole()
STATIC n := 0
IF GetConsoleWindow() != 0
? HB_Ntos(++n)
ENDIF
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"
HB_FUNC( GETCONSOLEWINDOW )
{
HMG_retnl((LONG_PTR) GetConsoleWindow());
}
#pragma ENDDUMP
Re: Form with console panel
Thanks KDJ,
it works but it seem that I cannot activate/type the console as usual ?
Anyway to work around ? or can we have it function like a DOS Shell ?
TIA
best rgds,
Chang
it works but it seem that I cannot activate/type the console as usual ?
Anyway to work around ? or can we have it function like a DOS Shell ?
TIA
best rgds,
Chang
Just Hmg It !
Re: Form with console panel
Chang
I don't understand what console you need.
Do you mean command console (cmd)?
I don't understand what console you need.
Do you mean command console (cmd)?
Re: Form with console panel
Thanks KDJ,
my mistake.. I hv to code something to to console to work with....
Thanks again Sir...
best rgds,
Chang
my mistake.. I hv to code something to to console to work with....
Thanks again Sir...
best rgds,
Chang
Just Hmg It !