|
No, he wants it in the non-client area.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
|
Dave Matrix wrote:
So, do i have to wait for these two messages to happen in quick succession, to conclude that a mouse click happend?
Just handle OnNcLButtonDown. It's called when you click on the non-client area like say the caption. Once OnNcLButtonDown is called however, OnNcLButtonUp is not called. OnNcLButtonUp is called only when you drag the mouse into the non-client area and release the mouse there
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Does anyone have any tips on how to do a screen capture the same way windows does it when pressing the Print Screen key?
I don't mean simulating a key click programmatically and then retrieving the clipboard data, I mean doing it via GetDC() etc
Currently I do it using GetDC(NULL); and then BitBlt'n to my DC but this doesn't grab layered windows on Win2k/XP which have a partial transparency.
|
|
|
|
|
Hi,
Does anybody have any sample about Automation with Outlook 2000? I need something like:
1) get what messages are stored inside each folder,
2) delete a message
3) read a stored message
and so on...
Thank u very much,
Dirso
|
|
|
|
|
See Q241287 and Q220600 in Microsoft KnoledgeBase
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Is there a routine already written and available to convert from a string (or CString object) to a date/time variable (such as a CTime object, SYSTEMTIME structure or FILETIME structure)?
|
|
|
|
|
Take a look at COleDateTime::ParseDateTime()
Dave
|
|
|
|
|
Hello,
I wrote a program that opens DIBs (bitmaps) and saves them as well.
I'd like to be able to snap image/screen cap them, similar to the way Window->new opens a new window with the information from the old window in it. (i.e. a Bitmap in one window will appear in the next if I click window->new.)
Does anyone know how I can get the DIB of that open window? Or where the code that Window->New uses is? I'd like to actually see the code for hwo it is done, so I can write my own window->new. Even if that sounds redudant, it's a good learning thing.
Not to be too pesky, but if anyone knows where the code FileOpen uses is is also, I'd like to know. I'd like to write my own File Open that does the same thing.
Thanks guys,
NickOne
|
|
|
|
|
FileOpen calls stuff from your Mainframe down to your Document class. File|New, if it copies the bitmap, would do it on the internal resource. Getting a DC to the screen and copying the bitmap is how you do a screen capture. Something like CWindowDC dc(NULL);
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Hello,
MSDN says
void UpdateAllViews(
CView* pSender,
LPARAM lHint = 0L,
CObject* pHint = NULL );
Now this call is in my menuclick event in the doc cpp. Lets say a view class called CViewTwo generated the click. I want view1 to reflect the changes, but not sending class (the CViewTwo class). I think if I dont have a NULL argument, it excludes the update of pSender. I am not sure exactly what will go into CView* pSender. How do I get the pointer to my sending viewclass from the doc click event?
Thanks so much!
|
|
|
|
|
If your doc handles the click, there is no sending view.
You need to handle the click in the view, not the doc, to do what you're asking.
|
|
|
|
|
CDocument::GetFirstViewPosition
MSDN Says it better
Papa
Murex Co.
Papa Charchabil
|
|
|
|
|
jim is right
to do your task the calling should be in view
it can be done in following way
suppose your classes are
CMyDoc
CView1
CView2
now in CView2 class on handler of the click event u can do this
CMyDoc *pDoc=this->GetDocument();
pDoc->UpdateAllViews(this);//passing this as argument excludes the view from which the function is called
pDoc->UpdateAllViews(NULL);//updates all views attached to document including the view from which the function is called(in this case view2)
surbinsho
|
|
|
|
|
Thank you so much for the responses. It works well, but I do have to set the controls newvalues by coding the OnUpdate event of the view thats supposed to reflect the changes. I get the doc pointer both in the sending view (to set the new value for the doc variable , as well as in the receiving view where I get the doc pointer in order to access the newly changed value.
Thanks,
ns
|
|
|
|
|
I'm writing a screen saver using the scrnsave library. I'm having a problem opening an Open Dialog box to browse for files. Here is the code i have right now, I want it to launch the Open Dialog box when a button is clicked on the config dialog(ScreenSaverConfigureDialog).
I've been working on this one problem since yesterday and I can't figure it out. Am I missing something here? any help would be greatly appreciated.
BOOL WINAPI RegisterDialogClasses(HANDLE hInst){
return TRUE;
}
BOOL WINAPI ScreenSaverConfigureDialog(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam){
OPENFILENAME ofn;
char szFile[260];
switch(message){
...
case WM_COMMAND:
switch(LOWORD(wParam)){
case ADD_IMAGES:
//initialize OPENFILENAME(ofn)
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hdlg;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
//displays the box
if(GetOpenFileName(&ofn)){
...
}
break;
}
...
}
}
|
|
|
|
|
el_robert wrote:
I'm having a problem opening an Open Dialog box to browse for files.
Well, you didn't say exactly what problem you are stuck on.
If you just want to browse for a file, and you are working in MFC, I suggest you use CFileDialog. If you need a code sample, just let me know.
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
I don't know if this will solve your problem, but you are not passing it a FilterList string. You can do this by adding a line, something like the following, before you call GetOpenFileName():
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
in response to marshall:
I cant get the dialog to pop up, but i'm also not getting any errors. I am not using mfc because I would have to do workarounds to use it with scrnsave.lib, and I only want to do that as a last resort.
in response to Roger:
I have that in there but it still doesnt work.
thanks to both of you for responding.
|
|
|
|
|
changed:
char szFile[260];
to:
char szFile[MAX_PATH] = "";
and it worked
|
|
|
|
|
A while ago I came across an article on how to enable disabled controls in an application from another application. Does anyone know where the link is?
Thanks
|
|
|
|
|
Please forgive me if this is the same question several times. Maybe there is a common answer to all.
In a SDI MFC project:
I have a handler in the MainFrame class that needs to call a function in the view. How do I do this? Do I have to use a user defined message for this or is there a better way?
What about the reverse - if I want to call a function in the MainFrame class from a member function of the view?
Also calling a func in the app class from view or MainFrame.
This seems simple but I have searched in the FAQ and articles without success.
Thank you
|
|
|
|
|
For an SDI app, the main frame is simply derived from CFrameWnd, so you can call the GetActiveView() member of CFrameWnd to retrieve the current view.
The reverse is easy: there are two relevant global functions here. AfxGetApp() which returns the application object, and AfxGetMainWnd(), which returns the main window of the application (in this case, the main frame).
Dave
|
|
|
|