LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Start CVI app minimized

Dear all,

I have the following strange effect with a CVI 8.1 application under XP:

 

To avod the two taskbar buttons I have the following call at the beginning of my program:

 

SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0);

 

This works fine under "normal" conditions.

 

However, I would like to start-up my CVI application automatically with Window. To avoid a blocking of the full screen I also would like to start it minimized.

So  I generated a link to the EXE and copied that to the autostart folder. Also I configured in the link properties to start the application window starts minimized.

 

Starting the application using this link causes the the window to be displayed in normal mode (window visible). Also the second taskbar button for the CVI runtime is visible again.

 

So here are my questions:

1. How can I start-up my application minimized (not always but when commanded to do so in the link)?

2. How can I avoid the second taskbar button for the CVI runtime in this case?

 

Any suggestions?

Thanks beforehand!

0 Kudos
Message 1 of 2
(3,121 Views)

(1) It is the responsibility of the application itself to respond to a request to start normally, maximized, minimized or hidden - so you will have to add some code to do it. Instead of using main() as the entry point to your application, you should use WinMain() instead, which has the following prototype:

 

int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // command line
int nCmdShow // show state
)

 or alternatively (without data types defined in windows.h):

 

 

 

 

int __stdcall WinMain (void * hInstance, void * hPrevInstance, char * lpCmdLine, int nCmdShow)

 

The final parameter nCmdShow  indicates how the application should start. Further information on the parameters is contained in the Windows API help (or MSDN online, whichever is more convenient).

 

(2) I don't know the answer to this one - I've never seen an inconsistent response such as the one you describe.

 

--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 2
(3,094 Views)