|
|
Thanks all
I got this fixed.
|
|
|
|
|
Dear all,
I want to write a program in which the main form will transparent to mouse, but the requirement is: when I click on the form, it will turn transparent and let the mouse click through it, but when I drag the mouse, the form will not be transparent so that I can draw on it.
I found many articles teaching how to make a transparent form to mouse by using layered window with ModifyStyleEx and WS_EX_TRANSPARENT bit turned on. But when I press the mouse down, the form looses focus so I cannot catch whenever the mouse is clicked or dragged.
Does anyone have an idea?
Thanks in advance.
|
|
|
|
|
Here is a tip, I haven't tried it! Maybe you should play around by handling the WM_NCHITTEST window message in your program. You can return HTTTRANSPARENT or whatever you want, can pass the message handling to the default window proc, whatever you want. Whit this you may manage to handle mouse messages. Making the form opaque/transparent is another task on top of input handling, you can find lots of tutorials on how to do that correctly.
|
|
|
|
|
Thank you very much for your hint. I played around with WM_NCHITTEST and HTTTRANSPARENT but the form will only avoid my mouse click and does not pass the click event to the beneath window of it
|
|
|
|
|
|
Thank you for finding this for me. I read this before posting my question, but my problem is: When I click through my window, I don't have anyway to get my form receive mouse messages.
|
|
|
|
|
I found a solution: Use a global mouse hook to capture all mouse down event on the screen, and depend on the condition, I can pass this message to the beneath application or destroy it.
|
|
|
|
|
I do not no how to create graph in c++?????????
|
|
|
|
|
Have you tried doing any research for samples or articles?
Use the best guess
|
|
|
|
|
Skinning cats comes to mind.
Steve
|
|
|
|
|
You have several options. Two of them are:
- (The hard way) Use graphics primitives (provided, for instance by
GDI or GDI+ ) to draw yourself the graph on the screen. - Use a graph control (or a graph library).
Veni, vidi, vici.
|
|
|
|
|
u have two ways to create graph in C++
u can use windows api,SDK(firstly,register window class,then create the window)to create
or u can use MFC to create graph
|
|
|
|
|
In my project, a batch file should be first started to launch cmd windows, as well as initializing some parameters and some background processes. in the cmd windows,my own calculation processes could be started by typing the exe name directly. Now, i've written a MFC application program, and want to implement my calculaiton processes in a dialog button. I want to use ShellExecute where the first paramter is the cmd window handle i've got. Can anybody tell me how to write the shellexexute to post a command line to an existing cmd windows.
many thanks.
|
|
|
|
|
The only method I know is creating a child process with redirected input and output. An example can be found in the MSDN: Creating a Child Process with Redirected Input and Output[^]. But I'm not sure if this can be also done with the command shell itself.
Another option is changing your design to use a master application instead of the batch file that starts all necessary processes where the master application and the processes use some kind of Interprocess Communications[^].
|
|
|
|
|
many thanks, i'll try it.
|
|
|
|
|
Why I can't catch CMainFrame::OnLButtonDblClk in CMainFrame ?
void CMainFrame::OnLButtonDblClk(UINT nFlags, CPoint point)
{
TRACE("Hello\n");
CMDIFrameWnd::OnLButtonDblClk(nFlags, point);
}
I can't see any trace ... Why ?
Thank you.
|
|
|
|
|
From the WM_LBUTTONDBLCLICK entry in the MSDN:
Quote: Posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
The message is probably send to a child window of your main frame window (e.g. a view window).
|
|
|
|
|
Well, I would like to catch double-click message on CMainFrame when I haven't any childs open, and on non-child area of CMainFrame.
modified 10-Apr-13 3:00am.
|
|
|
|
|
Does your child view class include CS_DBLCLKS in its specification?
Use the best guess
|
|
|
|
|
No, I think he hasn't, because I had tried that on a default MDI application ...
|
|
|
|
|
U can catch the click in view class
because the message is posted to the CView class by the framework ,not the CMainFrame class
|
|
|
|
|
And when I didn't have any child open ?
|
|
|
|
|
Hello Friends
I am creating a mfc based application which is working fine on WinXP But If I run same application on Win7 then while Starting,a whilte image is appearing and disappearing[ like a white flash image].
But,If I Disable "Enable desktop Composition" option under system dialog named performance Options.Then it is not showing any white flash image.
After that I tried to Disable this option programmatically even,it does but then it fluctuating the screen while startup of application as we are disabling on initializing of application.
So, Any ideas to get rid of this white flash image.
Regards
Y
|
|
|
|
|
Which tools(IDE) did u used created the MFC Application?
applications that created by vc6.0 is not compatible to win7.
I Guess.
|
|
|
|