|
What do you mean by take care of. I can override OnInitDialog and get the value that the base class returns, but what should I do with it.
|
|
|
|
|
the last OnInitDialog () line is that one :
<font style="color:blue;">return </font>TRUE; <font style="color:green;">
what does it make you fell ??
TOXCCT >>> GEII power
|
|
|
|
|
toxcct wrote:
what does it make you fell ??
I feel that you must be feeling very stupid with your answer.
God is Real, unless declared Integer.
|
|
|
|
|
Did you set the pointer to the first dialog as a parent of the second?
Robert-Antonio
"Give a man a fish, he owes you one fish. Teach a man to fish, you give up
your monopoly on fisheries."
|
|
|
|
|
Solved it. the problem was that I posted the message to another window that created the dialog.
|
|
|
|
|
Is it possible to "reuse" the explorer context menu?
I have a file name, and want to Windows Explorer context menu for that file as a sub-menu of my own context menu. Execution of the command etc. should all be left to explorer (i.e. I don't want to "interfere" with this)
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
I have a file name, and want to Windows Explorer context menu for that file as a sub-menu of my own context menu
I belive you are talking abut shell extension, Micheal Dunn has few articles on what you are looking for.
God is Real, unless declared Integer.
|
|
|
|
|
No, I don't want to write a shell extension, I just hope to find a way to reuse this menu (without turning the file name into a PIDL and then playing explorer - I roughly know the protocol how this menu is created )
But you're right, I should have thought of Michaels articles, I'll check them....
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
Can somebody please explain what I have to do in order to have CButton controls on dialog respond to WM_CHAR messages (and not to use PreTranslateMessage() ). I tried to put OnChar() in my instance of CDialog with classWizard but the dialog just beeps when I press keys.
|
|
|
|
|
Are you talking about shortcut keys ? did ya try putting '&' before one of the char in the dialog button text ?
God is Real, unless declared Integer.
|
|
|
|
|
Did you try it by subclassing cbutton.....you should derive your own class(CMyButton) from CButton and use CMyButton on your dialog box instead of CButton and then add the messagemap for WM_CHAR ...it will work...
cheers
|
|
|
|
|
When you detect a second instance is being launched, why not call ShowWindow(SW_RESTORE) ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Wait... so the 1st instance should control how many instances should run and not the 2nd one? Right now, I'm using CWinApp::InitInstance to check if an instance is already running. If so, I don't create the dialog and return FALSE so that instance exits.
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|
|
Read these two articles on how to handle multiple instances:
http://flounder.com/nomultiples.htm
http://naughter.com/sinstance.html
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
You cud try some IPC mechanism (mutex, event etc) to communicate between the 1st and 2nd instance. When the 2nd instance comes up it cud for e.g set an event in the 1st instance to signal it to show itself.
-Mel
|
|
|
|
|
melwyn wrote:
You cud try some IPC mechanism (mutex, event etc) to communicate between the 1st and 2nd instance
yes, it will work to determine that another instance is running, but how will you use to restore the window ???
God is Real, unless declared Integer.
|
|
|
|
|
I had used this technique long back...
Registered a windows message. when another instnce is found then broadcast the message.
Handle the event and post showwindow to your main window.
God is Real, unless declared Integer.
|
|
|
|
|
Well I managed to find a solution. In OnInitDialog(), I just save the m_hWnd value to the registry and use that value with WM_SHOWWINDOW if needed. The only drawback is that even though the dialog window appears, it hasn't set focus and the taskbar isn't refreshing. I have to click on the dialog window to activate it and make it visible in the taskbar. I tried WM_ACTIVATE but with no success...
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|
|
The only drawback is that even though the dialog window appears, it hasn't set focus and the taskbar isn't refreshing.
CWindow::BringWindowToTop<br />
BOOL BringWindowToTop( );
Remarks
Brings the window to the top of the Z order.
Does this helps???
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
No The thing is that it will work once (with or w/o BringWindowToTop( )) but after that the dialog will always be at the bottom of the z-order and wont be displayed in the taskbar...
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|
|
LukeV wrote:
I just save the m_hWnd value to the registry
very stupid, will lead to lot of bugs in the long run.
The method that told you about registering the window will surely work.
While using FindWindow did you give the classname or the windowtitle.
I think i have used classname to find the window and it worked greate.
God is Real, unless declared Integer.
|
|
|
|
|
Hi,
I a have an MDI app with each child frame as a CRichEditView.
I cannot figure out how to load/stream files into the view. Drag+Drop is no probs but I need the ability to load/stream files into the view.
I cannot find a solution anywhere.
Pleae help.
|
|
|
|
|
search for the class RichEditCtrlGS on codeproject.
I found the solution to this problem there last week.
It gives you all the information you need.
if you do not find it i will send it to you.
|
|
|
|
|
Hi,
I have an application that is hidding in the tray. Currently, I'm able to detect how many instances of my app are running so I can prevent that more than one is. What I'd like to do is that if a 2nd instance is launched, it would bring the main dialog up from the 1st instance.
FindWindow will not work since the dialog is not visible while the app is hiding in the tray. Is there some trick to find a hidden window, or perhaps I could manage to find the tray icon's menu and trigger a message?
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|