|
Thnks, i know it is in comdef.h, which is part of windows 2003 SDK kit. i have included it but still in vain, may be some library or something elese is missing. please help. infact i have a program which work in .net 2003 but when i try to convert it in to .net 2005, this error occurs while compiling.
|
|
|
|
|
I have a application based on a CFormView class btw I use VC++ 2005. I want to know when the x button of the mainFrame is click how to send the app in the status bar instead of closing it. It already work with the File->Quit menu ( I use ON_COMMAND(ID_APP_EXIT, &NameOfTheClassView) ) but I don't know what happen in the code when the X button is clicked so I don't know where to add the code to send my app in the status bar.
Thanks for helping me.
David
|
|
|
|
|
HiEverybody wrote: I want to know when the x button of the mainFrame is click how to send the app in the status bar instead of closing it.
Search CP for Shell_NotifyIcon() examples.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I already know all the stuff concerning Shell_NotifyIcon(). My question is how to intercept the X bouton in the main window and then hide the window so that only the tray icon will be visible.... ( intercept here is the KEY word ).
|
|
|
|
|
HiEverybody wrote: My question is how to intercept the X bouton in the main window...
Handle the WM_CLOSE message.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I tried with this code. It's not working. What is missing ??
ON_MESSAGE(WM_CLOSE , CloseAppToTray)
LRESULT CSolsticeAcquisitionView::CloseAppToTray(WPARAM wParam, LPARAM lParam)
{
// MessageBox("Test"); // This is not displaying
CWnd *mainWindow;
mainWindow=AfxGetMainWnd() ;
mainWindow->ShowWindow(SW_HIDE);
return 0;
}
Thanks
David
|
|
|
|
|
Use ClassWizard (Ctrl+W) to create a function for the WM_CLOSE message. The net result will be something like:
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CLOSE()
END_MESSAGE_MAP()
void CMainFrame::OnClose()
{
CFrameWnd::OnClose();
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm using Visual Studio 2005. No class wizard in there!!!
|
|
|
|
|
HiEverybody wrote: I'm using Visual Studio 2005. No class wizard in there!!!
Technically, yes, but the functionality is alive and well.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ctrl-W do nothing.....
Are you using Visual Studio 2005 ?
I have already use VC6 and the class wizard was there... but were can I find it in Visual Studio 2005 ?
|
|
|
|
|
HiEverybody wrote: Are you using Visual Studio 2005 ?
No.
HiEverybody wrote: ...but were can I find it in Visual Studio 2005 ?
Right here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Sure there is.
Well sort of.
HiEverybody, use the "Class View" and select the class and then use the "Properties" window.
|
|
|
|
|
Thanks , I finally solve my issue with your help !
|
|
|
|
|
Hi everybody,
i like to redirect the Output of a process ( Console ) to my "Server".
During i create the ChildProcess, i set the STARTUP_INFO's Output,Input and Error Handler
to my own Handler and set the Flags to STARF_USESTDHANDLER.
CreateProcess() is called with the parameters to open a new console window and BOOL bInheritHandles is also set to TRUE.
If the process is created, CreateProcess() return TRUE, but the application dies directly.
( Verified in the TaskManager )
Does CreateProcess and CREATE_NEW_CONSOLE in a Console-Project make trouble?
Or why won't it work ?
Big thanks for help
|
|
|
|
|
|
Hi, thanks for your reply
I tested the program with a Microsoft-Example and i see the (propably) error :
PDCurses retrieves the number of columns and rows of the console window and gets 1x1
which is too small
PDCurses gets this informations with a getenv("LINES");
Propably LINES and COLS are environment variables, especially for consoles.
And with a redirected output it's not calculated.
I tested already to set the LINES and COLS by setting the STARTUP_INFORMATION
dwXSize and dwYSize to values over 200 pixels
No effect
|
|
|
|
|
baerten wrote: PDCurses
Sorry I dont have any idea about the PDCurses. if LINES and COLS are environmental varibles you guss, just confirm it with the some utility like process explorer.
|
|
|
|
|
I have created an MFC application with doc/view support, SDI having editview window.
I want to know what is the position (Co-ordinate) of the cursor every time the position of the cursor is changed.
How to achieve this?
Thanks and regards.
|
|
|
|
|
Hi,
handle the ON_MOUSEMOVE Message. Then you get the coordination of the mouse by
creating a COORD and assign it to the LPARAM ( if not the WPARAM )
CPoint point(LOWORD(lParam),HIWORD(lParam));
There are seriously syntax error in my example ( i'm not on a developer maschine )
but it works
|
|
|
|
|
Sorry, but I am not talking about Mouse Cursor Position.
I meant to retrieve the coordinates of the selected text
initial and final.
|
|
|
|
|
GetEditCtrl().GetSel()
Or maybe you will have to catch some notifications, like EN_CHANGE .
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
I am telling again, I want Co-Ordinates not the index of the cursor.
I mean to say that X and Y distance in PIXEL from the top left corner from the view window for the current scroll position.
Apology if I could not communicate properly earlier.
|
|
|
|
|
Use the EM_GETSEL , EM_LINEFROMCHAR , and EM_LINEINDEX messages.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry, but none of the above returns the Co-Ordinates.
I want the coordinates not the index of the cursor.
Is there any function or property which returns the X and Y distance of the cursor from top-left corner of the view window?
|
|
|
|
|
Anurag Gandhi wrote: I want the coordinates not the index of the cursor.
And the distinction is? What I suggested to you would provide you with the row/column of the cursor.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|