How to add menus to an MDI Child window

Windows specific questions.
Post Reply
VirusScanner
Posts: 775
Joined: Jul 01, 2005 18:45

How to add menus to an MDI Child window

Post by VirusScanner »

I've got menus working in the MDI frame window, the MDI client window works correctly, associates with the 'window' menu, but now when I'm trying to add menus to an MDI child nothing happens. The window opens, but it's just blank. Am I doing something wrong or is there some rule that you're not allowed to have menus in MDI children?

Code: Select all

	hFileMenuBar = CreateMenu()
	AppendMenu(hFileMenuBar, MF_STRING, 1, "&Commander Window")
	AppendMenu(hFileMenuBar, MF_STRING, 2, "&Output Window")
	SetMenu(child, hFileMenuBar)
	DrawMenuBar(child)
where child is an HWND, hFileMenuBar is a HMENU, unicode is defined and windows.bi is included. So I assume it translates to AppendMenuW(...)

Edit: After trying this with a language I'm more familiar with, it looks like it's not possible to add menus to an MDI child, so I'll do it another way. But if it is possible please let me know. Thanks.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Post by dkl »

if it doesn't work with SetMenu... the other way is to specify the menu in the window class. Did you try this?

Otherwise, I think it's impossible.
For example, MDI Child Windows often are maximized ... if so, their window icon and the '_','X' etc buttons appear in the menu bar of the frame window.. you know what I mean :-)

EDIT: hahaha I just see that CreateWindowEx has a hMenu parameter, too... but not CreateMDIWindow() (what you normally use to create a MDI child window)

and specifying in the window class for the mdi child doesn't work, either... (just tested :-))
VirusScanner
Posts: 775
Joined: Jul 01, 2005 18:45

Post by VirusScanner »

You specify the ID of a control in the hMenu parameter, I didn't know about CreateMDIWindow, I just used CreateWindowEx with a separate class and it works fine.

All I wanted were two buttons, it would be easier to do in the menu area, but I'll just add an accelerator. It'd be more clean looking that way anyways. Thanks for the help though.
jmgbsas
Posts: 35
Joined: Dec 26, 2020 16:03

Re: How to add menus to an MDI Child window

Post by jmgbsas »

(I can only reply to one post, but I can't create a new one ... that's why I always use reply)
This is my question ,,,
HOW CAN I EXECUTE COMMANDS IN A MENU ON A WINDOWS SCREEN ScreenRes Graphics mode ?
I was able to add a menu to ScreenRes, but it doesn't execute commands ... Is it impossible?' -------
This is the idea:

Dim As HMENU hMenu, hFile, hHelp
Dim As MSG msg

'Create a window:
hMenu = CreateMenu()
hFile = CreateMenu()
hHelp = CreateMenu()
MenuTitle(hMenu, hFile, "File")
MenuTitle(hMenu, hHelp, "Help")

'Create menu items:
MenuItem(hFile, 1, "New")
MenuItem(hFile, 2, "Open")
MenuItem(hFile, 3, "Save")
MenuItem(hFile, 4, "Exit")
MenuItem(hHelp, 5, "Info")
MenuItem(hFile, 6, "FIN")

ScreenControl(fb.GET_WINDOW_HANDLE,IhWnd)
Dim As hWnd hwnd = Cast(hwnd,IhWnd)
SetMenu(hwnd, hMenu)

The menu works but does not execute commands, the hwnd is from Screenres.
Seems the problem is the cast of hwnd....
I compiled as a console to see the prints, but there is no screen print.
Of course I tested with window new and run ok....but I would like a Screenres window

Do
WaitEvent(hwnd,msg )

Select Case msg.hwnd

Case hwnd
Select Case msg.message
Case WM_COMMAND ' Menu commands
Select Case msg.wParam
Case 1
Print "New"
Case 2
Print "Open"
Case 3
Print "Save"
Case 4
Print "Exit"
Case 5
Messagebox(0, "Test of menu functions", "Info", 0)
End Select
Case 6
End
End Select

End Select
loop
End 0

Thanks
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: How to add menus to an MDI Child window

Post by jj2007 »

What about using code tags, and posting complete code...?

Code: Select all

error 133: Too many errors, exiting
adeyblue
Posts: 299
Joined: Nov 07, 2019 20:08

Re: How to add menus to an MDI Child window

Post by adeyblue »

