IonicWind Software

IWBasic => GUI Central => Topic started by: dossic on May 27, 2008, 04:03:56 AM

Title: window with only minbox
Post by: dossic on May 27, 2008, 04:03:56 AM
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

Title: Re: window with only minbox
Post by: aurelCB on May 27, 2008, 04:10:16 AM
Whats purpose of this?
Title: Re: window with only minbox
Post by: dossic on May 27, 2008, 04:45:36 AM
informing the user that the window cannot be closed but only minimized if they do not want to see messages on it.

Carlo
Title: Re: window with only minbox
Post by: talun on May 27, 2008, 05:51:03 AM
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
Title: Re: window with only minbox
Post by: aurelCB on May 27, 2008, 06:21:42 AM
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
Title: Re: window with only minbox
Post by: aurelCB on May 27, 2008, 06:31:01 AM
Sorry this is for Creative :-[
Title: Re: window with only minbox
Post by: LarryMc on May 27, 2008, 06:34:28 AM
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
Title: Re: window with only minbox
Post by: dossic on May 27, 2008, 08:11:50 AM
You are great!

Thanks so much     Carlo