The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Origin, minimized or hidden
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

johanander

Sweden
1 Posts

Posted - 11/04/2002 :  09:11:21 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have created an application that uses Origin to plot diagrams. My problem is that I would like Origin to run in the background or minimized. How can I do that?

Mike Buess

USA
3037 Posts

Posted - 11/05/2002 :  10:36:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can minimize a worksheet or plot window using LabTalk, but not the Origin program window itself. I don't think there is an Origin C solution either, although I wouldn't be surprised if one is added eventually. Seems like a reasonable request to me.

Perhaps you could do it from your application. Aren't there standard API methods for things like that?

Mike Buess
Origin WebRing Member
Go to Top of Page

easwar

USA
1964 Posts

Posted - 11/05/2002 :  1:35:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can minimize the application using an API call.

For example, the following Origin C function minimizes the Origin application and then maximized after a 10 sec delay. You could get the handle of the Origin application and then use it in your outside application to minimize Origin, like Mike suggested.

Easwar
OriginLab.


void test()
{
HWND hWnd = GetWindow();
bool bret = ShowWindow(hWnd, SW_MINIMIZE);
Sleep(10000);
bret = ShowWindow(hWnd, SW_NORMAL);

}


Note: You will need to add the following to the header file mswin.h in the \OriginC\System subfolder for the above code to work:

#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_MAXIMIZE 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
#define SW_FORCEMINIMIZE 11
#define SW_MAX 11

BOOL WINAPI ShowWindow(HWND hWnd, int nCmdShow);
Go to Top of Page

greg

USA
1378 Posts

Posted - 11/05/2002 :  5:00:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you have everything automated, then you can actually run Origin hidden with a command line switch:
C:\Program Files\Origin\Origin70.exe /h myproject.opj
Just be sure to end your automation with:
exit;
to close Origin.
Note : If you exit Origin leaving the Script Window Open, then the command line above will launch Origin hidden, but the Script Window will be visible. You can type exit in the Script Window and press Enter to shutdown Origin.



Edited by - greg on 11/05/2002 5:01:41 PM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/05/2002 :  7:16:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That's pretty neat, Greg. You could use the script window as a fancy command line calculator.

Out of curiousity, can you launch a Dialog Builder dialog while Origin is hidden? IOW, create your own GUI?

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000