jmgbsas wrote: HOW CAN I EXECUTE COMMANDS IN A MENU ON A WINDOWS SCREEN ScreenRes Graphics mode ?
I was able to add a menu to ScreenRes, but it doesn't execute commands ... Is it impossible?' -------
You can't, easily. The graphics window doesn't listen for WM_COMMAND messages, so menu clicks are just ignored.

You'd have to get the thread id of the graphics window (GetWindowThreadProcessId), set a WH_GETMESSAGE hook with that thread id and then process the command messages in your hook function.
jmgbsas
Posts: 35
Joined: Dec 26, 2020 16:03

Re: How to add menus to an MDI Child window

Post by jmgbsas »

adeyblue wrote:
jmgbsas wrote: HOW CAN I EXECUTE COMMANDS IN A MENU ON A WINDOWS SCREEN ScreenRes Graphics mode ?
I was able to add a menu to ScreenRes, but it doesn't execute commands ... Is it impossible?' -------
You can't, easily. The graphics window doesn't listen for WM_COMMAND messages, so menu clicks are just ignored.

You'd have to get the thread id of the graphics window (GetWindowThreadProcessId), set a WH_GETMESSAGE hook with that thread id and then process the command messages in your hook function.
ok, I will try,
Thanks for the answer!
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: How to add menus to an MDI Child window

Post by dodicat »

You could do it crudely:

Code: Select all


#include "windows.bi"
Screen 19,32,,&h10 or &h80 or &h20 
Color ,Rgb(0,100,255)
Cls

setmouse ,,,1

Dim Win As Any Ptr

Screencontrol 2, *Cptr(Integer Ptr,@Win )

Var C=CreateWindowEx(0,"Button","Click", WS_VISIBLE Or WS_CHILD,0,0,60,30,win,0,0,0)
Var c1=CreateWindowEx( 0,"STATIC","", WS_BORDER Or WS_VISIBLE Or WS_CHILD ,150,50,300,20,  win,0,0,0)
Var E=CreateWindowEx(0,"Button","END",WS_BORDER or WS_VISIBLE Or WS_CHILD,150,80,60,30,win,0,0,0)
Dim As msg msg

While GetMessage( @msg,Win,0,0)
    
    TranslateMessage(@msg)
    DispatchMessage(@msg)
    Select Case msg.hwnd
    Case C
        Select Case msg.message  
        Case WM_LBUTTONDOWN
            
            setWindowText(c1,"You can press any key to end or click END")
        End Select 
        
    Case E
        Select Case msg.message  
        Case WM_LBUTTONDOWN
            End
        End Select
        
    End Select
    
    select case msg.message
    case WM_KEYDOWN
        end
    end select
    if inkey=chr(27) then end
Wend

Sleep
 
Lewis78
Posts: 1
Joined: Nov 16, 2021 5:06

Re: How to add menus to an MDI Child window

Post by Lewis78 »

adeyblue wrote:
jmgbsas wrote: HOW CAN I EXECUTE COMMANDS IN A MENU ON A WINDOWS SCREEN ScreenRes Graphics mode ?
I was able to add a menu to ScreenRes, but it doesn't execute commands ... Is it impossible?' -------
You can't, easily. The graphics window doesn't listen for WM_COMMAND messages, so menu clicks are just ignored.

You'd have to get the thread id of the graphics window (GetWindowThreadProcessId), set a WH_GETMESSAGE hook with that thread id and then process the command messages in your hook function.
Thanks for the information,walgreenslistens I will try to figure it out for more. Looking for the same issue.
Last edited by Lewis78 on Nov 17, 2021 3:49, edited 1 time in total.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: How to add menus to an MDI Child window

Post by dodicat »

"HOW CAN I EXECUTE COMMANDS IN A MENU ON A WINDOWS SCREEN ScreenRes Graphics mode ?"
The opengl screen seems much more receptive to buttons and the like.
I suppose it is because it is very primitive.

Code: Select all

#include "windows.bi"
#include "GL/gl.bi"
Screen 19,32,,2

Sub setupgl
    Dim As Integer xres,yres
    Screeninfo xres,yres
    glDisable (GL_DEPTH_TEST)
    glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
    glEnable (GL_BLEND)
    glEnable (GL_LINE_SMOOTH)
    glOrtho 0, xres, yres,0,-1, 1
    glclearcolor 1,.5,0,1
