Click here to Skip to main content
15,917,632 members
Home / Discussions / COM
   

COM

 
GeneralRe: Display name of components Pin
Vi216-Jul-03 21:23
Vi216-Jul-03 21:23 
GeneralRe: Display name of components Pin
first_sandy16-Jul-03 22:27
first_sandy16-Jul-03 22:27 
GeneralRe: Display name of components Pin
Vi216-Jul-03 22:52
Vi216-Jul-03 22:52 
GeneralRe: Display name of components Pin
first_sandy16-Jul-03 23:00
first_sandy16-Jul-03 23:00 
GeneralRe: Display name of components Pin
Vi217-Jul-03 18:03
Vi217-Jul-03 18:03 
GeneralRe: Display name of components Pin
Mil1017-Jul-03 18:47
Mil1017-Jul-03 18:47 
GeneralIMAPI Sample Code Pin
Martin Hinchy16-Jul-03 15:49
Martin Hinchy16-Jul-03 15:49 
GeneralLose focus by using CoCreateInstance Pin
16-Jul-03 15:14
suss16-Jul-03 15:14 
Hi,

When I use the following code to create an instance of Internet Explorer, the top window seems to lose focus.

HWND hForegroundWindow = GetForegroundWindow();

CLSIDFromProgID(OLESTR("InternetExplorer.Application"), &clsid);
CoCreateInstance(clsid, NULL, CLSCTX_SERVER, IID_IUnknown, (LPVOID*)&pUnk);

pUnk->QueryInterface(IID_IWebBrowser2, (LPVOID*)&pWB);
pUnk->Release();

SetForegroundWindow(hForegroundWindow);

When CoCreateInstance function is called, the top window loses it focus, and invisible IE seems to receive the focus.
I get the handle to the foreground window and set it back after CoCreateInstance is called. However, i still do lose focus in that couple seconds. This is particularly annonying when i am tying something. Because when the top window loses its focus, the input will stop. Is there anyway to make it so that when CoCreateInstance is called, the foreground will still keep the focus?

Thanks
GeneralAccessing Outlook Express Pin
Brigg Thorp16-Jul-03 9:57
Brigg Thorp16-Jul-03 9:57 
GeneralRe: Accessing Outlook Express Pin
Amit Dey18-Jul-03 9:34
Amit Dey18-Jul-03 9:34 
GeneralRe: Accessing Outlook Express Pin
Brigg Thorp25-Jul-03 9:45
Brigg Thorp25-Jul-03 9:45 
GeneralName of Component Servers Pin
first_sandy16-Jul-03 3:15
first_sandy16-Jul-03 3:15 
QuestionCOM handle leaks? Pin
Wayne Hutchinson15-Jul-03 7:53
Wayne Hutchinson15-Jul-03 7:53 
AnswerRe: COM handle leaks? Pin
Peter Weyzen17-Jul-03 18:30
Peter Weyzen17-Jul-03 18:30 
GeneralRe: COM handle leaks? Pin
Wayne Hutchinson18-Jul-03 7:30
Wayne Hutchinson18-Jul-03 7:30 
GeneralDownload ActiveX Pin
Anonymous15-Jul-03 5:36
Anonymous15-Jul-03 5:36 
GeneralRe: Download ActiveX Pin
Anonymous15-Jul-03 5:49
Anonymous15-Jul-03 5:49 
GeneralLocation transparency Pin
In-At14-Jul-03 20:02
In-At14-Jul-03 20:02 
QuestionHow to programmatically set the "Minutes until idle shutdown:" value in the Advanced Tab? Pin
ckatili14-Jul-03 11:00
ckatili14-Jul-03 11:00 
GeneralDirect Music Pin
Mad Docs Hairy Belly11-Jul-03 10:11
Mad Docs Hairy Belly11-Jul-03 10:11 
GeneralRe: Direct Music Pin
Hadi Rezaee12-Jul-03 10:57
Hadi Rezaee12-Jul-03 10:57 
GeneralUninstalling a COM component/server Pin
Anonymous11-Jul-03 8:18
Anonymous11-Jul-03 8:18 
GeneralRe: Uninstalling a COM component/server Pin
valikac12-Jul-03 5:05
valikac12-Jul-03 5:05 
GeneralRe: Uninstalling a COM component/server Pin
Anonymous12-Jul-03 13:07
Anonymous12-Jul-03 13:07 
QuestionHOW TO IMPORT A TAB DELIMITED TEXT FILE INTO AN ACCESS DATABSE PROGRAMMATICALLY? Pin
vcseeker9-Jul-03 23:13
vcseeker9-Jul-03 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.