|
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
|
|
|
|
|
Is there a way to find out if two paths/volumes are on the same physical drive?
I want to know if C: / D: are on the same disk.
/Mathias
|
|
|
|
|
try it with the filehandle
|
|
|
|
|
I am trying to clear/delete the AutoComplete data (like Internet Explorer's "Clear Forms" and "Clear Passwords" options)
I believe AutoComplete data is stored in the registry under hidden keys.
How do you determine which registry keys need to be deleted?
Can you just delete them or are they protected?
I use C with the Win32 API.
Thanks,
Richard
|
|
|
|
|
Check out this key.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete
Kuphryn
|
|
|
|
|
Which simply turns auto-complete on or off. It does not actually clear the entries.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I would say download from http://www.sysinternals.com/ntw2k/source/regmon.shtml Regmon and check what IE does when you clear the forms
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I have a program where I make use of a proprietary DLL containing non vital code for the application. What I want is, if the user has the DLL, it's functionallity will be added, but if it's missing, the user will have to do without these extra features.
The only solutions I can come up with to this problem is to eiter load the DLL manually, having to find all functions I need (hundreds), or to create something close to a proxy-dll containing all application code for the extra features, linking it to the proprietary DLL, and in turn load this DLL manually.
None of these solutions is practical in terms of workload. Is there another, more simpel, way to do it?
Since my guess is no, I'd hope someone out there says yes
|
|
|
|
|