|
Good question... I created a test MDI project and tried that approach first, to discover that my tesellation got overdrawn by the standard dark-grey background (I noticed because of the flickering). I remembered then about that funky, mostly unknown CMainFrame::m_hWndMDIClient member and how it seems to take on some of the roles people tend to ascribe to CMainFrame itself... got it subclassed and WM_ERASEBKGND -handled, and it worked. Couldn't say if this is the most direct approach. Any ideas?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Interesting - I've only ever done this in a view, so I had no idea of this problem. Sounds like it's worth a fiddle sometime.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
...so I had no idea of this problem
Neither did I Thought I'd write a test before submitting an answer, and came to this (to my surprise).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
All,
I'm minimizing my dialog to the system tray. IE. I add an icon to the tray and then ShowWindow(SW_HIDE) my dialog.
I'm set up a command handler for a left click of my icon in system tray, and I want to show the window, and put it at the front with the focus. simple stuff.
But it never works. It always has the focus (ie, it's button on the task bar is depressed), but is behind other windows!?
Has anyone seen this problem?
SetWindowPos(&wndTop,NULL,NULL,NULL,NULL,SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
SetFocus();
is what i'm doing.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I guess there're many ways to get this done. This particular combination
ShowWindow(SW_SHOW);
SetForegroundWindow(); seems to work fine.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Tried that, it's a step better, in that it worked properly with restoring the window when i'd got rid of it in my WM_CLOSE handler. But if i'd got rid of the window in WM_SIZE => SIZE_MINIMIZED, then the re-show of the window still didn't put it at the front. Now i'm using ShowWindow(SW_RESTORE) and that's doing the trick. Evidently it was reshowing the window but still leaving it minimised.
Thanks for your help Joaquin!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Is there some easy way to log error output in Debug window in pure SDK programming ? I used to work with TRACE macro in MFC, but from what I gathered in the help, I can't use it in SDK.
|
|
|
|
|
OutputDebugString gives you the basic functionality. From here you can build up added flexibility in a manner similar to MFC (you can have a look at MFC AfxTrace code for inspiration.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
If i try to bind a column all works fine:
SQLBindCol(hstmt,1,SQL_C_LONG,var_ptr,0,0);
but if i try to get data like this:
SQLGetData(hstmt,1,SQL_C_LONG,var_ptr,0,0);
nothin happens...
Help please...
|
|
|
|
|
Need Help in making an Eraser Tool for our Drawing Program... please help
|
|
|
|
|
What exactly do you want it to do ? Do you have layers in your program ? Are you drawing a shape and then hoping to erase parts of it ?
I've written a paint package, so chances are good that I can help, but I need some more info on what you want it to do. Also, what is the internal structure of your image ? Are you using GDI + ? Supporting oversize images ? Using any external libraries such as FreeImage or PaintLib ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Its just like the paintbrush program in WINDOWS.... There are no layers... as soon as I erase on an area it will be erased, the area will show a white color which is the color of my drawing area...
I'm using FreeImage....
thank you for looking into this...
|
|
|
|
|
Too easy - you just want a drawing tool that always draws in white. Where are you stuck ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Can you give me a code for the eraser tool coz i really need it and i am quite new using MFC.... thanks
|
|
|
|
|
What paint tools have you written, any ? What is the architecture of your program ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Hi,
I have written a SDI based MFC Application.In that i have
((CMyAppApp*)AfxGetApp())->m_pMainWnd ->EnableWindow(FALSE);//I want to disable all the keyboard & mouse inputs for my main window.
After this
If i write
if(((CMyAppApp*)AfxGetApp())->m_pMainWnd ->IsWindowEnabled())
It returns me TRUE;//ie window is enabled.
Could any one pl tell me why it is failing to disable the window?
Thanks
Neha
|
|
|
|
|
I've just created a fresh SDI app and added a command handler where I inserted your very line of code, and everything works as expected (i.e. the main window is disabled and IsWindowEnabled returns FALSE ). Are you doing something bizzare in the processing of the WM_ENABLE message?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Neha wrote:
((CMyAppApp*)AfxGetApp())->m_pMainWnd ->EnableWindow(FALSE);//I want to disable all the keyboard & mouse inputs for my main window.
Could you tell us, where you have put this code.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
I had written that in a OnButtonClick()..
|
|
|
|
|
The frame window's OnButtonClick???
Or the view window's OnButtonClick???
Remember that the button messages go to the view and are not handled by the frame window, unless there is no view window.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Thanks for the reply.
It was in View Window.
I got the problem fixed,i had just removed (CMyAppApp*).
It worked fine.
Thanks again..
Neha
|
|
|
|
|
Hi,
I have an instance of Ms Word automated, and I would like to go iterating through all the ActiveX that the doc contains, it´s that possible ?
( I have some ActiveX of my own in that doc, so my idea is to iterate through all the controls and ask if they have my interface implemented, to handle them or not).
Thanks, Bye !
Braulio
|
|
|
|
|
HI
I will have to develope a new telephony service provider. I want Outlook can choose my new tsp from the dial options and also it appears in the modems advanced tab as ne telephony service.
Can someone tell me where I can download a source code to see it and use it as a guide??
Thank you
|
|
|
|
|