i prefer to have my inputs from the mainwin. when i open a graphics window, the graphic window is active and i have to click on the mainwin to make it active and continue with my inputs. i've tried dll "setactivewindow" but cant get the syntax right. can anyone out there help ?
It is probably possible to find the handle of the mainwin and with API calls to set the focus on it. However it will still need moved about and sent to back / brought to front etc. That's a lot of API code. It would be much simpler to add a textbox or texteditor to the foot of the graphicbox. It will be 100% better integrated than the mainwin.
The mainwin is really designed for testing and debugging, it shouldn't be there when the program is running well. That's why it has (relatively) limited functionality.
What kind of text input do you need? is it command strings, instructions or general text? Folks could code examples of alternative input if you described the task in hand a little more.
I agree with Rod use a GUI but I did play around with an api some time back, I was using mainwin to check my logic and results and wanted it to close after closing my GUI and not have to close two forms....some of the code is here
CallDLL #user32, "GetActiveWindow",_ hMainwin As uLong 'returns handle of MainWin
x=200 : y=350 : w=450 : h = 350 CallDLL #user32, "MoveWindow",_ hMainwin As uLong,_ 'handle x As Long,_ 'x location y As Long,_ 'y location w As Long,_ 'width h As Long,_ 'height 1 As Boolean,_ 'repaint, 1=true r As Boolean 'nonzero=success
hi Metro - i'm not an great code writer. I've tried to break this down to something really simple. The following code sets the size of the mainwin and places it on the upper left hand side of the screen. It then opens a simple graphics window called PLOT. This window becomes the active window. All I want to do is to make the mainwin the active window. I've tried bits of your code but still cant nail it. Would be great if you could help. cheers rwg
open "user32" for dll as #1 calldll #user32,"GetActiveWindow",_ mainwinhandle as short calldll #user32,"MoveWindow", _ mainwinhandle as word, _ 0 as short, _ 0 as short, _ 300 as short, _ 600 as short, _ 1 as word, _ result as void close #1
open "PLOT" for graphics_nsb_nf as #w.g
calldll #user32, "SetActiveWindow",_ mainwinhandle as short '?