Programm beim Start unsichtbar machen ohne "aufblinken"

Executer

Mitglied
Ich habe eine Frage: Ich möchte mein Programm unsichtbar starten lassen, welches sobald gewisse Vorraussetzungen gegeben sind sichtbar wird. Das Unsichtbar machen erledige ich mit ShowWindow(FALSE);
Das funktioniert auch soweit, nur dass es ganz kurz aufblinkt bevor es wieder unsichtbar wird.
Wie kann ich machen das es aber erst gar nicht gezeichnet wird? Oder dass es zumindest nicht "aufblinkt"?
Ich hoffe ich habe mein Problem verständlich dargelegt.

mfg

Executer
 
Code:
 BOOL CTApp::InitInstance()
{
AfxEnableControlContainer();
 
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
 
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
 
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
 
 
// To create the main window, this code creates a new frame window
// object and then sets it as the application's main window object.
 
CMainFrame* pFrame = new CMainFrame;
m_pMainWnd = pFrame;
 
// create and load the frame with its resources
 
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
 
 
 
 
// The one and only window has been initialized, so show and update it.
pFrame->ShowWindow(SW_HIDE); HIER STATT SW_SHOW SW_HIDE EINTRAGEN
pFrame->UpdateWindow();
 
return TRUE;
}


Dann versteckst du das Programm beim Start, aber du kannst es dann auchnicht mehr normal beenden ! Nur noch über den Task Manager.
 
Zuletzt bearbeitet:
Kann ich mir nicht vorstellen, dass das nicht anders geht :eek:
Schon mal probiert die Fensterbreite und -Höhe auf 0 zu stellen?
Hab grad nur Linux zur Hand, ich kann das daher nicht selber testen.
 
Ich kann mir nicht vorstellen wozu sowas gut sein soll ausser anderen Leuten ungewünscht und unbemerkt ein Programm unterzujubeln!
 
Wenn die Bedingung von deinem Code erkannt wird, ohne dass der Anwender das Programm bedienen muss, kannst du es genauso wieder sichtbar machen mit AfxGetMainFrame()->ShowWindow(SW_SHOW), an der Stelle, wo die Bedingung abgefragt wird (z.B. über einen Timer)
 
Zurück