Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CSocket trouble Pin
Antony M Kancidrowski2-Sep-04 6:08
Antony M Kancidrowski2-Sep-04 6:08 
GeneralDeveloping UDP server using listbox Pin
akhtarparvez2-Sep-04 3:34
sussakhtarparvez2-Sep-04 3:34 
GeneralDetecting if a Dialog is Modal or Non-Modal (Modeless) Pin
James R. Twine2-Sep-04 3:33
James R. Twine2-Sep-04 3:33 
GeneralRe: Detecting if a Dialog is Modal or Non-Modal (Modeless) Pin
PJ Arends5-Sep-04 10:26
professionalPJ Arends5-Sep-04 10:26 
GeneralAnimated gif in VC5 Pin
walvdlz2-Sep-04 3:13
walvdlz2-Sep-04 3:13 
GeneralHeight and Width of Title ba Pin
persian_boi2-Sep-04 3:01
persian_boi2-Sep-04 3:01 
GeneralRe: Height and Width of Title ba Pin
David Crow2-Sep-04 5:12
David Crow2-Sep-04 5:12 
Generalstarting the application minimized - on system tray Pin
caykahve2-Sep-04 1:57
caykahve2-Sep-04 1:57 
I used Shell_NotifyIcon to minimize the application to the nofitication area (system tray) and put an icon there. When the minimize button of the system menu is pressed, the dialog is minimized to the system tray. It was working perfectly until I tried to put an option in the title bar menu, which gave the possibility to choose whether or not to start the application as minimized. I save this information in a file, and read from the file on initialization.

The problem is that the application starts as minimized, but the main dialog can never be displayed when the Menu->Open is clicked from the tray menu. I guess it is restored to the previous position, and the previous position was "minimized".

Does anyone know how to overcome this problem?

Thanks in advance...

PS: my dialog is of fixed size.

CMyDialog::OnInitDialog()
{
	...
	// TODO: Add extra initialization here	
	//
	if(startOnTray)
	{
		SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_HIDEWINDOW); // start on tray

		// form tray icon and minimize the application, normally called when minimize button of the system menu is pressed.
		this->Minimize2NotifArea(); 
	}
	else		
		SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); // normal start

	return TRUE;
}


CMyDialog::OnMenuOpen()
{
	// delete tray icon
	Shell_NotifyIcon(...);

//	// supposed to display the dialog here.
 	this->ShowWindow(SW_RESTORE);
}

GeneralRe: starting the application minimized - on system tray Pin
James R. Twine2-Sep-04 3:42
James R. Twine2-Sep-04 3:42 
GeneralRe: starting the application minimized - on system tray Pin
caykahve2-Sep-04 4:11
caykahve2-Sep-04 4:11 
GeneralRe: starting the application minimized - on system tray Pin
James R. Twine2-Sep-04 4:19
James R. Twine2-Sep-04 4:19 
GeneralMFC Multiple windows (pages) Pin
Jens Christiansen2-Sep-04 1:40
Jens Christiansen2-Sep-04 1:40 
GeneralRe: MFC Multiple windows (pages) Pin
RChin2-Sep-04 1:47
RChin2-Sep-04 1:47 
GeneralRe: MFC Multiple windows (pages) Pin
Jens Christiansen2-Sep-04 1:56
Jens Christiansen2-Sep-04 1:56 
GeneralRe: MFC Multiple windows (pages) Pin
vikramlinux2-Sep-04 2:29
vikramlinux2-Sep-04 2:29 
GeneralRe: MFC Multiple windows (pages) Pin
Jens Christiansen2-Sep-04 8:56
Jens Christiansen2-Sep-04 8:56 
GeneralRe: MFC Multiple windows (pages) Pin
David Crow2-Sep-04 2:45
David Crow2-Sep-04 2:45 
GeneralRe: MFC Multiple windows (pages) Pin
Jens Christiansen2-Sep-04 8:57
Jens Christiansen2-Sep-04 8:57 
GeneralRe: MFC Multiple windows (pages) Pin
David Crow2-Sep-04 9:23
David Crow2-Sep-04 9:23 
GeneralFun with Loading Windows Drivers Pin
Joel Holdsworth2-Sep-04 1:31
Joel Holdsworth2-Sep-04 1:31 
GeneralRe: Fun with Loading Windows Drivers Pin
Alexander M.,2-Sep-04 9:33
Alexander M.,2-Sep-04 9:33 
GeneralPrecompiler Directive Pin
Anonymous2-Sep-04 1:12
Anonymous2-Sep-04 1:12 
GeneralRe: Precompiler Directive Pin
Joel Holdsworth2-Sep-04 1:39
Joel Holdsworth2-Sep-04 1:39 
GeneralRe: Precompiler Directive Pin
Henry miller2-Sep-04 3:21
Henry miller2-Sep-04 3:21 
GeneralCreate Process on remote machine Pin
vikramlinux2-Sep-04 1:02
vikramlinux2-Sep-04 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.