End Sub
setupgl

declare Sub drawstring(xpos As Long,ypos As Long,text As String ,col As Ulong,size As Single,xres As Long,yres As Long)


Dim Win As Any Ptr

Screencontrol 2, *Cptr(Integer Ptr,@Win )

Var C=CreateWindowEx(0,"button","Message", WS_VISIBLE Or WS_CHILD,0,0,70,30,win,0,0,0)
Var D=CreateWindowEx(0,"Button","Hello", WS_VISIBLE Or WS_CHILD,0,35,70,30,win,0,0,0)
Var c1=CreateWindowEx(0,"STATIC","", WS_BORDER Or WS_VISIBLE Or WS_CHILD ,150,50,300,20,win,0,0,0)
Var E=CreateWindowEx(0,"Button","END",WS_BORDER or WS_VISIBLE Or WS_CHILD,150,80,60,30,win,0,0,0)
Dim As msg msg
dim as long flag
While GetMessage( @msg,Win,0,0)
   
    TranslateMessage(@msg)
    DispatchMessage(@msg)
    Select Case msg.hwnd
    Case C
        Select Case msg.message 
        Case WM_LBUTTONDOWN
           flag=0
            setWindowText(c1,"You can press any key to end or click END")
        End Select
        
      Case D
        Select Case msg.message 
        Case WM_LBUTTONDOWN
              flag=1
              setWindowText(c1,"                                       ")
        End Select  
       
    Case E
        Select Case msg.message 
        Case WM_LBUTTONDOWN
            End
        End Select
       
    End Select
   
    select case msg.message
    case WM_KEYDOWN
        end
    end select
    if inkey=chr(27) then end
    
     glClear(GL_COLOR_BUFFER_BIT)
     'gl in here
     if flag then drawstring(50,150,"Hello",rgb(0,100,255),2,800,600)
    flip
Wend

Sub drawstring(xpos As Long,ypos As Long,text As String ,col As Ulong,size As Single,xres As Long,yres As Long)
      glMatrixMode GL_PROJECTION 'save projection
      glPushMatrix
      glMatrixMode GL_MODELVIEW
      glPushMatrix
      
      glMatrixMode GL_PROJECTION 'make ortho
      glLoadIdentity
      glOrtho 0, xres, yres, 0,-1, 1
      glMatrixMode GL_MODELVIEW
      glLoadIdentity
      #define Red(c) ((c) Shr 16 And 255)
      #define Green(c) ((c) Shr  8 And 255)
      #define Blue(c) ((c) And 255)
      #define Alph(c) ((c) Shr 24)
      glColor4ub Red(col),Green(col),Blue(col),alph(col)
      glend
      glpointsize(1.1*size)
      glBegin (GL_POINTS)
      Type D2
            As Single x,y
      End Type
      Static As d2 cpt(),XY()
      Static As Long runflag
      If runflag=0 Then   
            Redim  XY(128,127)
            Redim cpt(1 To 64*2)
            Screen 8
            Width 640\8,200\16
            Dim As Ulong Pointer img
            Dim count As Long
            For ch As Long=1 To 127
                  img=Imagecreate(640,200)
                  Draw String img,(1,1),Chr(ch)
                  For x As Long=1 To 8 
                        For y As Long=1 To 16
                              If Point(x,y,img)<>0 Then
                                    count=count+1
                                    XY(count,ch)=Type<D2>(x,y)
                              End If
                        Next y
                  Next x
                  count=0
                  Imagedestroy img
            Next ch
            runflag=1
      End If
      If size=0 Then Exit Sub
      Dim As D2 np,t
      #macro Scale(p1,p2,d)
      np.x=d*(p2.x-p1.x)+p1.x
      np.y=d*(p2.y-p1.y)+p1.y
      #endmacro
      
      Dim As D2 c=Type<D2>(xpos,ypos)
      Dim As Long dx=xpos,dy=ypos
      For z6 As Long=1 To Len(text)
            Var asci=text[z6-1]
            For _x1 As Long=1 To 64*2
                  t=Type<D2>(XY(_x1,asci).x+dx,XY(_x1,asci).y+dy)         
                  Scale(c,t,size)
                  cpt(_x1)=np
                  
                  If XY(_x1,asci).x<>0 Then
                        If Abs(size)>0 Then
                              glVertex3f (cpt(_x1).x,(cpt(_x1).y),0)
                        End If
                  End If
            Next _x1
            dx=dx+8
      Next z6
      glend
      glMatrixMode GL_PROJECTION 'restore 
      glPopMatrix
      glMatrixMode GL_MODELVIEW
      glPopMatrix
