Would this be possible in MSC?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Would this be possible in MSC?

Post by jj45410 » Wed Jul 21, 2010 9:45 pm

Alright, so imagen a simple box, with the menus. Say we have different menus for different types of programs. Apps, Office, etc

Alright, now say I wanted to open one of these programs but I don't want it to open in a different window. I want it to open in the box itself. Therefore, I can still see the menus, but the program is inside the box.

Also, I was wondering if there was a way to color the outside of the box. Say I want the top of the program (Where it said the name of it) red.

I'm not sure if you can picture what I'm saying, if not I'll try draw a (VERY BASIC) drawing of it in paint.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Jul 22, 2010 1:10 am


jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Yea

Post by jj45410 » Fri Jul 23, 2010 4:49 am

Thats what I'm looking for, but I need it for a Program not a Browser.

I fiddled around with that and I couldn't get it to work with a Program.
Actually at one point I thought I made progress but it just broke the script and prevented it from even opening the program normally.

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 23, 2010 12:45 pm

...but I need it for a Program not a Browser.
OK. Here's the same thing slightly rewritten for Notepad.

Code: Select all

OnEvent>DIALOG_EVENT,Dialog1,10,GoMjtnet
OnEvent>DIALOG_EVENT,Dialog1,20,GoGoogle
OnEvent>DIALOG_EVENT,Dialog1,2,Quit

Dialog>Dialog1
   Caption=Dialog1
   Width=735
   Height=446
   Top=301
   Left=236
   TabBook=msTabBook1,136,-4,577,405,0
   Button=Type mjtnet,8,8,111,25,10
   Button=Type Google,8,48,109,25,20
   Button=Close,8,375,119,25,2
      TabPage=Page1
   EndTabBook
EndDialog>Dialog1

Let>RP_WINDOWMODE=0
Run>NotePad.exe
WaitWindowOpen>NotePad*
GetWindowHandle>NotePad*,hIEWnd

LibFunc>user32,SetParent,r,hIEWnd,DIALOG1.MSTABBOOK1.HANDLE

Let>WIN_USEHANDLE=1
WindowAction>1,hIEWnd
Let>WIN_USEHANDLE=0

Show>Dialog1

Label>ActionLoop
  Wait>0.01
  GetDialogAction>Dialog1,res1
  If>res1=2,Quit
Goto>ActionLoop


SRT>GoMjtnet
  SetFocus>NotePad*
  Wait>0.1
  Send>MJTnet is the GREATEST!%CRLF%
  ResetDialogAction>Dialog1
END>GoMjtnet

SRT>GoGoogle
  SetFocus>NotePad*
  Wait>0.1
  Send>Google is ok too.%CRLF%
  ResetDialogAction>Dialog1
END>GoGoogle

SRT>Quit
  Exit>0
END>Quit

jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Post by jj45410 » Fri Jul 23, 2010 7:14 pm

Alright, That is more like what I need but It will be much bigger,

Like I want the window to start out blank, NO programs in it.
Then, After going into one of the MainMenu items and hitting a program (still inside the box here) I want it to open in the box, BUT I want to put tabs in so you can have multiple windows at once.

I'm not sure if MSC can do this or not.

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 23, 2010 8:15 pm

This uses buttons instead of tabs but the feel is the same.

Code: Select all

OnEvent>DIALOG_EVENT,Dialog1,10,OpenNotePad
OnEvent>DIALOG_EVENT,Dialog1,20,OpenPaint
OnEvent>DIALOG_EVENT,Dialog1,2,Quit

Dialog>Dialog1
   Caption=Dialog1
   Width=737
   Height=452
   Top=181
   Left=377
   TabBook=msTabBook1,0,23,729,401,0
   EndTabBook
   Button=Notepad,0,0,50,25,10
   Button=Paint,51,0,50,25,20
   Button=Close,102,0,50,25,2
EndDialog>Dialog1

Let>RP_WINDOWMODE=0
Run>NotePad.exe
WaitWindowOpen>NotePad*
GetWindowHandle>- NotePad*,NPhwnd
Run>msPaint.exe
WaitWindowOpen>Paint*
GetWindowHandle>- Paint*,PThwnd

Show>Dialog1

Label>ActionLoop
  Wait>0.01
  GetDialogAction>Dialog1,res1
  If>res1=2,Quit
Goto>ActionLoop


SRT>OpenNotePad
  Let>WIN_USEHANDLE=1
    WindowAction>2,PThwnd
    LibFunc>user32,SetParent,r,NPhwnd,DIALOG1.MSTABBOOK1.HANDLE
    wait>0.5
    WindowAction>1,NPhwnd
  Let>WIN_USEHANDLE=0
  ResetDialogAction>Dialog1
END>OpenNotePad

SRT>OpenPaint
  Let>WIN_USEHANDLE=1
    WindowAction>2,NPhwnd
    LibFunc>user32,SetParent,r,PThwnd,DIALOG1.MSTABBOOK1.HANDLE
    wait>0.5
    WindowAction>1,PThwnd
  Let>WIN_USEHANDLE=0
  ResetDialogAction>Dialog1
END>OpenPaint

SRT>Quit
  Exit>0
END>Quit

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts