Hi!
I'm trying to create a window with only the @minbox style without maxbox and closebutton.
I easily did that with other BASIC's, but I can't find the trick in EBASIC.
Sorry for the stupid question.
Thanks Carlo
Whats purpose of this?
informing the user that the window cannot be closed but only minimized if they do not want to see messages on it.
Carlo
Hi Carlo,
maybe this link can be useful for you:
http://www.visualbasic.happycodings.com/Windows_and_Controls/code9.html (http://www.visualbasic.happycodings.com/Windows_and_Controls/code9.html)
ciao!
Sergio
Try this:DEF win:window
'Const MF_BYPOSITION = &H400&
WINDOW win,0,0,350,350,@sysmenu-1,0,"Main",main
run = 1
waituntil run = 0
closewindow win
end
sub main
select @class
case @idclosewindow
run=0
case @IDCREATE
CenterWindow win
endselect
return
Sorry this is for Creative :-[
This is the VB code referenced above converted to EBasic:
'--------- API Menu functions Required -------
DECLARE IMPORT, _GetSystemMenu ALIAS GetSystemMenu(hwnd AS INT,bRevert AS INT),INT
DECLARE IMPORT, _RemoveMenu ALIAS RemoveMenu(hMenu AS INT,nPosition AS INT,wFlags AS INT),INT
CONST MF_BYPOSITION = 0x400
'-----------------------------------------------
DEF w1 as WINDOW
DEF hMenu as INT
OPENWINDOW w1,0,0,350,350,@MINBOX|@SIZE,0,"Simple Window",&main
BEGINMENU w1
MENUTITLE "Option"
MENUITEM "Quit", 0, 2
ENDMENU
WAITUNTIL w1 = 0
END
'---
SUB main
SELECT @MESSAGE
CASE @IDCREATE
DisableCloseWindowButton(w1)
CENTERWINDOW w1
CASE @IDCLOSEWINDOW
CLOSEWINDOW w1
CASE @IDMENUPICK
SELECT @MENUNUM
CASE 2: ' user selected Quit
CLOSEWINDOW w1
ENDSELECT
ENDSELECT
RETURN
ENDSUB
Sub DisableCloseWindowButton(frm As window)
Dim hSysMenu As int
hSysMenu = _GetSystemMenu(frm.hwnd, 0)
'Remove the Close menu item
_RemoveMenu (hSysMenu, 6, MF_BYPOSITION)
'Remove the seperator bar
_RemoveMenu (hSysMenu, 5, MF_BYPOSITION)
return
endsub
Larry
You are great!
Thanks so much Carlo