End Sub

Sub inittext Constructor
      drawstring(0,0,"",0,0,0,0)
End Sub


 
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: How to add menus to an MDI Child window

Post by caseih »

Edited by Mod: No spamming, thanks.
Actually you can delete the entire post and ban that account. It's bot spam. The bot just cut and pasted a sentence from a previous post to make his spam appear to fit in (and it worked in this case). I've noticed a dramatic uptick in this kind of link spamming of late across the internet. Sometimes the bots almost sound intelligent, most times they still stand out like a sore thumb!
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: How to add menus to an MDI Child window

Post by jj2007 »

caseih wrote:I've noticed a dramatic uptick in this kind of link spamming of late across the internet. Sometimes the bots almost sound intelligent, most times they still stand out like a sore thumb!
I confirm that, same in the Masm32 forum. And still, they want to send human beings to Mars, in 2040 or so! What a waste of time and fuel, in 20 years time AI robots will be more intelligent than the astronauts they want to send there ;-)
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: How to add menus to an MDI Child window

Post by dodicat »

I don't mind having answered a bot.
But Pig Hill?? was booted out, another one bites the dust.
He/she/it could have been a very nice bot, a boon to the forum with a different slant on things.
Could have been a very good moderator.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: How to add menus to an MDI Child window

Post by D.J.Peters »

@dodicat nice tiny example love it :-)

I have a short tip for the ULONG FBGFX BGRA to OpenGL RGBA
var p8 = cptr(ubyte ptr,@col):swap p8[0],p8[2] : glColor4ubv(p8)

and you can leave the pixel loop much early !

I added all ascii codes 0 to 255 and cleaned the code a bit

If you mix DrawString with other OpenGL commands maybe you should reset the pointsize on end of draw string ?

Iif you don't use the dwExStyle use CreateWindow() instead of CreateWndowEx() !

Joshy

here are the more beauty version :-)

Code: Select all

#ifndef __FB_WIN32__
 #error 666 : Windows only !
#endif

#cmdline "-s gui"
#include "windows.bi"
#include "GL/gl.bi"

type Vector2f
  as glFloat x,y
end type  

Sub drawstring(xpos As Long,ypos As Long,text As String ,col As Ulong,size As Single,xres As Long,yres As Long)
  Static As Vector2f XY(127,255) 
  Static As boolean bInit = false
  dim as Vector2f np,t,v
  
  If bInit=false Then
    ' create font use hidden screen charsize 8x16=128 points/pixels
    ScreenRes 640,480,8,,-1
    Width 640\8,480\16
    For char As Long = 0 To 255
      var img = Imagecreate(8,16)
      Draw String img,(0,0),Chr(char)
      dim as integer pixel
      For x As Long=0 To 7
        For y As Long=0 To 15
          If Point(x,y,img)<>0 Then
            XY(pixel,char).x=x+1
            XY(pixel,char).y=y+1
            pixel+=1
          End If
        Next y
      Next x        
      Imagedestroy img
    Next char
    ' close hidden screen
    screen 0
    bInit=true
  End If
  var nChars = len(text)
  If size=0 orelse nChars=0 Then Exit Sub
  
  ' push projection matrix and set 2D mode
  glMatrixMode(GL_PROJECTION) : glPushMatrix() : : glLoadIdentity()
  glOrtho(0, xres, yres, 0,-1, 1)
  ' push model matrix and set identity matrix
  glMatrixMode(GL_MODELVIEW) : glPushMatrix() : glLoadIdentity()
  ' set OpenGL RGBA color from FBGFX BGRA color
  var p8 = cptr(ubyte ptr,@col):swap p8[0],p8[2] : glColor4ubv(p8)
  ' set point size      
  glPointSize(1.1*size)
  ' begin point drawing
  glBegin(GL_POINTS)
     
  v.x=xpos
  v.y=ypos
  Dim As Long dx=xpos,dy=ypos
  For i As integer = 0 To nChars-1
    Var char = text[i]
    For pixel As Long=0 To 127
      If XY(pixel,char).x=0 then exit for
      ' move
      t.x=XY(pixel,char).x+dx
      t.y=XY(pixel,char).y+dy
      ' scale
      np.x=size*(t.x-v.x)+v.x
      np.y=size*(t.y-v.y)+v.y        
      glVertex2fv (@np.x)
    Next pixel
    dx=dx+8
  Next i
  glEnd()
  glMatrixMode(GL_PROJECTION) : glPopMatrix()
  glMatrixMode(GL_MODELVIEW)  : glPopMatrix()
