Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an EXE that runs minimized or hidden

Status
Not open for further replies.

nytyme

Programmer
Jan 8, 2001
19
US
i want to make a Win32 application that runs minimized or hidden.
i've built everything except that part. to make it run minimized i was trying to use ShowWindow(). This requires a handle to the window to be affected.

so my questions are:
How can I get the handle of the exe at runtime?

is there a way to make a window run minimized on activation, using a resource or properties? i know you can make it run that way in NT, but i don't know how.
 
nytyme,

I would need more claification to help. There are a couple of types of 'hidden' applications, i.e., System Tray applications hide there main interface until the user calls it up from the associated tray icon. Windowless applications are normally designed to be 'services' in NT/Win2k, don't know how they run in 95/98/ME.

-pete
 
how would i make it a service?
is there an easy example or program that does it?

i have an application that runs for 8 seconds, but i don't like the console appearing because it distracts the user. its for an NT 4.0 environment.

whats happening is when the user clicks a link or hits the shortcut, the application will run.
 
Complete no-brainer response:
Have you looked at changing the properties of the shortcut to run "Minimized"?
I know it works on 9x systems, I don't have time to check an NT box but I think it works the same.

Bring up the properties for the shortcut choose the program tab then select Minimize for the Run: dropbox.
 
1. At runtime the finction WndProc, has the first argument your hWnd.
2. You can make your program without a window.
There is the shortest Win32API program. Is perfect legal.
-------------------------
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
return 0;
}
-------------------------
3. If you are a COM programmer and need your program to end at PostQuitMessage(0), you can do
-------------------------
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
//do some thing, or make nothing
MSG msg;
while(GetMessage(&msg,0,0,0))
{
DispatchMessage(&msg);
}
return 0;
}
-------------------------
 
Hi John,

thanks for the info, I'm sure WndProc will be useful to me later. but to solve this problem, the solution was alot easier than i noticed first off. Win32Apps do not
require a window to perform. so i made a windowless application and get the desired
results.

Thanks,
Sean
 
There is a way to use a WndProc without a window. Yo may just use the function CallWindowProc inside the main loop.
 
hmm seems like Nytime is trying to perfect his trojan horse.
Maybe I dont know. just an asumption.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top