|
By the way, my post assumes that you have a CHTMLView. I doubt that it's possible to pass a CString to IE, probably you do need to create a file if you want an external application to show it. But if you want to show HTML from memory within your program, then this is the way to do it.
|
|
|
|
|
Hi experts
I wrote an application that "sits" in systray and popups a menu using "TrackPopupMenu".
The problem is that when select a different window while the menu is open it still remains at top and I must close it by selecting one option from the menu.
Is this a bug or did I forget to do something?
bye
|
|
|
|
|
|
http://www.codeproject.com/shell/systemtray.asp
it gives a solution to this problem.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
MSFlexGrid seems to be crashing my program when I run it. This seems to happen on machines that I do not have Microsoft VC++ installed nor Visual Basic. Is this something that can be easily fixed by grabbing a dll or is this a little more involved such as registering the control with the host machine? Can Install Shield register the control if this is necessary?
Thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
Hey...how would I get rid of the blue bar at the top that has a caption? I have this to create the window...
WndSplash = CreateWindow (SplashClass, NULL, NULL,150, 150, 500, 250, NULL, NULL, hInstance, NULL);
Obviously, I didn't add any parameters that put a caption or any maximize or minimize buttons at the top, but when loaded, I still get a blue bar at the top of the window. How would I get rid of this? Thanks - Dave
|
|
|
|
|
|
Use this:
CreateWindow(SplashClass, NULL, WS_DLGFRAME,...
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I'm looking for a way to retrieve the handle or ID of a process main thread.
Can anybody here tell me how to do this?
Regards,
Sebastian
|
|
|
|
|
You mean GetCurrentThread() or GetCurrentThreadId(), or do you mean from a different process?
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
I mean the ID of the main thread in a different process.
Sebastian
|
|
|
|
|
If you can identify the main window of the process (bit of a trick in itself) you can call GetWindowThreadProcessId .
|
|
|
|
|
Hi,
the problem is that I want to identify the main window of the process by comparing its owning-thread ID with the ID of the process main thread...
If you can tell me how to identify the main window, I won't need the main thread ID anymore...
Sebastian
|
|
|
|
|
There is no such thing as a 'main window' of a process. So what ever you are trying to do might be flawed by design.
A process can create 0 to N windows.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Well, I think of the top level window with the caption etc (i.e. CWinThread::m_pMainWnd in the MFC world) as being the 'main' window - the one to close to terminate the app - but I guess you could argue the point.
I've used ::GetTopWindow and ::GetNextWindow to get the top level windows on the desktop, and if you knew, say, the caption of the window you were looking for, you would be able to identify it with ::SendMessage(hwnd,WM_GETTEXT...(yes, keep in mind that there can be more than one 'top level' window in a process).
Given that nasty bit of strongly coupled heuristic hoop jumping through, you might want to add GetWindowThreadProcessId and GetWindowModuleFileName to the mix.
later...
Now that I think of it, for some apps you can eliminate some of the windows that don't return anything for WM_GETTEXT. But Tim has a point - identifying the 'main' window is tricky - you need to have a clue as to the caption or perhaps window class in order to pull this off, I think.
This is a question that's been seen here before, and I don't think a general solution has been proposed. Maybe if you posted more info about your current problem someone might have a specific fix you could use in your situation.
|
|
|
|
|
First, thank you for your help so far.
Here's some more information about my problem:
I want to fill a list (box) with processes (represented through window titles) to terminate. To perform this task I'm using EnumWindows(). In the EnumWindowsProc I filter out invisible windows, windows without a title, certain window classes (tooltips etc.) and windows that don't return NULL for GetWindow(hWnd, GW_OWNER)...
This works fine if there's only one (top-level) window-owning thread per process. Otherwise more than one window per process passes my EnumWindowsProc. To avoid this I want to filter out all windows created by secondary threads...
Does anybody here know a solution?
|
|
|
|
|
Hi
I just wrote a function that hides multiple or a single window(s).
It looks like this:
void HideWindows(HWND wnds)
{...}
but it should work with HWND-arrays ( HWND wnds[20]) same as with a single variable (HWND window).
how can I accomplish this?
thanks in advance
|
|
|
|
|
void HideWindows (HWND *pwnds, int nCount)
{
}
If this is C++, you can add the helper function.
void HideWindows (HWND hWnd)
{
HideWindows (&hWnd, 1);
}
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I can show you what the function does in fact:
void TaskbarOp(BOOL Add, BOOL Multiple, const int IfMultipleThenCount, const HWND *pWindows)
{
CoInitialize(NULL);
ITaskbarList *pDisp = NULL;
CoCreateInstance( CLSID_TaskbarList, NULL, CLSCTX_SERVER, IID_ITaskbarList, (LPVOID *) &pDisp );
if(Multiple)
{
for(int i = 0; i < IfMultipleThenCount; i++)
{
if(Add)
pDisp->AddTab( pWindows[i] );
else
pDisp->DeleteTab( pWindows[i] );
}
}
else
{
if(Add)
pDisp->AddTab( pWindows );
else
pDisp->DeleteTab( pWindows );
}
pDisp->Release();
CoUninitialize();
}
is there something I should change? There are some error at
else
{
if(Add)
pDisp->AddTab( pWindows );
else
pDisp->DeleteTab( pWindows );
}
|
|
|
|
|
The diference is that you are passing pWindows.
pWindows is a pointer to HWND and pWindows[i] is a HWND.
Best Regards
Carlos Antollini.
|
|
|
|
|
What should I pass then instead of pWindows?
|
|
|
|
|
You are WAY over designing your routine. How about something like this.
void TaskbarOp(BOOL Add, const int nCount, const HWND *pWindows)
{
ITaskbarList *pDisp = NULL;
CoCreateInstance( CLSID_TaskbarList, NULL, CLSCTX_SERVER, IID_ITaskbarList, (LPVOID *) &pDisp );
for(int i = 0; i < IfMultipleThenCount; i++)
{
if(Add)
pDisp->AddTab( pWindows[i] );
else
pDisp->DeleteTab( pWindows[i] );
}
pDisp->Release();
}
void TaskbarOp(BOOL Add, HWND hWnd)
{
TaskbarOp(Add, 1, &hWnd);
}
Also, don't call CoInitialize/CoUninitialize like that unless you really really have to. Just call CoInitialize at program start and CoUninitialize at the end.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
You are ingenious
Thanks a lot!
|
|
|
|
|
I'm writing a program in API (not MFC) and my current dillemma is destroying windows. I know DestroyWindow() destroys it, but then it processes WM_DESTROY and a PostQuitMessage(0) and the whole program exits. I just want to hide or quit the window without the whole program running. If I don't use PostQuitMessage(0), the window disappears but it still exists in the background and runs in the task manager though no windows are apparent, and I dont want that. Whats a good command or way to close or hide a window without quitting the program? Thanks - Dave
|
|
|
|
|
What About ShowWindow(SW_HIDE);?
best Regards
Carlos Antollini.
|
|
|
|