End Sub

Sub InitText Constructor
  ' dummy call font init
  DrawString(0,0,"",0,0,0,0)
End Sub

Sub SetupGL2D(w as long=640,h as long=480,d as long=32)
  ScreenRes w,h,d,,2
  glDisable (GL_DEPTH_TEST)
  glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
  glEnable (GL_BLEND)
  glEnable (GL_LINE_SMOOTH)
  glOrtho(0,w,h,0,-1,1)
  glClearColor(1,.5,0,1)
End Sub

'
' main
'
Dim As HWND hParent
SetupGL2D()
Screencontrol 2, *Cptr(Integer Ptr,@hParent)
dim as DWORD dwStyle=WS_VISIBLE Or WS_CHILD
Var C = CreateWindow("BUTTON","Message",dwStyle             ,  0,  0, 70,30,hParent,0,0,0)
Var D = CreateWindow("BUTTON","Hello"  ,dwStyle             ,  0, 35, 70,30,hParent,0,0,0)
Var c1= CreateWindow("STATIC",""       ,dwStyle or WS_BORDER,150, 50,300,20,hParent,0,0,0)
Var E = CreateWindow("BUTTON","End"    ,dwStyle or WS_BORDER,150, 80, 60,30,hParent,0,0,0)
Dim As MSG msg
dim as boolean bFlag

While GetMessage( @msg,hParent,0,0)
  TranslateMessage(@msg)
  DispatchMessage(@msg)
  Select Case msg.hwnd
  Case C    : if msg.message = WM_LBUTTONDOWN then
                bFlag=false : setWindowText(c1,"You can press any key to end or click END")
              end if
  Case D    : if msg.message =  WM_LBUTTONDOWN then
                bFlag=true : setWindowText(c1,space(64))
               end if        
  Case E    : if msg.message = WM_LBUTTONDOWN then  exit while
  Case else : if msg.message = WM_KEYDOWN orelse inkey=chr(27) then exit while
  End Select
  glClear(GL_COLOR_BUFFER_BIT)
  if bFlag then DrawString(50,150,"Hello World!",rgba(0,100,255,255),2,800,600)
  flip
Wend 
jmgbsas
Posts: 35
Joined: Dec 26, 2020 16:03

Re: How to add menus to an MDI Child window

Post by jmgbsas »

D.J.Peters wrote:@dodicat nice tiny example love it :-)

I have a short tip for the ULONG FBGFX BGRA to OpenGL RGBA
var p8 = cptr(ubyte ptr,@col):swap p8[0],p8[2] : glColor4ubv(p8)

and you can leave the pixel loop much early !

I added all ascii codes 0 to 255 and cleaned the code a bit

If you mix DrawString with other OpenGL commands maybe you should reset the pointsize on end of draw string ?

Iif you don't use the dwExStyle use CreateWindow() instead of CreateWndowEx() !

Joshy

here are the more beauty version :-)

Code: Select all

#ifndef __FB_WIN32__
 #error 666 : Windows only !
#endif

#cmdline "-s gui"
#include "windows.bi"
#include "GL/gl.bi"

type Vector2f
  as glFloat x,y
end type  

