|
Thanks!
Looked at it and it was rather easy.
To open the control panel it's just the "Control.exe" file
and to open the Speech Properties I used "Control.exe speech"
|
|
|
|
|
Hello all,
I want to open an IE window...that I have done..but i dont want any other window to be opened..after this one..I have trapped all functions to open the new window using keyboard and mouse hooks..but as i cannot disable mouse leftclick..so there is a probability that i can click on any link and if that links opens in new window..then new window will open..can anyone suggest what i need to do...any help, pointers or ideas are highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
I don't know if it will work but it might help!
Let's get some things straigt first:
If you open a link in a new window, it's not a child window, since the fact that when you close the first Iexplorer, the others are not closed.
based upon this, you can install a hook on the Iexplorer (I don't know which one, but any may do). In shared memmory or a disk file you can count how many Iexplorers are opened! if the number exceeds 1 you can post a WM_QUIT message or do anything brutal to close the window.
hope this helps .
|
|
|
|
|
Hi,
I posted this last week, and tried to work on this over the weekend but with no success. This is something that i can't seem to figure out. Can someone tell me how to do this exactly? I never really coded before and this is causing me much headaches.
This was the suggestion that I received from G.Steudtel:
Try to get the applications pointer of its CMainCommand instance, and use this pointer.
Or send/post the command to the application as if the user has selected the dialog via the menu.
Here is what I posted:
I have a modeless window and a modal window, each having their own window option that when selected bring up the corresonding window. The modal window has radio buttons on it, so when a specific reaio button is selected and ok is entered, it will display the modless window.
When I select the menu to bring up the modeless window it works fine, only opens one window or sets focus to it if it has not been created. When I select the modal window and check the appropriate radio it will display the modeless window regardless if it is created already. It will just continue to duplicate the modeless window.
Can someone help me out so that it will set focus on the open window and not diplicate it.
currently I am using this code in the OnOK method.
if (!m_pCommandOpt)
{
m_pCommandOpt = new CMainCommand(this);
if (m_pCommandOpt->Create(IDD_MAIN_TAB_DIALOG) == TRUE)
{
GetDlgItem(IDOK)->EnableWindow(FALSE);
m_pCommandOpt->ShowWindow(SW_SHOW);
}
}
else m_pCommandOpt->SetActiveWindow();
THANKS in advance.
|
|
|
|
|
Are you using the same pointer in your dialog class as you are when you use the menu? Yes, I know it's a silly question, but I can't really think of any other reason why it wouldn't work.
The other thing you could try is to send a WM_COMMAND message corresponding to your menu item, so that all the window stuff is done in the same place. That would probably simplify things. I think this was mentioned before, but it's what I would do, so I'll mention it again
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am not using the same pointer....I don't know how to get the two classes to communicate with each other. Could you please show me how to get one pointer from one class to another one? I tried to do this, but was couldn't get the code to compile correctly.
How would I do the option you mention about the WM_COMMAND? I do not totally understand what you mean by this.
THANKS FOR YOUR HELP.
|
|
|
|
|
Jay Hova wrote:
How would I do the option you mention about the WM_COMMAND? I do not totally understand what you mean by this.
Say your menu item was ID_SHOWDIALOG (for example). You would send a message to your frame window exactly the same as what Windows does when a menu option is chosen.
AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_SHOWDIALOG, NULL); Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm sorry for being so slow with this, but what does this exactly do. How will this solve my problem? Also where would i put this code. The code that I posted originally is the same code I use for both menu items...
Thanks again for your help and understanding
|
|
|
|
|
Ok. Basically, using that piece of code will simulate in software exactly what happens when the user selects a menu item. You would put this code where you handle the radio button being pressed, so that pressing the radio button behaves the same as selecting a menu item. This means that the code to actually display the dialog would only be in one place, and should solve your problem.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Many thanks Ryan. You just solved my problem that I have spent way too many hours on.
Worked like a charm.
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I feel sorry for my short and as I thought understandable answer. I didnot know, that you never coded before. So let me dig a little deeper with this answer.
In your main application class you should have a pointer to or an instance of class CMainCommand. This pointer or instance must be used by all calls to open the dialogs.
Have a look at the headerfile of your application class to find out, wheter the CMainCommand thing is private/protected or public.
In the application headerfile add a member function:
<br />
CMainCommand* GetCommandPointer(void);<br />
Assuming it is a pointer (lets call it pMainCommand) write in the applications cpp-file
<br />
CMainCommand* CWinApp::GetCommandPointer(void)<br />
{ return pMainCommand;}<br />
Of course you have to substitute CWinApp and pMainCommand with the names of the actual class name and variable name. If you do not use a pointer, but an instance of the class replace pMainCommand with &mainCommand;
In your OnOk handler write
<br />
m_pCommantOpt = DYNAMIC_DOWNCAST(CWinApp,AfxGetApp())->GetCommandPointer();<br />
Here too you have to substitute the CWinApp with the actual name of your application class. Also you have to include the applications header file into your cpp file. (But this should be done already by class wizard)
This line above does:
It retrieves a pointer to the application class instance, casts it to your application class and after the casting calls GetCommandPointer.
Then delete the line where you create an new instance of CMainCommand, bailing out, when the pointer is inavlid and tell the user that someting went wrong.
<br />
m_pCommantOpt = DYNAMIC_DOWNCAST(CWinApp,AfxGetApp())->GetCommandPointer();<br />
if( m_pCommandOpt != NULL )<br />
{ m_pCommandOpt = new CMainCommand(this);<br />
if( m_pCommandOpt->Create(IDD_MAIN_TAB_DIALOG) == TRUE )<br />
{ GetDlgItem(IDOK)->EnableWindow(FALSE);<br />
m_pCommandOpt->ShowWindow(SW_SHOW);<br />
}<br />
else<br />
{ m_pCommandOpt->SetActiveWindow(); <br />
}<br />
}<br />
else<br />
AfxMessagebox("Something went wrong");<br />
Regards
G.Steudtel
|
|
|
|
|
Thanks for all the help. I finally got it and it works just like you said it would. THANKS AGAIN!
|
|
|
|
|
Hello, I have a problem now. I want to disable cd rom autoplay function. Because i didn't want to autoplay in my program. I can't do it? May be it need modify register table. Can you help me? I wish you. Waiting online...
|
|
|
|
|
Look here[^]. Make sure you read the entire thread, especially the warnings by Tim Smith and John M. Drescher at the bottom.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, Sir:
I saw your answer about disable CDROM autoplay function . and I think so that It is a very bad idea to change people's registry. And I have sawn the "Enable and Disable AutoPlay" in MSDN. I do it that:
UINT g_uQueryCancelAutoPlay = 0;
BOOL DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
...
default:
if (!g_uQueryCancelAutoPlay)
{
g_uQueryCancelAutoPlay = RegisterWindowMessage(TEXT("QueryCancelAutoPlay"));
}
if (uMsg == g_uQueryCancelAutoPlay)
{
SetWindowLong(hDlg, DWL_MSGRESULT, TRUE);
return 1;
}
}
}
but I can't success. Can you tell me How to do it? I wish to get your reply? Thanks
|
|
|
|
|
Are you using that exact code? You'll need to ues hWnd instead on hDlg in the call to SetWindowLong() otherwise it won't compile.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, Sir:
I do it like that. But I can't success too. It seems that it can't get the message. And I use the code in PretranslateMessage(), but it can't work, too. I don't know why it is. My program is a dialob-base program. Have you a example to do that? if you have, I wish to get it from you? Thanks your reply. You are welcome.
|
|
|
|
|
michaelwan007 wrote:
Have you a example to do that?
No, sorry
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I want to set screensaver..I have to download a screensaver from a server and set it to the default screensaver...can anyone help me out here..I hope this is possible..Please help me out...Any help and pointers are highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
The user's current screensaver is stored in the registry: HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE key. Just set the path to the screensaver executable there.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi,
thanks a lot..can u give me some code which queries the value of registry or overwrites it..any functions will also do..thanks a lot again..I appreciate ur help..
Himanshu
|
|
|
|
|
RegOpenKeyEx()
RegCreateKeyEx()
RegQueryValueEx()
RegSetValueEx()
etc...
|
|
|
|
|
Hi there...
I'm writing a app in VC++ that needs a database, I'm currently using this ODBC recordsetclass (Using MFC)
I thought that working with recordsets will make the fastest way to eg insert 100.000 entries into the database as quick as possible...
I've tested with a simple MS Access database and it took over 6 minutes to insert 100.000 dummy entries (1 text field, with 255 chars)
Since it takes some time to test'em all, I would ask if anybody know which protocol is the fastes? ODBC/ADO/OLE ????
===================
Lars [Large] Werner
lars@werner.no
===================
|
|
|
|
|
ODBC is generally a bit slower than OLE DB, because there are more layers involved - you talk to the ODBC manager, which talks to a driver, whereas with OLE DB, your program talks directly to the provider.
However, your experience may be different, depending on the driver or provider. One supplier's OLE DB provider might be less well optimised than their ODBC driver.
Using the native OLE DB provider will always be quicker than using MSDASQL, which is an OLE DB provider that wraps the ODBC manager. This allows connections to work - it says nothing about performance.
In this particular case, I suspect that your problem is actually per-statement overhead. If you can perform a batch update or insert, that would probably be better. I'm not sure how to go about this with ODBC - it's structured around executing SQL statements, so you probably need to have it execute a big batch of INSERT statements all chained together as a single logical statement.
For OLE DB, you ask for the IRowsetUpdate interface and use the InsertRow method to insert a new row. Once all rows are inserted, you call the Update method to update a complete batch of rows.
From C++, I would personally avoid ADO. You spend a lot of time working around the VBisms of the interface rather than being productive, IMO.
|
|
|
|