Sub drawstring(xpos As Long,ypos As Long,text As String ,col As Ulong,size As Single,xres As Long,yres As Long)
  Static As Vector2f XY(127,255) 
  Static As boolean bInit = false
  dim as Vector2f np,t,v
  
  If bInit=false Then
    ' create font use hidden screen charsize 8x16=128 points/pixels
    ScreenRes 640,480,8,,-1
    Width 640\8,480\16
    For char As Long = 0 To 255
      var img = Imagecreate(8,16)
      Draw String img,(0,0),Chr(char)
      dim as integer pixel
      For x As Long=0 To 7
        For y As Long=0 To 15
          If Point(x,y,img)<>0 Then
            XY(pixel,char).x=x+1
            XY(pixel,char).y=y+1
            pixel+=1
          End If
        Next y
      Next x        
      Imagedestroy img
    Next char
    ' close hidden screen
    screen 0
    bInit=true
  End If
  var nChars = len(text)
  If size=0 orelse nChars=0 Then Exit Sub
  
  ' push projection matrix and set 2D mode
  glMatrixMode(GL_PROJECTION) : glPushMatrix() : : glLoadIdentity()
  glOrtho(0, xres, yres, 0,-1, 1)
  ' push model matrix and set identity matrix
  glMatrixMode(GL_MODELVIEW) : glPushMatrix() : glLoadIdentity()
  ' set OpenGL RGBA color from FBGFX BGRA color
  var p8 = cptr(ubyte ptr,@col):swap p8[0],p8[2] : glColor4ubv(p8)
  ' set point size      
  glPointSize(1.1*size)
  ' begin point drawing
  glBegin(GL_POINTS)
     
  v.x=xpos
  v.y=ypos
  Dim As Long dx=xpos,dy=ypos
  For i As integer = 0 To nChars-1
    Var char = text[i]
    For pixel As Long=0 To 127
      If XY(pixel,char).x=0 then exit for
      ' move
      t.x=XY(pixel,char).x+dx
      t.y=XY(pixel,char).y+dy
      ' scale
      np.x=size*(t.x-v.x)+v.x
      np.y=size*(t.y-v.y)+v.y        
      glVertex2fv (@np.x)
    Next pixel
    dx=dx+8
  Next i
  glEnd()
  glMatrixMode(GL_PROJECTION) : glPopMatrix()
  glMatrixMode(GL_MODELVIEW)  : glPopMatrix()
End Sub

Sub InitText Constructor
  ' dummy call font init
  DrawString(0,0,"",0,0,0,0)
End Sub

Sub SetupGL2D(w as long=640,h as long=480,d as long=32)
  ScreenRes w,h,d,,2
  glDisable (GL_DEPTH_TEST)
  glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
  glEnable (GL_BLEND)
  glEnable (GL_LINE_SMOOTH)
  glOrtho(0,w,h,0,-1,1)
  glClearColor(1,.5,0,1)
End Sub

'
' main
'
Dim As HWND hParent
SetupGL2D()
Screencontrol 2, *Cptr(Integer Ptr,@hParent)
dim as DWORD dwStyle=WS_VISIBLE Or WS_CHILD
Var C = CreateWindow("BUTTON","Message",dwStyle             ,  0,  0, 70,30,hParent,0,0,0)
Var D = CreateWindow("BUTTON","Hello"  ,dwStyle             ,  0, 35, 70,30,hParent,0,0,0)
Var c1= CreateWindow("STATIC",""       ,dwStyle or WS_BORDER,150, 50,300,20,hParent,0,0,0)
Var E = CreateWindow("BUTTON","End"    ,dwStyle or WS_BORDER,150, 80, 60,30,hParent,0,0,0)
Dim As MSG msg
dim as boolean bFlag

While GetMessage( @msg,hParent,0,0)
  TranslateMessage(@msg)
  DispatchMessage(@msg)
  Select Case msg.hwnd
  Case C    : if msg.message = WM_LBUTTONDOWN then
                bFlag=false : setWindowText(c1,"You can press any key to end or click END")
              end if
  Case D    : if msg.message =  WM_LBUTTONDOWN then
                bFlag=true : setWindowText(c1,space(64))
               end if        
  Case E    : if msg.message = WM_LBUTTONDOWN then  exit while
  Case else : if msg.message = WM_KEYDOWN orelse inkey=chr(27) then exit while
  End Select
  glClear(GL_COLOR_BUFFER_BIT)
  if bFlag then DrawString(50,150,"Hello World!",rgba(0,100,255,255),2,800,600)
  flip
Wend 
Thanks to all I wll try your solutions for this or another project or another version,, , I have done a second windows with windows9.bi the russian solution I am learnig quiet and slowly....I am not BOT sorry
I am a human been from buenos aires argentina,,,my first GUI project is this in GIT has much erros and is only imperative code....little organization,,
https://github.com/jmgbsas/ROLLMUSIC it is runnig little to little has tracks and a song build....is a sequencer that use letters..as input
Greetings to all and Thanks :) I am beginner,,,
Post Reply